> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trynito.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Failed-request billing

> What is and isn't billed when a request errors.

You are billed for work the provider performed, not for the status code.

| Situation | Billed? |
| - | - |
| Request rejected **before** inference, validation error (`400`), auth failure (`401`/`403`), unknown route (`404`) | ❌ No |
| **Rate limited** (`429`) or **service unavailable** (`503`) before the model ran | ❌ No |
| **Out of balance or allowance** (`429 insufficient_quota`), the request never runs | ❌ No |
| Model **started generating** then the stream failed partway | ⚠️ Partial, you are billed for tokens actually produced |
| Successful response (`200`) | ✅ Yes |

## Streams

Tokens generated before a stream fails are real work and are counted in `usage`. Read the `usage` block on the final chunk or the error payload rather than assuming a failed request cost nothing. If a stream ends before the provider reports usage, the gateway settles from what it can prove and never bills work that did not dispatch.

Reconcile against the developer console and [agent status](/api/api-reference/usage/get-usage), not status codes.

## Related

* [Get balance](/api/api-reference/usage/get-balance)
* [Get usage](/api/api-reference/usage/get-usage)
* [Error format](/api/api-reference/overview/error-format)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.