Events

Render live output and replay durable session state.

At a glance

Endpoint
GET /v1/sessions/{id}/events/stream
Replay
Last-Event-ID
Deltas
Ephemeral
Keep alive
15 seconds

Connect

Set event_deltas to true for live text and reasoning deltas.

Terminal
curl -N -sS \
  "$PANTHEON_BASE_URL/v1/sessions/$SESSION_ID/events/stream?event_deltas=true" \
  -H "Authorization: Bearer $PANTHEON_API_KEY" \
  -H "Last-Event-ID: $LAST_EVENT_ID"

The server sends a keep-alive comment every 15 seconds.

Durable events

Durable events have an SSE id and JSON sequence. Save the SSE id as your replay cursor.

SSE
event: tool.started
id: evt_101
data: {"id":"evt_101","sequence":7,"type":"tool.started","workspace_id":"workspace_123","session_id":"session_123","run_id":"run_123","created_at":"2026-09-03T12:00:01Z","content":{"tool_call_id":"call_123","name":"echo_tool","input":{"message":"hello"}},"data":{"tool_call_id":"call_123","name":"echo_tool"}}

Text event content is a list of blocks. Structured event content is a JSON object.

Ephemeral events

Ephemeral events have no SSE id.

SSE
event: message.delta
data: {"type":"message.delta","run_id":"run_123","delta":{"text":"Hello"}}

Pantheon does not persist or replay these events.

Event catalog

ValueMeaning
run.startedA worker started the run.
run.completedThe run finished successfully.
run.failedThe run stopped with an error.
run.cancelledA client cancelled the run.
message.startedAssistant message generation started.
message.deltaA live assistant text fragment arrived.
message.completedPantheon stored the final assistant message.
reasoning.deltaA live reasoning fragment arrived.
reasoning.messagePantheon stored a durable reasoning message.
intermediate.deltaA live intermediate output fragment arrived.
tool.startedThe agent started a tool call.
agent.custom_tool_useYour application must execute an application tool.
tool.completedA tool call completed.
tool.failedA tool call failed.
session.status_idleThe session returned to idle.
session.errorA session error occurred.
sandbox.recreatedPantheon replaced a missing sandbox.
stream.resyncThe client must replay and reconnect.

The application tool lifecycle events share one tool_call_id.

Read Application tools for correlation and resume steps.

Handle stream.resync

1

Save the cursor

Keep the last durable SSE id.

2

Reconnect

Send that id in Last-Event-ID.

3

Read the replay

Pantheon replays persisted events before live output resumes.

Pitfalls

  • Deltas repeat after reconnect: Use only the SSE id from durable events as the cursor.
  • Live text is missing: Include event_deltas=true. Final durable message events still arrive.
  • Two tool pills appear: Merge every tool lifecycle event by tool_call_id.