Skip to main content
GET
This endpoint provides a real-time SSE stream of task execution events. For live tasks it subscribes to the in-memory event buffer and pushes events as they arrive. For completed tasks it replays all persisted events in a single burst and closes the stream.
The event type values are the same regardless of agent runtime — Claude and Codex tasks emit an identical contract (session-init, text-delta, tool-call-start, tool-input-available, tool-output-available, result, …). 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

Path Parameters

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

Query Parameters

boolean
default:"true"
Whether to include text-delta events (individual text chunks). Set to false for a cleaner stream with only structural events.Default: true

Response Format

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

Event Types

event
Beginning of a new text block from the agent.Fields: id — message identifier
event
Incremental text chunk from the agent.Fields: id, delta — text chunk string
event
Agent started a tool call.Fields: toolCallId, toolName
event
Tool call input is ready.Fields: toolCallId, toolName, input — tool input object
event
Tool call result is available.Fields: toolCallId, toolName, output — tool output object
event
Files produced by the task.Fields: files — array of file objects
event
Task completed (stream closes after this).Fields: runId, status
event
Task failed (stream closes after this).Fields: errorText

Error Codes