Skip to main content
All chat completion endpoints support streaming via stream: true. Tokens are delivered as server-sent events (SSE) in real time.
Python

Streaming Billing Rules

  • If the upstream errors before any data is streamed, you are fully refunded.
  • If you disconnect after streaming begins, billing uses the actual usage generated when available. If exact usage is unavailable, it is estimated from the generated content.
  • If the upstream fails mid-stream, billing uses the actual usage generated when available. If exact usage is unavailable, it is estimated from the partial response received.