Requests (API)

Streaming (SSE)

Add "stream": true — and the response streams as server-sent events (SSE), token by token.

Streaming formats

  • OpenAI surface: chat.completion.chunk chunks; the final chunk carries the usage counter.
  • Anthropic surface: native events message_startcontent_block_deltamessage_deltamessage_stop.

Billing during streaming

Billing and logging happen even if the client drops mid-stream — tokens already spent upstream are never lost.

Telegram