> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiveapi.ai/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

# Troubleshooting

> Fixes for the most common problems: rejected URLs, credits, limits, webhooks and stuck tasks.

> [accordion] 400 url\_not\_allowed for a URL that opens in my browser
>
> **Causes:**
>
> * The URL uses `http` instead of `https`.
> * The host resolves to a private or reserved address (internal DNS, a VPN or a corporate proxy that rewrites DNS).
> * The server doesn't answer `HEAD`, or answers without `Content-Length`.
> * There are more than 3 redirects.
> * The file is larger than the model's limit.
>
> **Fix:** serve the file from public object storage or a CDN (a presigned URL is fine), make sure `HEAD` answers `2xx` with a `Content-Length`, and keep the file within the [limits of the model](https://docs.fiveapi.ai/concepts/input-files.md#limits-per-model).

> [accordion] 400 invalid\_parameter on duration or resolution
>
> Not every model sells every combination of resolution and duration. Check the ranges of the model on its API reference page or with `GET /v1/models/{brand}/{version}/{task}`, and pick a combination the model offers.

> [accordion] 402 insufficient\_credits although my balance looks high enough
>
> `balance.credits` doesn't include credits held by queued and processing tasks; those are in `balance.held` until the tasks finish. Wait for in-flight tasks, cancel the ones you no longer need, or top up on the **Billing** page.

> [accordion] 429 concurrency\_limit\_exceeded with only a few tasks running
>
> The cap counts the queued and processing tasks of the **whole account**, across all keys. List them with `GET /v1/tasks?status=queued` and `GET /v1/tasks?status=processing`, and cancel the ones that are stale.

> [accordion] 401 invalid\_api\_key
>
> Check that the header is exactly `Authorization: Bearer sk_live_...` (or `x-api-key: sk_live_...`), that no whitespace or quotes surround the key, and that the key wasn't revoked or expired in the console.

> [accordion] 403 account\_not\_active
>
> New production accounts are reviewed before they can use the API. Email [support@fiveapi.ai](mailto:support@fiveapi.ai) with your account id if the review takes longer than expected.

> [accordion] The webhook never arrives
>
> **Causes:** the endpoint isn't `https` or isn't publicly reachable; it answers after more than 10 seconds; it redirects (a `3xx` stops the delivery); it answered non-`2xx` 9 times and the delivery stopped.
>
> **Fix:** answer `2xx` first and work afterwards, check the delivery log on the **Webhooks** page of the console and resend from there, and reconcile with `GET /v1/tasks/{task_id}`.

> [accordion] Webhook signature verification fails
>
> **Causes:**
>
> * You verify a re-serialized body instead of the raw bytes.
> * You use the whole secret, including `whsec_`, as the key instead of the base64-decoded part after the prefix.
> * You compare with only one `v1,` value while the header carries two during a rotation.
> * Your server clock is more than 5 minutes off.
>
> **Fix:** run the [test vector](https://docs.fiveapi.ai/concepts/webhooks.md#test-your-verifier) through your verifier.

> [accordion] The task stays queued for a long time
>
> The model's queue is busy and the task waits for a generation slot. Tasks with input files also download and prepare them while queued. Keep waiting for the webhook, or cancel the task if you no longer need it: its credits are released at once.

> [accordion] The task failed with input\_fetch\_failed
>
> The input file couldn't be downloaded or processed after the task was accepted, often because a presigned URL expired. Make sure the URL stays valid for at least an hour and submit a new task.

> [accordion] output is missing from a completed task
>
> The output is removed at `expires_at`, 7 days after completion. Download results as soon as `task.completed` arrives.

> [accordion] 409 idempotency\_in\_progress
>
> The first request with this `Idempotency-Key` is still running. Wait a moment and send the identical request again; it returns the stored answer.

## Still stuck?

Email [support@fiveapi.ai](mailto:support@fiveapi.ai) with:

* the `X-Request-Id` (or `error.request_id`) of the failing request, or the task `id`,
* the time it happened, with time zone,
* the model and, if relevant, the request body without your API key.


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