Skip to main content
Set "stream": true to receive the response as Server-Sent Events (SSE). Tokens arrive in chunks as they’re produced, which is ideal for chat UIs.

Raw SSE

If you’re not using an SDK, read the stream directly. Each line is prefixed with data: and the stream ends with data: [DONE].
After a stream finishes, refresh the balance to show the updated credit in your UI.