Streaming

Set stream to true on a chat request and the answer comes back as server-sent events, in the same shape OpenAI uses.

What you are charged

A keyed request is charged from the token count the provider reports at the end of the stream, so the console matches your logs to the token. To get that count yourself, set stream_options to { "include_usage": true }, as with OpenAI: the last chunk before [DONE] then carries usage, with cost, what the request was charged.

A paid x402 request streams the same events. Its USDC amount is fixed before the first byte, from the prompt and the output cap, and does not change if the answer is shorter.

Decisions are not streamed: a decisions call answers in one JSON body.