Skip to main content
GET
This endpoint provides the raw SSE stream for a specific agent run. It replays all buffered events from the start of the run and then streams new events as they arrive. The stream closes automatically when the run finishes or the client disconnects.
Events are emitted with the same type contract for both agent runtimes (Claude and Codex). See the full event table.

Authentication

To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:
  1. Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
  2. Once provisioning completes, you will be redirected to your Dashboard
  3. From the Dashboard, create an API key to use with all Agent API requests
Your API key will be in the format: sk-xxxxxxxxxxxxxxxxxxxxxx

Headers

string
required
API Key of the form Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560

Query Parameters

string
required
The unique run identifier returned when the task was created.Example: runId=a1b2c3d4-e5f6-7890-abcd-ef1234567890

Response Format

Returns Content-Type: text/event-stream. Each event is a JSON object on a data: line:

Event Types

event
Sent immediately on connection. Confirms the stream is live.Fields: type, runId
event
Sent when the agent run begins executing.Fields: type, runId, startedAt
event
Beginning of a new text block.Fields: type, id
event
Incremental text chunk from the agent.Fields: type, id, delta
event
Agent started a tool call.Fields: type, toolCallId, toolName
event
Tool call input is ready.Fields: type, toolCallId, toolName, input
event
Tool call result is available.Fields: type, toolCallId, toolName, output
event
Files produced by the task.Fields: type, files
event
Run completed. Stream closes after this event.Fields: type, runId, status
event
Run failed. Stream closes after this event.Fields: type, errorText

Error Codes