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

# Video generation

> Submit video tasks through Floodgate, poll their status and download results. Find reviewed brand operations, input limits, errors and billing notes.

Floodgate video requests run as background tasks. Choose the brand guide for your model, submit once, and keep the public task ID for status checks and downloads.

Use only operations currently available for the exact model and routing group in [Model Square](https://floodgate.dev/models). A model name alone does not establish support. All requests use `https://api.floodgate.dev` and `Authorization: Bearer $FLOODGATE_API_KEY`.

## Choose a video API

> [card] [Kling](https://docs.floodgate.dev/kling.md)
>
> Text or image input, generation versions and v4 reference video.

> [card] [Seedance](https://docs.floodgate.dev/seedance.md)
>
> Text, frame images and reviewed media references.

> [card] [Veo](https://docs.floodgate.dev/veo.md)
>
> Text input through the compatible Videos API.

> [card] [MiniMax H3](https://docs.floodgate.dev/h3.md)
>
> Text with optional first and last frames.

> [card] [Wan and Happyhorse](https://docs.floodgate.dev/alibaba.md)
>
> Nested input and parameters for Alibaba video models.

> [card] [Grok](https://docs.floodgate.dev/grok.md)
>
> Text input through the video generations endpoint.

## Submit, poll and download

**1. Submit once**

Send the brand's JSON request with your API key. Read `id` from the submission response, or `data.task_id` for Kling. Keep this public ID.

**2. Poll the original task**

Use the available status operation in the brand guide. Pending states mean wait and poll again. Stop on success or terminal failure. A client timeout does not cancel the task.

**3. Download after success**

Send your Authorization header to the reviewed owned-content endpoint. Save the response bytes before the result expires.

The compatible status endpoint, when available, is `GET /v1/videos/{task_id}`:

```bash theme={null}
curl --fail-with-body "https://api.floodgate.dev/v1/videos/$TASK_ID" \
  -H "Authorization: Bearer $FLOODGATE_API_KEY"

curl --fail-with-body "https://api.floodgate.dev/v1/videos/$TASK_ID/content" \
  -H "Authorization: Bearer $FLOODGATE_API_KEY" --output video.mp4
```

Compatible states are `queued`, `in_progress`, `completed` and `failed`. Only `completed` has a downloadable result. Native status envelopes differ by brand.

```json theme={null}
{"id":"task_example","task_id":"task_example","object":"video","status":"completed","progress":100,"result_url":"/v1/videos/task_example/content"}
```

```json theme={null}
{"id":"task_example","status":"failed","error":{"code":"task_failed","message":"Video generation failed"}}
```

## Result files

Results require authentication from the account that created the task. Download promptly; expiry varies. If you use an existing result-file URL, keep its public task and asset IDs. See the brand guide for the reviewed download operation and output format.

## Errors and retries

| Response | Action |
| - | - |
| `400` | Check required fields, allowed configuration and input limits. A download can also return this while a task is unfinished. |
| `401` | Check the API key. |
| `403` | Check group access and available funds. |
| `410` on download | The result expired. |
| `429` | Respect rate limits. |
| `submission_uncertain` | Keep the request details and wait for reconciliation. Do not automatically submit again. |

Inspect native response error fields even after HTTP 200. Failed tasks have no video to download. An unexpected status should stop your polling loop for inspection.

## Limits and billing

Use the selected model/group's published limits and configuration combinations. A null constraint is undocumented. Do not combine options from different configuration rows.

Floodgate reserves funds before submission. Follow-ups retain the original task's group and pricing. Depending on the brand, settlement uses completed requests, verified output seconds or completion tokens. Brand guides explain the unit; [Model Square](https://floodgate.dev/models) shows current rates.

A confirmed failed task releases its reservation. Missing final usage can leave settlement pending. Check Task Logs before retrying a timed-out submission: submitting again can create another task and charge.


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