Documentation

Billing for Interrupted Connections

Updated: Nov 26, 2026

Synchronous HTTP chat requests can take a long time to complete, and may be affected by network interruptions or client disconnects. The table below describes how each case is handled and billed.

HTTP StatusScenarioWhat the Client ReceivesInput BillingOutput Billing
NormalThe model returns a complete response that includes usageComplete responseUsage returned by the modelUsage returned by the model
NormalThe model returns a complete response that does not include usageComplete responseEstimatedEstimated from the returned content; not billed if there is no output
Client interruptedThe client disconnects or times out before the request is sent to the modelConnection closed; 408 on timeoutNot billedNot billed
Client interruptedThe client disconnects or times out after the request is sent but before any response is receivedConnection closed; 408 on timeoutEstimatedNot billed
Client interruptedNon-streaming request; the client disconnects or times out while receiving the responseConnection closed; 408 on timeout; no partial content is returnedEstimatedNot billed
Client interruptedNon-streaming request; the client disconnects or times out after the model has returned the full response but before the platform finishes processing it (rare)Connection closed; 408 on timeoutUsage reported in the response; estimated if unavailableUsage reported in the response; estimated from the content if unavailable
Client interruptedStreaming request; the client disconnects or times out during outputPartial content already receivedUsage returned by the model if any, otherwise estimatedUsage returned by the model if any, otherwise estimated from the content already returned
Client interruptedThe client disconnects after receiving the complete responseComplete responseSame as normalSame as normal
Model response errorNon-streaming request; the model response is cut off midway while the client is still waiting500 error, no content returnedNot billedNot billed
Model response errorNon-streaming request; the platform cannot process the model response500 error, no content returnedNot billedNot billed
Model response errorNon-streaming request; the model returns a success status but the content is malformedThe model's content, unchangedNot billedNot billed
Model response errorStreaming request; the model output is cut off midway, or the last chunk is incompletePartial content already received, possibly including an incomplete last chunkUsage returned by the model if any, otherwise estimatedUsage returned by the model if any, otherwise estimated from the fully received content; the incomplete last chunk is not billed
Model response errorThe model explicitly returns an error, such as rate limiting, service error, or invalid parametersThe model's error messageNot billed, unless the model explicitly returns usage in the errorNot billed, unless the model explicitly returns usage in the error

Estimated token usage is calculated as follows:

Content TypeEstimation Method
Text (prompts, answers, tool arguments, code, etc.)Counted with the o200k_base tokenizer; empty content counts as 0
Image520 tokens per image
Audio256 tokens per clip
Video8192 tokens per clip
File / document (not plain text)4096 tokens per file