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

# API reference

> Base URL, authentication, request and response conventions of the Five API.

The Five API is a REST API. You send JSON over HTTPS and get JSON back. Every endpoint page in this section has an interactive playground: add your API key and send real requests from the browser.

> [!WARNING]
>
> Requests from the playground are real: creating a task holds and charges credits from your balance.

## Base URL

```text theme={null}
https://api.fiveapi.ai
```

All endpoints live under `/v1`.

## Authentication

Send your API key in the `Authorization` header with the `Bearer` scheme, or in the `x-api-key` header:

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

Create keys in the [developer console](https://fiveapi.ai). See [Authentication](https://testweb2-docs-openapi.test765.com/authentication.md) for scopes, IP allowlists and rotation.

## Endpoints

| Endpoint | Description |
| - | - |
| `POST /v1/{brand}/{version}/{task}` | Create a task on a model, for example `POST /v1/wan/v3.0-spark/image-to-video`. Each model has its own page in the sidebar. |
| `GET /v1/tasks/{task_id}` | [Get a task](https://testweb2-docs-openapi.test765.com/api-reference/tasks/get-task.md) |
| `GET /v1/tasks` | [List tasks](https://testweb2-docs-openapi.test765.com/api-reference/tasks/list-tasks.md) |
| `POST /v1/tasks/{task_id}/cancel` | [Cancel a task](https://testweb2-docs-openapi.test765.com/api-reference/tasks/cancel-task.md) |
| `GET /v1/models` | [List models](https://testweb2-docs-openapi.test765.com/api-reference/models/list-models.md) |
| `GET /v1/models/{brand}/{version}/{task}` | [Get a model](https://testweb2-docs-openapi.test765.com/api-reference/models/get-model.md) |
| `GET /v1/account` | [Get the account](https://testweb2-docs-openapi.test765.com/api-reference/account/get-account.md) |
| `GET /v1/account/usage` | [Get daily usage](https://testweb2-docs-openapi.test765.com/api-reference/account/get-usage.md) |
| Webhook | [Task events](https://testweb2-docs-openapi.test765.com/api-reference/webhooks/task-events.md) sent to your endpoint |

## Requests

* Send `Content-Type: application/json` with every request that has a body.
* Field names are `snake_case`.
* Input files are public HTTPS URLs; there is no upload endpoint. See [Input files](https://testweb2-docs-openapi.test765.com/concepts/input-files.md).
* Create requests accept an optional [`Idempotency-Key`](https://testweb2-docs-openapi.test765.com/concepts/idempotency) header.

## Responses

* Successful requests answer `200 OK` with a JSON object. Lists have the shape `{"object": "list", "data": [...], "has_more": false}`.
* Ids are opaque strings with a prefix: `task_...`, `evt_...` (webhook events), `acct_...`, `req_...` (requests).
* Timestamps are ISO 8601 in UTC with milliseconds, for example `2026-10-23T06:21:02.127Z`.
* Members without a value are omitted, except `error` on a task, which is always present.
* Every response carries `X-Request-Id`. Error bodies repeat it as `error.request_id`; include it when you contact support.
* Authenticated responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. See [Rate limits](https://testweb2-docs-openapi.test765.com/concepts/rate-limits.md).
* Responses are not cacheable (`Cache-Control: no-store`).

## Errors

Errors use standard HTTP status codes and one JSON shape:

```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 }
  }
}
```

Branch on `error.code`. See [Errors](https://testweb2-docs-openapi.test765.com/concepts/errors.md) for every code and the retry strategy.

## Pagination

`GET /v1/tasks` uses cursor paging. Pass `limit` (1–100, default 20) and, for the next page, `starting_after` set to the `id` of the last item you received. Continue while `has_more` is `true`.

## Versioning

The API version is part of the path (`/v1`). Additive changes, such as new models, new optional fields, new response fields and new error codes, are made without a version change, so ignore fields you don't know. See the [changelog](https://testweb2-docs-openapi.test765.com/changelog.md).


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