Logs & Streaming
Get Task Logs
Retrieve the full execution log for a task as parsed stream events. For live tasks, events come from the in-memory buffer. For completed tasks, events are reconstructed from persisted message parts.
GET
This endpoint returns the complete execution log for a task as an array of parsed events. It automatically selects the best available source — live in-memory buffer for running tasks, or reconstructed events from the database for completed tasks.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
- Once provisioning completes, you will be redirected to your Dashboard
- From the Dashboard, create an API key to use with all Agent API requests
sk-xxxxxxxxxxxxxxxxxxxxxx
Headers
API Key of the form
Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560Path Parameters
The unique run identifier returned when the task was created.Example:
a1b2c3d4-e5f6-7890-abcd-ef1234567890Query Parameters
Whether to include
text-delta events (individual text chunks). Set to false for a smaller, summarized payload.Default: trueExample: includeDeltas=falseInclude raw SSE lines in the
rawEvents field of the response.Default: falseExample: raw=trueResponse Fields
The run identifier.
The chat thread UUID for this run.
Current external status:
queued, running, completed, failed, cancelled, or interrupted.Where the events came from:
"buffer" (live in-memory), "reconstructed" (from DB), or "merged".Total number of events returned.
Array of parsed event objects.
Error message if the run failed,
null otherwise.Raw SSE lines (only present when
raw=true).Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Logs retrieved successfully |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Task belongs to a different user |
| 404 | Not Found | Task not found |
| 500 | Internal Server Error | Failed to fetch logs |