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

# Billing

> Prepaid credits, what each generation costs, and when you are charged.

one-api.ai uses prepaid credits. One credit is \$0.001.

## When you are charged

1. When you create a task, its full price is reserved from your balance.
2. When the task completes, that reserved amount becomes the charge.
3. When the task fails, for any reason, the whole amount goes back to your balance.

The price is fixed before the task runs, because every option that affects it (resolution, length, draft mode) is part of the request. You are never charged more than the amount reserved.

If your balance does not cover the price, the create call returns HTTP 402 and no task is started:

```json theme={null}
{ "error": { "code": "insufficient_credits", "message": "Insufficient credits" } }
```

## Prices

A customer key pays the provider's list price times 104/95.

| Generation | List price | Credits charged |
| - | - | - |
| `z-image-turbo`, one image | \$0.005 | 5.473684 |
| `p-video` 720p, per second | \$0.02 | 21.894737 |
| `p-video` 1080p, per second | \$0.04 | 43.789474 |
| `p-video` 720p draft, per second | \$0.005 | 5.473684 |
| `p-video` 1080p draft, per second | \$0.01 | 10.947368 |

Every task reports what it cost in `cost` (dollars) and `credits_cost` (credits).

## Buying credits

Credit packs and the current rates for the other one-api.ai services are on the [pricing page](https://one-api.ai/pricing).


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