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: $RUNTOOLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "npm test",
    "timeout": 120000,
    "cwd": "/workspace"
  }'
{
  "data": {
    "stdout": "Tests passed\n",
    "stderr": "",
    "exitCode": 0,
    "executionTime": 2341
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.runtools.ai/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

id
string
required
Sandbox ID.

Request Body

command
string
required
Command to execute.
timeout
number
Timeout in milliseconds.
cwd
string
Working directory.
env
object
Additional environment variables for this command.

Response

stdout
string
Standard output.
stderr
string
Standard error.
exitCode
number
Process exit code.
executionTime
number
Execution time in milliseconds when available.
curl -X POST https://api.runtools.ai/v1/sandboxes/sandbox-abc123/exec \
  -H "X-API-Key: $RUNTOOLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "npm test",
    "timeout": 120000,
    "cwd": "/workspace"
  }'
{
  "data": {
    "stdout": "Tests passed\n",
    "stderr": "",
    "exitCode": 0,
    "executionTime": 2341
  }
}