# Video Generation API

> LMU AI Video Generation API overview: choose between Seedance and Wan, plus shared rules for auth, async tasks, billing, concurrency limits and error codes.

URL: https://docs.lmuai.com/en/docs/api/video-generation



LMU AI provides two kinds of **asynchronous** video generation APIs, both using the vendors' **native protocols**: replace the address in the official SDK or curl command with the LMU AI address and the key with your LMU AI API key, and the request body stays unchanged. This page is the overview: pick an API from the table below, then read its provider page. The rules both providers share (authentication, billing, concurrency limits and error codes) are on this page.

<Callout type="info" title="Base URL">
  ```text
  https://api.lmuai.com
  ```

  | Provider                  | Create task                                                   | Query task                                    | Docs                                                         |
  | ------------------------- | ------------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------ |
  | Seedance (Volcengine Ark) | `POST /api/v3/contents/generations/tasks`                     | `GET /api/v3/contents/generations/tasks/{id}` | [Seedance Video Generation API](/en/docs/api/seedance-video) |
  | Wan (Alibaba DashScope)   | `POST /api/v1/services/aigc/video-generation/video-synthesis` | `GET /api/v1/tasks/{task_id}`                 | [Wan Video Generation API](/en/docs/api/wan-video)           |
</Callout>

<Callout type="warn" title="Video generation must be enabled for your group">
  The API key's group must have "Video generation" enabled; otherwise calls return `403`. The models you can actually call depend on your API key; check them with `GET /v1/models`.
</Callout>

## 1. Choosing between the two [#compare]

|                   | Seedance (Volcengine Ark)                                   | Wan (Alibaba DashScope)                                        |
| ----------------- | ----------------------------------------------------------- | -------------------------------------------------------------- |
| Example model     | `seedance-2.5`                                              | `wan3.0-video`                                                 |
| Billing           | By output tokens                                            | By "actual seconds × resolution-tier unit price"               |
| Resolution values | `480p` / `720p` / `1080p` (lowercase)                       | `480P` / `720P` / `1080P` (uppercase), default `1080P`         |
| Task status       | `queued` → `running` → `succeeded` / `failed` / `cancelled` | `PENDING` → `RUNNING` → `SUCCEEDED` / `FAILED` / `CANCELED`    |
| Video URL field   | `content.video_url`                                         | `output.video_url`                                             |
| Cancelling a task | Queued (`queued`) tasks can be cancelled                    | No cancel endpoint; a submitted task always runs to completion |

The model name must match the name enabled for your group **exactly** (case-sensitive). The two APIs use similar field names but different casing and paths, so don't mix them up when copying examples.

## 2. Authentication [#auth]

Send your API key in the header of every request:

```http
Authorization: Bearer YOUR_API_KEY
```

Do not put your API key in browser front-end code, public repositories, URL query strings, or logs. Call the API from your own server.

## 3. Asynchronous task flow [#flow]

1. **Create**: `POST` only returns a task id; it does not wait for the video.
2. **Poll**: `GET` the task about every 10 seconds until it reaches a final state (succeeded / failed / cancelled).
3. **Reference images**: API calls must pass a publicly accessible image URL (JPG / PNG / WebP); the Video Generation page in the console accepts local image uploads.
4. **Download**: on success, take the video link from the response. Upstream links are **valid for 24 hours**, so download promptly; the platform keeps a copy of each finished video, which you can play and download on the Video Tasks page in the console.

<Callout type="info" title="Billing settles even if you stop polling">
  After submission, the platform follows up on the task in the background and settles it normally even if you stop querying; failed and cancelled tasks are not charged.
</Callout>

For complete create-and-poll examples, see the [Seedance](/en/docs/api/seedance-video#poll-example) and [Wan](/en/docs/api/wan-video#poll-example) pages.

## 4. Billing and watermarks [#billing]

* An estimated amount is frozen when the task is created. If your balance is insufficient, the request is rejected outright (`402`) and no video is generated.
* On success, the task is settled once by actual usage, and any excess frozen amount is returned automatically; failed and cancelled tasks are fully refunded and not charged.
* Seedance is billed by output tokens; Wan is billed by "actual seconds × resolution-tier unit price".
* Finished videos carry the platform's "AI-generated" label, which clients cannot turn off.

## 5. Concurrency limits [#limits]

Each user and each API key can have at most **5** tasks generating at the same time. Beyond that, requests return `429` with a `Retry-After` header (about 60 seconds); back off and retry.

## 6. Error codes [#errors]

| HTTP                  | Meaning                                                                                   | What to do                                      |
| --------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `401`                 | The API key is invalid or disabled                                                        | Check your API key                              |
| `402`                 | Insufficient balance or quota to freeze the estimated amount                              | Top up and retry                                |
| `403`                 | Video generation is not enabled for the group, or the model is not available in the group | Use an API key that supports video generation   |
| `404 model_not_found` | The model is not available yet (a misspelled name also triggers this)                     | Use the exact name returned by `GET /v1/models` |
| `409`                 | The task has started generating and cannot be cancelled (Seedance cancel endpoint)        | Wait for the task to finish                     |
| `429`                 | The number of in-flight tasks has reached the limit                                       | Back off according to `Retry-After` and retry   |

For general errors, see [Error Codes](/en/docs/guide/errors).

## 7. Provider pages [#providers]

* [Seedance Video Generation API](/en/docs/api/seedance-video): create, query, list and cancel tasks, with parameters, notes on first-frame reference images, and a complete polling example.
* [Wan Video Generation API](/en/docs/api/wan-video): create and query tasks, with parameters and a complete polling example.
