sandboxes

Execute a sandbox command

Changed on

Execute a command inside a sandbox and return stdout, stderr, and exit code. Use the streaming execute endpoints for long-running commands that may exceed the synchronous request deadline.

post/api/v2/sandboxes/{sandbox_id}/execute

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v2/sandboxes/{sandbox_id}/execute
  • Auth
    • API key in header X-API-Key
    • or API key in header X-Tenant-Id
    • or HTTP bearer

Path parameters

sandbox_idstring required

Sandbox ID or name

Request body

commandstring[]

Command accepts either a shell command string or an argv string array.

cwdstring

Deprecated: use run_config.work_dir. Rejected when run_config is also set.

envobject

Deprecated: use run_config.env_vars. Rejected when run_config is also set.

shellstring
timeout_secondsinteger

Response

OK

exit_codeinteger
stderrstring
stdoutstring

Changes