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

# Errors and billing

> What each error means, when you are charged and how to check a request's cost

## When you are charged

* You pay only for images that are delivered.
* Refused or failed jobs are not charged.
* The price is fixed by model and size tier. See [Models and pricing](/models-and-pricing).
* Your balance is prepaid. When it runs out, requests fail with `403` until your manager tops it up.

## Check what a request cost

Every response, success or error, carries a request ID header:

```http theme={null}
X-Oneapi-Request-Id: 2026102015161442847504045555018
```

Look up the charge for that ID. This endpoint needs no key:

```bash theme={null}
curl https://orvado.dev/api/cost/request/2026102015161442847504045555018
```

```json theme={null}
{
  "request_id": "2026102015161442847504045555018",
  "cost_usd": 0.05,
  "created_at": 1792509374000
}
```

The response has a few more fields. Use `cost_usd`. An unknown ID, or a request that was not charged, returns:

```json theme={null}
{ "message": "failed to get cost by request id: record not found", "success": false }
```

> [!TIP]
>
> Log the `X-Oneapi-Request-Id` of every request next to your own order or job ID. It is the fastest way to reconcile invoices and to ask support about a charge.

Read the header with the OpenAI Python SDK:

```python theme={null}
raw = client.images.with_raw_response.generate(
    model="nano-banana-pro",
    prompt="amethyst perfume bottle on plum velvet",
    size="1024x1024",
)
request_id = raw.headers.get("x-oneapi-request-id")
result = raw.parse()
```

## Error format

Errors use the OpenAI shape. The message ends with the request ID:

```json theme={null}
{
  "error": {
    "message": "No token provided (request id: 2026102015161442847504045555018)",
    "type": "one_api_error"
  }
}
```

## Error codes

| Status | Meaning | Charged | What to do |
| - | - | - | - |
| `400` | Unsupported size, model or field | No | Fix the request. Check [sizes](/images#sizes-and-price-tiers) and [model IDs](/models-and-pricing) |
| `401` | Missing or invalid key | No | Check the `Authorization` header or create a new key |
| `403` `insufficient_user_quota` | Not enough balance on the account or the key | No | Ask your manager to top up, or raise the key limit in **Tokens** |
| `502` `async_image_failed` | The model refused or failed the job | No | Change the prompt and retry |
| `503` | No capacity for this model right now | No | Retry after a minute |

## Retry rules

* Retry `502` and `503` with a backoff, for example 30 s, then 60 s, then 120 s.
* Do not retry `400`, `401` or `403` without fixing the cause.
* Do not retry after a client timeout. See [Response time and timeouts](/images#response-time-and-timeouts).


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