Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
exec
curl -X POST https://api.runtools.ai/v1/sandboxes/sandbox-abc123/exec \
  -H "X-API-Key: rt_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "npm run build",
    "timeout": 60000,
    "cwd": "/workspace"
  }'
{
  "data": {
    "stdout": "Build completed successfully\n",
    "stderr": "",
    "exitCode": 0,
    "executionTime": 2341
  }
}

Path Parameters

id
string
required
Sandbox ID

Request Body

command
string
required
Command to execute
timeout
number
default:"30000"
Timeout in milliseconds
cwd
string
default:"/workspace"
Working directory
env
object
Additional environment variables

Response

stdout
string
Standard output
stderr
string
Standard error
exitCode
number
Exit code (0 = success)
executionTime
number
Execution time in milliseconds
curl -X POST https://api.runtools.ai/v1/sandboxes/sandbox-abc123/exec \
  -H "X-API-Key: rt_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "npm run build",
    "timeout": 60000,
    "cwd": "/workspace"
  }'
{
  "data": {
    "stdout": "Build completed successfully\n",
    "stderr": "",
    "exitCode": 0,
    "executionTime": 2341
  }
}