Skip to main content
POST
/
sandbox
/
{sandbox_id}
/
exec
Python
from acontext import AcontextClient

client = AcontextClient(api_key='sk_project_token')

# Execute a command in the sandbox
result = client.sandboxes.exec_command(
    sandbox_id='sandbox-uuid',
    command='ls -la'
)
print(f"stdout: {result.stdout}")
print(f"stderr: {result.stderr}")
print(f"exit_code: {result.exit_code}")
{
  "code": 123,
  "error": "<string>",
  "msg": "<string>",
  "data": {
    "exit_code": 123,
    "stderr": "<string>",
    "stdout": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Project Bearer token (e.g., "Bearer sk-ac-xxxx")

Path Parameters

sandbox_id
string
required

Sandbox ID

Body

application/json

Command to execute

command
string
required

Response

200 - application/json

OK

code
integer
error
string
msg
string
data
object