Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
exec
Execute a command in the sandbox
import requests

url = "https://api.13-215-85-171.sslip.io/v1/sandboxes/{id}/exec"

payload = { "command": "<string>" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "exit_code": 123,
  "stdout": "<string>",
  "stderr": "<string>",
  "pid": 123
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Path Parameters

id
string
required

Sandbox ID (e.g. sb_a1b2c3d4)

Body

application/json
command
string
required
args
string[]
timeout_secs
integer
default:30
Required range: x >= 1
cwd
string

Optional command working directory. Use an absolute sandbox path such as /workspace/project, /tmp/project, /data/project, or /context/demo where present. Values are normalized before execution, must resolve to an existing directory in the running sandbox, and may not target reserved runtime paths under /workspace/.nullspace. This affects command execution only and does not limit general filesystem paths.

envs
object
shell
boolean
default:false
background
boolean
default:false

Response

Command completed

exit_code
integer
required
stdout
string
required
stderr
string
required
pid
integer<uint32> | null

Process ID when the command response includes process metadata.