Spawn an additional subprocess inside a running instance
Starts a new process inside the VM that already hosts the named
operation. Distinct from POST /instances, which spins up a
VM: this endpoint requires a running operation (EXECUTING or
ASSIGNED) and reuses the existing VM.
The body is an ExecSpec — process-execution fields only.
VM-level concerns (image, hostname, resources_limits,
files, timeout, disposable, preserve_env) are not
accepted here; they were set when the parent operation was
created.
The required permission follows the parent instance:
SPAWN_DISPOSABLE when it was spawned with disposable=true,
SPAWN otherwise.
On success the worker assigns a fresh spid (≥2; spid=1 is
the main process spawned from metadata) and the response
carries it in the body plus a Location header pointing at
GET /operations/{operationId}/subprocesses/{spid} — the
subprocess result reconstructed from its events.
Authorizations
IAM bearer token issued by the Nebius IAM service. Sent as
Authorization: Bearer <iam-token>. Must be combined with the
Project header (see IAMProjectHeader).
This is the recommended authentication scheme for new clients.
Nebius project ID associated with the IAM token. Required together
with IAMBearerAuth. Identifies the project context the request is
scoped to.
Path Parameters
The ID of the operation A UUID string
"12345678-9abc-baba-deda-0123456789ab"
Body
Process-execution surface shared between InstanceSpawnRequest
(the main process) and
POST /operations/{operationId}/subprocesses (additional
subprocesses). VM-level concerns (image, hostname,
resources_limits, files, timeout, disposable, preserve_env)
live on InstanceSpawnRequest only.
The command to execute. Same semantics as in InstanceSpawnRequest.command — when shell=true it is a shell expression, otherwise a path to an executable.
"/bin/app"
Arguments to pass to the command if shell is set to false.
Run command through a shell expression (args must be empty).
Environment variables to set in the child process.
Working directory; empty string means image / server default.
^((/[^/]*)+/?)?$User ID to run the process as.
x >= 0Group ID to run the process as.
x >= 0Bytes fed to the child's stdin — honored for both the main
process and exec'd subprocesses. With close=false the
pipe stays open and more data can be written via
POST /operations/{operationId}/subprocesses/{spid}/stdin.
Maximum number of bytes of stdout / stderr to keep. Defaults to 1 MiB; capped at 10 MiB.
65535
Response
Created — subprocess started. Location references the
new subprocess result.
Spawn id assigned by the worker.
x >= 2