Skip to main content
POST
/
api
/
sandboxes
/
{id}
/
exec
/
run
Run Command
curl --request POST \
  --url https://app.opencomputer.dev/api/sandboxes/{id}/exec/run \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "cmd": "<string>",
  "args": [
    "<string>"
  ],
  "envs": {},
  "cwd": "<string>",
  "timeout": 123
}
'
{
  "exitCode": 0,
  "stdout": "Hello, World!\n",
  "stderr": ""
}
Execute a command synchronously and return the result.
id
string
required
Sandbox ID
cmd
string
required
Command to execute
args
string[]
Command arguments
envs
object
Environment variables
cwd
string
Working directory
timeout
integer
Timeout in seconds (default: 60)
{
  "exitCode": 0,
  "stdout": "Hello, World!\n",
  "stderr": ""
}