Skip to the content.

AI Studio — endpoints, jobs, devlabs

Module: services/ai · Image: nebius-mocker-ai · NEBIUS_MOCKER_SERVICES=ai M1 tier: T2 endpoint inventory (stub data plane) · T0 jobs, devlabs, hardware · Endpoint: apps.msp.api.nebius.cloud

Overview

Container-based serverless AI workloads:

Implementation status

Piece Status
nebius.ai.v1.EndpointService: Create (incl. dry_run), Get (view SECRET), GetByName, List (paged), Delete, Start, Stop, Restart ✅ T2 inventory · stub execution
Spec validation: image, ports, auth (auth_token ⊕ auth_token_mysterybox_secret, exactly one HTTP port), env vars, volumes/S3, injected files, registry credentials, disk minimums, platform/preset or gpu/cpu selectors ✅
Cross-service references (project, vpcsubnet, mbsec, mbsecver, pricingpolicy) checked through the authz hierarchy; MysteryBox refs pinned through pkg/peer SecretPayloads ✅
Lifecycle state machine as operations, synthetic instance, status.private_endpoints / public_endpoints ✅
Stub data plane: HTTPS on :4600 (200 / 401 / 503 / 404) with a mocker-generated local CA; TLS stub for TCP ports on :4601 ✅
Create checks the caller’s mysterybox.payload.read on every referenced MysteryBox secret ✅
Authorization rules for every RPC (ai.endpoints.get/list/create/delete/start/stop/restart, plus getSensitiveData for view SECRET); editors hold start/stop/restart, viewers only get/list ✅
nebius_ai_v1_endpoint resource and data source with the official Terraform provider, incl. auth_token_mysterybox_secret backed by a real nebius_mysterybox_v1_secret and subnet_id from a real nebius_vpc_v1_subnet ✅ e2e: test/terraform/ai
nebius ai endpoint create/get-by-name/get/list/stop/start/restart/delete + curl --cacert (docs quickstart, unmodified startswith("https://") filter) ✅ e2e: test/terraform/ai
Not yet: JobService, DevlabService, HardwareService, applications.v1alpha1.VmAppTemplateService, nebius ai endpoint logs; UDP ports are rejected (InvalidArgument on spec.ports[i].protocol) UNIMPLEMENTED

Verified against: nebius/api@4522189, terraform-provider-nebius v0.6.91, gosdk v0.2.100.

Emulation design

The inventory and its semantics are real; execution is a stub. No container, image pull or VM ever happens.

Resource and validation

Lifecycle

Verb Allowed from While the operation runs Ends in
Create — PROVISIONING RUNNING
Stop RUNNING, ERROR STOPPING STOPPED (instances released, URLs kept)
Start STOPPED, ERROR STARTING RUNNING (new instance)
Restart RUNNING, ERROR STARTING RUNNING (new instance)
Delete any settled or transitional state DELETING removed

Other verbs return FAILED_PRECONDITION (bad state); a second operation while one runs returns the operation-conflict error. With NEBIUS_MOCKER_OP_DELAY the transitional states are visible for that long. status.state_details.code is the short state name. status.instances holds one synthetic instance while running: a computeinstance-… ID that is not a real compute instance, a deterministic private IP, and a public IP when public_ip or SSH keys are set.

Stub data plane (contract)

The module starts two listeners (4580 is S3 and 4590 the registry). Both use TLS with a certificate signed by a local CA that the mocker creates on first start and keeps in NEBIUS_MOCKER_AI_TLS_DIR (default <user config dir>/nebius-mocker/ca, e.g. ~/Library/Application Support/nebius-mocker/ca on macOS, ~/.config/nebius-mocker/ca on Linux). Trust <dir>/ca.pem once: curl --cacert <dir>/ca.pem …, or add it to your OS trust store. The startup log prints the URL.

HTTP ports: HTTPS on NEBIUS_MOCKER_AI_LISTEN (default 127.0.0.1:4600). Routing is path-based, because the mock has no wildcard DNS for per-endpoint hosts:

Request Response
Unknown endpoint ID or port 404
Endpoint not RUNNING (provisioning, stopped, …) 503
Auth configured, Authorization: Bearer <token> missing or wrong 401 with WWW-Authenticate: Bearer
Running, token right (or no auth configured: endpoints without auth are open) 200

The 200 body is {"message":"endpoint was called","endpoint_id":"aiendpoint-…","port":80,"method":"POST","path":"/v1/chat/completions"}. The token is spec.auth_token, or the AUTH_TOKEN entry of the pinned MysteryBox secret version, read at call time (503 if that secret cannot be read).

