Skip to main content
POST
/
sandboxes
/
{sandbox_id}
/
exec
Execute a command inside a sandbox
curl --request POST \
  --url https://api-staging.superserve.ai/sandboxes/{sandbox_id}/exec \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "command": "<string>",
  "args": [
    "<string>"
  ],
  "env": {},
  "working_dir": "<string>",
  "timeout_s": 30
}
'
{
  "stdout": "<string>",
  "stderr": "<string>",
  "exit_code": 123
}

Documentation Index

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

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

Authorizations

X-API-Key
string
header
required

Path Parameters

sandbox_id
string<uuid>
required

The unique identifier of the sandbox.

Body

application/json
command
string
required

Command to execute. Wrapped in /bin/sh -c unless args is provided.

Minimum string length: 1
args
string[]

If provided, command is used as the binary and args as arguments (no shell wrapping).

env
object

Environment variables for the command.

working_dir
string

Working directory (default /home/user).

timeout_s
integer
default:30

Timeout in seconds.

Response

Command executed

stdout
string
stderr
string
exit_code
integer