> ## 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

# Rate limits

> Request rate, concurrent tasks and the daily credit cap: the three limits of your plan and how to stay within them.

Three independent limits protect the platform and your budget. All of them apply to the whole **account**: every API key of the account shares them, and more keys never raise them.

| Limit | `standard` plan | When exceeded |
| - | - | - |
| Requests | 10 per second sustained (short bursts above it are allowed), 300 per minute | `429 rate_limit_exceeded` |
| Concurrent tasks (queued + processing) | 20 | `429 concurrency_limit_exceeded` |
| Credits held per UTC day | no cap | `429 daily_cap_exceeded` |

Your current limits are in the `plan` object of `GET /v1/account`:

```json theme={null}
{
  "plan": {
    "name": "standard",
    "rps": 10,
    "rpm": 300,
    "max_concurrent_tasks": 20,
    "daily_credit_cap": null
  }
}
```

Need higher limits? Email [support@fiveapi.ai](mailto:support@fiveapi.ai) with your account id and your expected volume.

## Rate limit headers

Authenticated responses carry the state of the current minute window:

```http theme={null}
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1792736640
```

| Header | Description |
| - | - |
| `X-RateLimit-Limit` | Requests allowed per minute for your account, or for the key when it has a lower ceiling |
| `X-RateLimit-Remaining` | Requests left in the current minute |
| `X-RateLimit-Reset` | Unix time in seconds when the window resets |

Every `429`, and every `503 service_unavailable`, also carries `Retry-After`: the number of seconds to wait before you retry.

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 3
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1792736640

{"error":{"type":"rate_limit_error","code":"rate_limit_exceeded","message":"rate limit exceeded for this account (10 rps, 300 rpm)","request_id":"req_01M5KN37C3D4E5F6G7H8J9K0L1"}}
```

## Concurrent tasks

The concurrency cap counts the tasks of your account that are `queued` or `processing` right now. A task stops counting as soon as it reaches `completed`, `failed` or `cancelled`. When you hit the cap:

* wait for running tasks to finish (`Retry-After` suggests a delay), or
* cancel tasks you no longer need. Cancelling frees the slot and releases the credits at once.

## Stay within the limits

* **Prefer webhooks to polling.** Polling every task every second uses up the request budget quickly; a poll every few seconds with backoff is plenty.
* **Queue on your side.** Keep your own queue of pending jobs and submit only while queued + processing tasks are below `plan.max_concurrent_tasks`.
* **Honor `Retry-After`** on every `429` and `503`, and retry with the same `Idempotency-Key`.
* **Watch `X-RateLimit-Remaining`** and slow down before it reaches zero.


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