Skip to main content
Managed-agents session output can be consumed over Server-Sent Events (SSE).

Supported streaming endpoints

  • GET /api/managed-agents/anthropic/v1/sessions/{session_id}/stream
  • GET /api/managed-agents/anthropic/v1/sessions/{session_id}/events/stream

Required headers

  • Authorization: Bearer <SYNTH_API_KEY>
  • anthropic-version: <version>
  • accept: text/event-stream
  • anthropic-beta: managed-agents-2026-04-01 when required by the operation

Minimal stream example

curl -N -sS "https://api.usesynth.ai/api/managed-agents/anthropic/v1/sessions/$SESSION_ID/events/stream" \
  -H "Authorization: Bearer $SYNTH_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "accept: text/event-stream"

Send event then stream

curl -sS "https://api.usesynth.ai/api/managed-agents/anthropic/v1/sessions/$SESSION_ID/events" \
  -H "Authorization: Bearer $SYNTH_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "content-type: application/json" \
  -d '{"events":[{"type":"user.message","content":[{"type":"text","text":"hello"}]}]}'
Then open one of the stream endpoints above.

Operational guidance

  • Keep connections short-lived for smoke tests.
  • For long-lived sessions, reconnect on network interruption and continue from events history (GET /events) where needed.
  • If no events arrive, verify:
    • session id exists
    • message event was posted
    • headers include correct version/beta

Event-type quick glossary

Common events you should expect:
  • user.message: user event posted into session
  • agent.message: model-authored message content
  • agent.tool_use: tool execution request emitted by agent
  • session.status_idle: no more immediate work; stream can be closed

Reconnect pattern

Recommended reconnect strategy:
  1. On disconnect, call GET /sessions/{session_id}/events and record latest event state.
  2. Re-open .../events/stream with the same auth/version/beta headers.
  3. De-duplicate by event identity/timestamp in your client before processing.
  4. Treat session.status_idle as terminal for short-lived request/response flows.