Endpoint
Upgrade: websocket headers.
Authentication
Your team’s API key. Pass the full
wrn_... key value.Path parameters
The capsule ID.
WebSocket protocol
Once the connection upgrades (HTTP 101), you control the session with JSON messages.Client messages
Start a process — send this as the first message after connecting:| Field | Type | Description |
|---|---|---|
type | string | Must be "start". |
cmd | string | Command to execute. |
args | string[] | Arguments to pass to the command. |
Server messages
The server emits JSON messages as the process produces output:type | Fields | When sent |
|---|---|---|
start | pid: integer | Process started; contains the OS PID. |
stdout | data: string | A chunk of stdout arrived. |
stderr | data: string | A chunk of stderr arrived. |
exit | exit_code: integer | Process exited; connection closes automatically after this. |
error | data: string | An error occurred (e.g. command not found). |
The connection closes automatically once the server sends an
exit message. You do not need to close it manually.Python SDK
The SDK wraps the WebSocket protocol and yields events as an iterator: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. |