The rule
Billing only ever fires for a request that actually delivered output. A clean success is always billed
normally. If every candidate in the fallback chain fails and you receive an
upstream_error (see
Errors & rate limits) with zero
output tokens, that request costs you nothing — it never touches your credit balance or your key's spend cap.
Partial delivery
A mid-stream truncation is the one in-between case: if a streaming response starts, some tokens reach you, and then the connection drops (see Streaming on why we can't fail over once bytes have started), you're billed only for the output tokens actually delivered — never for tokens you never received.