Get Background Task Output (Extension)
Read a byte page of task output without waking the sandbox.
/agent/v1/sessions/{session_id}/background_tasks/{task_id}/output● SupportedRequest parameters
session_idstring必填path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.
task_idstring必填path: Background task id (task_...), as listed by sessions.background_tasks.list.
offsetinteger可选query: Byte offset into the task output to read from; start at 0 and continue with the next_offset of the previous response. Integer of at least 0, default 0.
max_bytesinteger可选query: Maximum number of bytes to return: an integer from 1 to 262144, default 65536.
Returns
200
Own-face extension. offset defaults to 0; max_bytes defaults to 65536 and must be between 1 and 262144. Returns text, next_offset and eof. Offsets count UTF-8 bytes, not characters; partial trailing characters are retained for the next read. eof describes the current log, which may grow while running. A paused or missing sandbox returns empty text, the original offset, eof=true and unavailable=true, without waking it. Reading does not acknowledge model result delivery. Missing or inaccessible sessions or tasks return 404; invalid ranges return 400.
Errors follow the Anthropic error format (type / message / request_id) — see error codes
Response
HTTP 200
Background task output byte page
application/json
| Name | Type | Description |
|---|---|---|
| text | string | Text of the block. |
| next_offset | integer | Byte offset to pass as offset to continue reading the output. |
| eof | boolean | True when the output has ended and no more bytes will follow. |
| unavailable | boolean | True when the output could not be read; text is then empty. |