sandboxes

Start a streamed sandbox command

Changed on

Execute a command inside a sandbox and stream stdout/stderr as Server-Sent Events with base64 payloads. Requires a sandbox on the v2 runtime. Passing a command_id reuses a running command instead of starting a second one. The response ends with an ack_required event when the sandbox's output buffer needs an ack; continue from the reported offsets with the resume endpoint.

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

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v2/sandboxes/{sandbox_id}/execute/stream/start
  • 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.

command_idstring

CommandID makes the request idempotent: a known ID attaches to that running command instead of starting a second one.

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.

idle_timeout_secondsinteger

0 = default, -1 = never idle-kill

shellstring
stdinstring byte

Stdin is the process's entire standard input, base64 on the wire. It is written once when the command is spawned and then closed, so the process reads EOF; there is no stdin streaming on this endpoint.

timeout_secondsinteger

0 = no timeout

ttl_secondsinteger

0 = default, -1 = keep forever

Response

SSE event stream

Changes