Docs

Streaming

Set "stream": true on any agent's endpoint to get genuine token-level server-sent events, sourced from that agent's own live output — not a fake buffered response chopped into pieces. The event format is identical across Codex, Claude Code, Gemini CLI, and Grok.

curl -N -X POST \
  https://api.yourdomain.dev/t/acme/codex/chat/completions \
  -H "Authorization: Bearer $TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stream": true,
    "messages": [{"role": "user", "content": "Summarize this repo"}]
  }'

Event format

Each chunk is a standard SSE data line carrying a partial delta, terminated by a final [DONE]:

data: {"choices":[{"delta":{"content":"Sum"}}]}

data: {"choices":[{"delta":{"content":"mar"}}]}

data: {"choices":[{"delta":{},"finish_reason":"stop"}]}

data: [DONE]

Note: streaming with active tools isn't supported on any agent yet — tool-calling responses are always returned as a single JSON envelope. See Tool & MCP calling.