Prerequisites
- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- REST API
Make sure you are in a group that has at least the
editor role within your tenant or project; for example, the default editors group. You can check this in the Administration → IAM section of the web console.-
Install and configure the Nebius AI Cloud CLI.
Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
cat ~/.nebius/config.yaml -
Make sure that you or the service account that you use is in a group that has at least the
editorrole within your tenant or project; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console.
- Install and initialize the Nebius SDK for Go.
- Make sure that you or the service account that you use is in a group that has at least the
editorrole within your tenant or project; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console.
- Install and initialize the Nebius SDK for Python.
- Make sure that you or the service account that you use is in a group that has at least the
editorrole within your tenant or project; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console.
- Install and initialize the Nebius SDK for JavaScript.
- Make sure that you or the service account that you use is in a group that has at least the
editorrole within your tenant or project; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console.
- Get an access token to authenticate to the REST API.
- Make sure that you or the service account that you use is in a group that has at least the
editorrole within your tenant or project; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console.
Devlabs
While a Devlab is stopped, you are not billed for computing resources. You are still billed for the disk of the underlying Compute virtual machine (VM) and any mounted volumes. Data under the workspace path persists across stop and restart operations.How to stop and restart a Devlab
- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- In the sidebar, go to
Serverless AI → Devlabs.
- Find the Devlab and then click
→ Stop or Restart.
- In the window that opens, confirm the action.
-
List Devlabs and copy the ID of the Devlab you want to stop:
nebius ai devlab list -
To stop a Devlab, run the following command:
nebius ai devlab stop <devlab_ID> -
To restart a Devlab, run the following command:
nebius ai devlab restart <devlab_ID>
-
List Devlabs:
In
listDevlabService := sdk.Services().Ai().V1().Devlab() listDevlabsRequest := &ai.ListDevlabsRequest{ ParentId: "<project_ID>", } for { devlabs, err := listDevlabService.List( ctx, listDevlabsRequest, ) if err != nil { return fmt.Errorf("list devlabs: %w", err) } fmt.Println(devlabs) if devlabs.GetNextPageToken() == "" { break } listDevlabsRequest.PageToken = devlabs.GetNextPageToken() }ai.ListDevlabsRequest, setParentIdto the project ID. In the response, copy theMetadata.Idof the Devlab to stop. -
Stop the Devlab:
In
stopDevlabService := sdk.Services().Ai().V1().Devlab() stopDevlabOperation, err := stopDevlabService.Stop( ctx, &ai.StopDevlabRequest{Id: "<devlab_ID>"}, ) if err != nil { return fmt.Errorf("stop devlab: %w", err) } if _, err = stopDevlabOperation.Wait(ctx); err != nil { return fmt.Errorf("wait for devlab stop: %w", err) }ai.StopDevlabRequest, setIdto the Devlab ID. The sample waits for the stop operation to complete. -
When you need the Devlab again, restart it:
In
restartDevlabService := sdk.Services().Ai().V1().Devlab() restartDevlabOperation, err := restartDevlabService.Restart( ctx, &ai.RestartDevlabRequest{Id: "<devlab_ID>"}, ) if err != nil { return fmt.Errorf("restart devlab: %w", err) } if _, err = restartDevlabOperation.Wait(ctx); err != nil { return fmt.Errorf("wait for devlab restart: %w", err) }ai.RestartDevlabRequest, setIdto the same Devlab ID. The sample waits for the restart operation to complete.
-
List Devlabs:
In
list_devlab_service = DevlabServiceClient(sdk) list_devlabs_request = ListDevlabsRequest( parent_id="<project_ID>", ) while True: devlabs = await list_devlab_service.list( list_devlabs_request, ) print(devlabs) if not devlabs.next_page_token: break list_devlabs_request.page_token = devlabs.next_page_tokenListDevlabsRequest, setparent_idto the project ID. In the response, copy themetadata.idof the Devlab to stop. -
Stop the Devlab:
In
stop_devlab_service = DevlabServiceClient(sdk) stop_devlab_operation = await stop_devlab_service.stop( StopDevlabRequest(id="<devlab_ID>"), ) await stop_devlab_operation.wait()StopDevlabRequest, setidto the Devlab ID. The sample waits for the stop operation to complete. -
When you need the Devlab again, restart it:
In
restart_devlab_service = DevlabServiceClient(sdk) restart_devlab_operation = await restart_devlab_service.restart( RestartDevlabRequest(id="<devlab_ID>"), ) await restart_devlab_operation.wait()RestartDevlabRequest, setidto the same Devlab ID. The sample waits for the restart operation to complete.
-
List Devlabs:
In
const listDevlabService = new DevlabService(sdk); const listDevlabsRequest = ListDevlabsRequest.create({ parentId: "<project_ID>", }); while (true) { const devlabs = await listDevlabService.list( listDevlabsRequest, ); console.log(devlabs); if (!devlabs.nextPageToken) { break; } listDevlabsRequest.pageToken = devlabs.nextPageToken; }ListDevlabsRequest, setparentIdto the project ID. In the response, copy themetadata.idof the Devlab to stop. -
Stop the Devlab:
In
const stopDevlabService = new DevlabService(sdk); const stopDevlabOperation = await stopDevlabService.stop( StopDevlabRequest.create({ id: "<devlab_ID>" }), ).result; await stopDevlabOperation.wait();StopDevlabRequest, setidto the Devlab ID. The sample waits for the stop operation to complete. -
When you need the Devlab again, restart it:
In
const restartDevlabService = new DevlabService(sdk); const restartDevlabOperation = await restartDevlabService.restart( RestartDevlabRequest.create({ id: "<devlab_ID>" }), ).result; await restartDevlabOperation.wait();RestartDevlabRequest, setidto the same Devlab ID. The sample waits for the restart operation to complete.
Endpoints
While an endpoint is stopped, you are not billed for computing resources. You are still billed for any mounted volumes. When you stop an endpoint, Serverless AI releases the underlying Compute VM and its disk but preserves the endpoint’s configuration, including a reserved IP address and a public HTTPS URL. When you restart the endpoint, Serverless AI creates a new VM and once again pulls the container image that was used earlier. As a result, the endpoint is available at the same URL and IP address. The URL and address only change if you delete the endpoint and create a new one. Since the original VM and its disk are released when you stop an endpoint, no data on this disk is preserved. Unlike Devlabs, endpoints don’t preserve the workspace on the disk across stop and restart operations.How to stop and restart an endpoint
- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- REST API
- In the sidebar, go to
Serverless AI → Endpoints.
- Find the endpoint and then click
→ Stop or Restart.
- In the window that opens, confirm the action.
-
To get the endpoint ID, list all endpoints:
In the output, copy the ID of the required endpoint.
nebius ai endpoint list -
Restart the endpoint:
This command stops and then starts the endpoint, so you reboot it.
nebius ai endpoint restart --id <endpoint_ID>
nebius ai endpoint stop --id <endpoint_ID>
nebius ai endpoint start --id <endpoint_ID>
-
List endpoints:
In
listEndpointService := sdk.Services().Ai().V1().Endpoint() endpoints, err := listEndpointService.List( ctx, &ai.ListEndpointsRequest{ ParentId: "<project_ID>", }, ) if err != nil { return fmt.Errorf("list endpoints: %w", err) } fmt.Println(endpoints)ai.ListEndpointsRequest, setParentIdto the project ID. In the response, copy theMetadata.Idof the required endpoint. -
Restart the endpoint:
In
endpointService := sdk.Services().Ai().V1().Endpoint() restartEndpointOperation, err := endpointService.Restart( ctx, &ai.RestartEndpointRequest{ Id: "<endpoint_ID>", }, ) if err != nil { return fmt.Errorf("restart endpoint: %w", err) } if _, err = restartEndpointOperation.Wait(ctx); err != nil { return fmt.Errorf("wait for endpoint restart: %w", err) }ai.RestartEndpointRequest, setIdto the endpoint ID that you copied. This code stops and then starts the endpoint, so you reboot it.
stopEndpointService := sdk.Services().Ai().V1().Endpoint()
stopEndpointOperation, err := stopEndpointService.Stop(
ctx,
&ai.StopEndpointRequest{
Id: "<endpoint_ID>",
},
)
if err != nil {
return fmt.Errorf("stop endpoint: %w", err)
}
if _, err = stopEndpointOperation.Wait(ctx); err != nil {
return fmt.Errorf("wait for endpoint stop: %w", err)
}
ai.StopEndpointRequest, set Id to the endpoint ID that you copied.To start the endpoint, run the following code:startEndpointService := sdk.Services().Ai().V1().Endpoint()
startEndpointOperation, err := startEndpointService.Start(
ctx,
&ai.StartEndpointRequest{
Id: "<endpoint_ID>",
},
)
if err != nil {
return fmt.Errorf("start endpoint: %w", err)
}
if _, err = startEndpointOperation.Wait(ctx); err != nil {
return fmt.Errorf("wait for endpoint start: %w", err)
}
ai.StartEndpointRequest, set Id to the endpoint ID that you copied.-
List endpoints:
In
list_endpoint_service = EndpointServiceClient(sdk) endpoints = await list_endpoint_service.list( ListEndpointsRequest(parent_id="<project_ID>"), ) print(endpoints)ListEndpointsRequest, setparent_idto the project ID. In the response, copy themetadata.idof the required endpoint. -
Restart the endpoint:
In
restart_endpoint_service = EndpointServiceClient(sdk) restart_endpoint_operation = await restart_endpoint_service.restart( RestartEndpointRequest(id="<endpoint_ID>"), ) await restart_endpoint_operation.wait()RestartEndpointRequest, setidto the endpoint ID that you copied. This code stops and then starts the endpoint, so you reboot it.
stop_endpoint_service = EndpointServiceClient(sdk)
stop_endpoint_operation = await stop_endpoint_service.stop(
StopEndpointRequest(id="<endpoint_ID>"),
)
await stop_endpoint_operation.wait()
StopEndpointRequest, set id to the endpoint ID that you copied.To start the endpoint, run the following code:start_endpoint_service = EndpointServiceClient(sdk)
start_endpoint_operation = await start_endpoint_service.start(
StartEndpointRequest(id="<endpoint_ID>"),
)
await start_endpoint_operation.wait()
StartEndpointRequest, set id to the endpoint ID that you copied.-
List endpoints:
In
const listEndpointService = new EndpointService(sdk); const endpoints = await listEndpointService.list( ListEndpointsRequest.create({ parentId: "<project_ID>", }), ); console.log(endpoints);ListEndpointsRequest, setparentIdto the project ID. In the response, copy themetadata.idof the required endpoint. -
Restart the endpoint:
In
const restartEndpointService = new EndpointService(sdk); const restartEndpointOperation = await restartEndpointService.restart( RestartEndpointRequest.create({ id: "<endpoint_ID>", }), ).result; await restartEndpointOperation.wait();RestartEndpointRequest, setidto the endpoint ID that you copied. This code stops and then starts the endpoint, so you reboot it.
const stopEndpointService = new EndpointService(sdk);
const stopEndpointOperation = await stopEndpointService.stop(
StopEndpointRequest.create({
id: "<endpoint_ID>",
}),
).result;
await stopEndpointOperation.wait();
StopEndpointRequest, set id to the endpoint ID that you copied.To start the endpoint, run the following code:const startEndpointService = new EndpointService(sdk);
const startEndpointOperation = await startEndpointService.start(
StartEndpointRequest.create({
id: "<endpoint_ID>",
}),
).result;
await startEndpointOperation.wait();
StartEndpointRequest, set id to the endpoint ID that you copied.-
List endpoints:
In the request, specify:
curl --request GET \ --url "https://api.nebius.cloud/ai/v1/endpoints?parentId=<project_ID>" \ --header "Authorization: Bearer <access_token>"- Your access token in the
Authorizationheader. - The project ID in the
parentIdquery parameter.
metadata.idof the required endpoint. - Your access token in the
-
Restart the endpoint:
In the request, specify:
curl --request POST \ --url 'https://api.nebius.cloud/ai/v1/endpoints/restart' \ --header "Authorization: Bearer <access_token>" \ --header 'Content-Type: application/json' \ --data '{ "id": "<endpoint_ID>" }'- Your access token in the
Authorizationheader. <endpoint_ID>: Endpoint ID that you copied.
- Your access token in the
curl --request POST \
--url 'https://api.nebius.cloud/ai/v1/endpoints/stop' \
--header "Authorization: Bearer <access_token>" \
--header 'Content-Type: application/json' \
--data '{
"id": "<endpoint_ID>"
}'
curl --request POST \
--url 'https://api.nebius.cloud/ai/v1/endpoints/start' \
--header "Authorization: Bearer <access_token>" \
--header 'Content-Type: application/json' \
--data '{
"id": "<endpoint_ID>"
}'