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

> ## Agent Instructions
> Five API is a video generation REST API. Base URL: https://api.fiveapi.ai. Authenticate with the header Authorization: Bearer <API key>; read the key from the FIVEAPI_API_KEY environment variable and never hard-code it.
> Every generation is an asynchronous task: POST /v1/{brand}/{version}/{task} returns a queued task, then poll GET /v1/tasks/{task_id} or receive a signed webhook, and download output.video.url before expires_at (7 days).
> The OpenAPI spec is at https://docs.fiveapi.ai/api-reference/openapi.yaml. An installable agent skill: npx skills add https://docs.fiveapi.ai

# Credits and pricing

> How prepaid credits work: what a video costs, when credits are held, charged and released, and how to track usage.

Five API is prepaid. You buy credits in the console and every video task is paid in credits. There is no subscription and no minimum spend.

## Buy credits

Open **Billing** in the [developer console](https://fiveapi.ai), pick a credit pack and pay with one of the methods shown there. Credits are added to your balance as soon as the payment is confirmed. Larger packs cost less per credit.

## What a video costs

The price of a task depends on three things:

* the **model**,
* the **resolution**,
* the **duration** (for video extend, the number of seconds added).

The credit packs and the price of every model, per resolution and duration, are listed in the [developer console](https://fiveapi.ai). The price of a specific request is returned as `credits.estimated` as soon as the task is created.

> [!NOTE]
>
> Not every model sells every combination of resolution and duration. A combination the model does not offer answers `400 invalid_parameter` and costs nothing.

## How credits move

| Moment | What happens to your balance | Where you see it |
| - | - | - |
| Task created (`200`) | The estimated price is **held**: it moves from `balance.credits` to `balance.held` | `credits.estimated` on the task |
| Task `completed` | The hold is **charged** | `credits.charged` on the task |
| Task `failed` or `cancelled` | The hold is **released** back to `balance.credits` in full | no `credits.charged` |
| Request rejected (any `4xx`, or `503`) | Nothing is held or charged | the error response |

In v1 the charge of a completed task always equals its estimate.

> [!TIP]
>
> `balance.credits` is what you can spend right now. Credits held by queued and processing tasks are not spendable until those tasks finish, so a request can answer `402 insufficient_credits` while the console shows a larger total. Wait for in-flight tasks, cancel the ones you no longer need, or top up.

## Check your balance

```bash theme={null}
curl https://api.fiveapi.ai/v1/account \
  -H "Authorization: Bearer $FIVEAPI_API_KEY"
```

```json theme={null}
{
  "id": "acct_01J9X7Z0K7Q8W3F2P1N6M5V4R3",
  "object": "account",
  "name": "Acme Studios",
  "balance": { "credits": 9940, "held": 60 },
  "plan": { "name": "standard", "rps": 10, "rpm": 300, "max_concurrent_tasks": 20, "daily_credit_cap": null },
  "features": { "file_uploads": false }
}
```

When the balance cannot cover a new task, the create call answers `402`:

```json theme={null}
{
  "error": {
    "type": "billing_error",
    "code": "insufficient_credits",
    "message": "this task needs 60 credits, 25 are available",
    "request_id": "req_01M5KPQ11B3NS7R5ZFFVZBD4W3",
    "details": { "required": 60, "available": 25 }
  }
}
```

## Low-balance reminder

On the **Billing** page you can set a threshold. When your spendable balance falls below it, the account's owners and admins get an email. You get one email each time the balance falls below the threshold: once the balance is back at or above it, the next drop below it sends a new email.

## Track usage

* `GET /v1/account/usage` returns one row per UTC day and model with the number of tasks and the credits charged. See [Get daily usage](https://testweb2-docs-openapi.test765.com/api-reference/account/get-usage.md).
* The console shows the same usage, every credit movement of the account (purchases, holds, charges and releases), and exports usage as CSV.

## Daily credit cap

Some plans carry a daily credit cap: the most credits that may be held in one UTC day. A task that would exceed it answers `429 daily_cap_exceeded`. `GET /v1/account` shows the cap of your plan as `plan.daily_credit_cap` (`null` means no cap).

## FAQ

> **Am I charged for a failed task?**
>
> No. The hold of a failed task is released in full, whatever the reason.

> **Am I charged when I cancel a task?**
>
> No. Cancelling a `queued` or `processing` task releases its hold at once, and a result that finishes after the cancel is discarded and never charged.

> **Am I charged when a request is rejected?**
>
> No. Validation errors, URL policy errors, `402`, `429` and `503` happen before anything is held.

> **Who do I contact about a payment or an invoice?**
>
> Email [support@fiveapi.ai](mailto:support@fiveapi.ai) with your account id (`acct_...`).


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