Read or stream a sandbox command's output
Read the output of a command in a Runpod sandbox through the REST API as a paged snapshot, or stream it live as Server-Sent Events.
Authorizations
Runpod API key authentication. Generate an API key in the Runpod console and send it in the Authorization header as Bearer <api_key>. Keys are scoped to the permissions granted when created; requests may return 403 when a valid key lacks access to the requested resource or action.
Console sessions (Clerk JWTs) act for the signed-in user. To act for a team instead, also send X-Team-Id: <team_id>; it applies only when the user owns or belongs to that team, otherwise the request runs against the user's own account. API keys created inside a team already act for that team and do not need the header.
Path Parameters
Sandbox identifier
Command identifier
^[0-9A-Za-z-]{1,64}$Query Parameters
Stream the output as Server-Sent Events instead of returning a snapshot.
Byte offset to read from. Takes precedence over tail as the
start point, but tail still bounds how much is read, so
offset=N&tail=M reads about M bytes from N.
x >= 0Read about the last this many bytes. Snapshot only. The size is
approximate: the host reads at least about 64 KiB whatever the
value, and about 64 KiB more for a command whose output is
separated into stdout and stderr. With offset, it bounds how
much is read from offset.
1 <= x <= 2097152Only this stream's lines. 409 when the command's output is
not separated.
stdout, stderr Response
Output snapshot, or the event stream with stream=true.
Byte offset of the first byte of output.
Offset to pass as offset to continue after this read.
Output read. At most 256 KiB per call when tail is not set;
with tail (up to 2 MiB) a snapshot can be larger.
True when output reaches the end of what has been captured so
far. The command has finished only when eof is true and its
status is terminal.