Endpoint
Authentication
Your team’s API key. Pass the full
wrn_... key value.Path parameters
The capsule ID.
Request body
The command to execute, e.g.
"python" or "/bin/bash".Arguments to pass to the command, e.g.
["-u", "train.py"].Maximum number of seconds to wait for the process to exit (foreground only). Set to
0 for no timeout.Additional environment variables to inject into the process, e.g.
{"DEBUG": "1"}. Background exec only.Working directory for the process, e.g.
"/workspace". Background exec only.When
true, the process is started in the background and the server responds immediately with HTTP 202. Use the returned pid or tag to stream or kill the process later.Responses
200 — Foreground execution complete
Returned whenbackground is false (or omitted). The process has exited and the full output is included.
Captured standard output. Base64-encoded when the output contains binary data (check the
encoding field).Captured standard error.
Exit code returned by the process.
0 conventionally indicates success.Wall-clock time the process ran, in milliseconds.
Output encoding. Either
"utf-8" or "base64". Check this field before decoding stdout/stderr.202 — Background process started
Returned whenbackground is true. The process is running inside the capsule; use the pid or tag with the processes endpoints to manage it.
Operating system PID of the process inside the capsule.
Stable identifier for this background process. Auto-generated if you did not supply one in the request. Use this tag to stream or kill the process.
Examples
Foreground execution
Run a command and wait for the result:Background execution
Start a long-running process without blocking:Python SDK
Errors
| Status | Meaning |
|---|---|
404 | Capsule not found or does not belong to your team. |
409 | Capsule is not in the running state. Start or resume the capsule first. |