A Zero Charge Needs More Than an Error
A failed API request can cost nothing, but an error message alone does not establish that result. The decisive question is whether the request produced billable usage under the applicable charging rules. A rejection before inference and a broken connection after generation may look equally unsuccessful to an application while leaving very different accounting records.
This walkthrough follows one illustrative request rejected before model execution. It then checks the evidence needed to support a zero charge. The setting is BestRelay, a quality-first API relay that forwards requests to the official model named in each request, without substitution. The accounting lesson applies beyond any single relay: application outcomes and billable work are separate facts.
First, identify the attempt before interpreting its failure
Begin with one attempt, not the entire user interaction. Record its time, requested model, request identifier if available, and returned error. Keep authentication secrets and sensitive prompt content out of diagnostic records. These details establish the unit you will reconcile against usage and billing records.
For this example, suppose a malformed request is rejected before it reaches model execution. No response is generated. That establishes a plausible zero-cost case, but the error still needs to be matched to the relevant accounting entry or reporting window. An interface displaying nothing is not, by itself, evidence of nothing being charged.
Next, establish whether any provider work occurred
Separate rejection from interruption. A request stopped before inference is different from one that reaches a provider, generates tokens, and then loses its connection to the client. In the second case, work may already have occurred even though the application never receives a usable answer.
BestRelay uses pay-as-you-go billing based on token counts reported by the provider. For the rejected attempt in this example, the zero-charge finding therefore depends on confirming that no billable provider usage arose and that no charge was assessed. Do not extend that finding to every timeout, cancellation, or server error.
Then, reconcile each reported token category separately
When usage exists, inspect its categories before calculating a cost. Ordinary input, generated output, cache reads, and cache writes can have different prices. BestRelay prices cache reads and writes separately, so a single undifferentiated token total is insufficient for checking every charge.
Apply the applicable rate to each reported category, respecting the provider's definitions. Do not automatically add cache tokens to an input total that might already include them. For the zero-cost example, confirm the absence of billable usage across the relevant categories rather than assuming that zero output means zero cost.
Check retries before declaring the interaction free
A failed attempt and a failed interaction are not necessarily the same accounting unit. A client may retry automatically, or an application may submit another request after receiving an error. The original rejection can cost nothing while a later attempt incurs usage.
BestRelay works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. In any such workflow, inspect retry behavior and reconcile attempts individually. Grouping them under one user action is useful for product analytics, but it should not erase the distinction between an unbilled rejection and a billable retry.
Keep account credits separate from request charges
Now compare the reconciled usage with the account ledger once the relevant records are available. A balance change can reflect more than inference. BestRelay members earn referral commissions when people they invite top up; those earnings are separate from the token cost of a request.
A commission does not make consumed tokens free, and a top-up does not mean a request incurred a charge. Create a BestRelay account to follow this walkthrough with your own requests.
Close the investigation with a bounded finding
The defensible result is narrow: this attempt was rejected before model execution, produced no billable provider usage, and received no charge. Preserve the evidence supporting each part. That is stronger than declaring failed requests universally free, and more useful when the next failure happens after real work has already begun.
Want to try the models discussed here? Sign up