TCP ports: TLS on NEBIUS_MOCKER_AI_TCP_LISTEN (default 127.0.0.1:4601). Nebius gives TCP ports a tls://<host>:443 address used with a TLS client; the mock gives tls://<endpoint-id>-p<container_port>.ai.localhost:4601 (*.localhost resolves to loopback; the suffix is NEBIUS_MOCKER_AI_TCP_DOMAIN). The listener routes by TLS server name (SNI), writes one line and closes the connection:

endpoint was called: aiendpoint-… port 5432     (RUNNING)
error 503: endpoint is not running (state STOPPED)
error 404: …                                     (unknown endpoint, or not one of its TCP ports)

e.g. openssl s_client -connect 127.0.0.1:4601 -servername <id>-p5432.ai.localhost -CAfile <dir>/ca.pem -quiet. TCP ports carry no endpoint authentication (Nebius allows auth only with a single HTTP port).

UDP ports are rejected with InvalidArgument on spec.ports[i].protocol: Nebius documents no address format for them, so the mock could not answer the way the cloud does.

Configuration

Variable Default Meaning
NEBIUS_MOCKER_AI_LISTEN 127.0.0.1:4600 HTTPS stub for HTTP ports
NEBIUS_MOCKER_AI_PUBLIC_URL derived from the listener Base URL written into endpoint statuses (e.g. https://mocker.local:4600 behind Docker port mapping; its host is added to the certificate)
NEBIUS_MOCKER_AI_TCP_LISTEN 127.0.0.1:4601 TLS stub for TCP ports
NEBIUS_MOCKER_AI_TCP_DOMAIN ai.localhost DNS suffix of TCP port addresses
NEBIUS_MOCKER_AI_TLS_DIR <user config dir>/nebius-mocker/ca Local CA; clients trust <dir>/ca.pem
NEBIUS_MOCKER_AI_PLATFORMS built-in catalog JSON [{"name":"cpu-d3","cpu":"amd","presets":[{"name":"4vcpu-16gb","vcpus":4}]},{"name":"gpu-h100-sxm","gpu":"H100","presets":[{"name":"1gpu-16vcpu-200gb","gpus":1,"vcpus":16}]}]

Later

Terraform

Kind Terraform type Service RPCs called Tier
Resource nebius_ai_v1_endpoint nebius.ai.v1.EndpointService Get, GetByName, Create, Delete + OperationService.Get T1
Data source nebius_ai_v1_endpoint nebius.ai.v1.EndpointService Get, GetByName T1

API surface

nebius.ai.v1.DevlabService

Endpoint: apps.msp.api.nebius.cloud:443 · Proto: nebius/ai/v1/devlab_service.proto

RPC Request Response TF
Get GetDevlabRequest Devlab  
GetByName common.v1.GetByNameRequest Devlab  
List ListDevlabsRequest ListDevlabsResponse  
Create CreateDevlabRequest common.v1.Operation  
Delete DeleteDevlabRequest common.v1.Operation  
Restart RestartDevlabRequest common.v1.Operation  
Stop StopDevlabRequest common.v1.Operation  

nebius.ai.v1.EndpointService

Endpoint: apps.msp.api.nebius.cloud:443 · Proto: nebius/ai/v1/endpoint_service.proto · used by Terraform

RPC Request Response TF
Get GetEndpointRequest Endpoint ✅
GetByName GetEndpointByNameRequest Endpoint ✅
List ListEndpointsRequest ListEndpointsResponse  
Create CreateEndpointRequest common.v1.Operation ✅
Delete DeleteEndpointRequest common.v1.Operation ✅
Start StartEndpointRequest common.v1.Operation  
Restart RestartEndpointRequest common.v1.Operation  
Stop StopEndpointRequest common.v1.Operation  

nebius.ai.v1.HardwareService

Endpoint: apps.msp.api.nebius.cloud:443 · Proto: nebius/ai/v1/hardware_service.proto

RPC Request Response TF
List ListHardwareRequest ListHardwareResponse  

nebius.ai.v1.JobService

Endpoint: apps.msp.api.nebius.cloud:443 · Proto: nebius/ai/v1/job_service.proto

RPC Request Response TF
Get GetJobRequest Job  
GetByName GetJobByNameRequest Job  
List ListJobsRequest ListJobsResponse  
Create CreateJobRequest common.v1.Operation  
Delete DeleteJobRequest common.v1.Operation  
Cancel CancelJobRequest common.v1.Operation  
Restart RestartJobRequest common.v1.Operation