Stream Events Track Progress, Not Separate Purchases
A streamed response arrives in pieces, but those pieces are not individual purchases. A connection might deliver dozens of text fragments, several status updates, and a final usage report. The bill usually depends on the provider’s reported token usage and the applicable rates, not the number of events your application receives.
This distinction matters when a response pauses, a connection drops, or a dashboard shows more tokens than the visible answer seems to contain. Following the stream event by event makes those situations easier to understand.
The opening event establishes work, not final cost
Before the first word appears, the provider receives your request. Its input can include instructions, conversation history, tool definitions, and supported media. All of that may contribute to usage, even though your interface displays only the latest question.
An opening event may identify the response, announce its status, or include preliminary usage information. Different providers expose different fields at different times. Treat early numbers as information about the request, not automatically as a complete invoice.
BestRelay publishes this guide as a quality-first API relay that forwards each request to the official model named in it, without substitution. Its coverage includes Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok, and more. That routing commitment helps establish whose usage rules apply; it does not make every provider’s stream identical.
Text fragments are transport units rather than tokens
As generation continues, events carry pieces of the answer. One event might contain a word, part of a word, punctuation, or a longer phrase. Network buffering and implementation choices affect these boundaries.
Counting events is not counting tokens. Neither is counting characters or words. Tokens are units defined by the model’s tokenizer, while stream events are delivery containers. Ten events could carry fewer tokens than a single larger event.
Some events carry no user-facing text at all. They may describe tool activity, structured output, or a change in response state. Their existence does not imply a separate event fee, although the underlying model work can contribute to billable usage under the provider’s rules.
Cache accounting separates reused input from fresh work
Prompt caching adds another layer. A provider may distinguish ordinary input, cached input that it reads, and input written into a cache. These categories can have different prices and eligibility rules.
BestRelay uses pay-as-you-go billing based on token counts reported by the provider, with cache reads and writes priced separately. For a newcomer, the important habit is to inspect the categories rather than multiply one headline token count by one rate.
Also check whether a field is a total or a breakdown within another field. Cached tokens may already be included in an input total. Adding every visible number together can double-count usage. Apply each rate to the appropriate category according to that provider’s accounting definitions.
The final usage report needs careful interpretation
Near completion, the stream may provide a usage summary. Depending on the provider and interface, usage can arrive in an ending event, a dedicated usage event, or another response record. Some updates are cumulative rather than additional amounts.
Do not add cumulative snapshots together. If an earlier update reports a running total and a later update reports the completed total, the later figure normally replaces the earlier one for that measure.
The visible answer also may not represent all output usage. Certain models report reasoning tokens or other categories separately. Use the provider’s billing definitions rather than assuming that every charged output token must appear as readable text.
Interrupted streams require reconciliation rather than guesswork
A disconnected client does not prove that generation stopped immediately. The provider may have processed input or generated output before receiving a cancellation. Missing the final usage event therefore does not establish zero cost.
Keep the request identifier, available usage fields, completion status, and billing record together. Reconcile them before treating an interrupted request as free or estimating its final charge. A retry is another request and can incur additional usage.
BestRelay works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. Create a BestRelay account to get started. Members also earn referral commission when people they invite top up; that reward is separate from the token accounting described here.
Want to try the models discussed here? Sign up