# Wan 2.7 Video API

> Wan 2.7 Video — high-quality AI video generation.

- **Provider**: Wan
- **Model id**: `wan-2-7-text-to-video`
- **Modality**: video
- **Price**: 9.28–13.92 credits /sec

## Overview

Wan 2.7 Video is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `wan-2-7-text-to-video` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL to receive a signed webhook on completion |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | Yes | The positive prompt for the generation (default: A sandcastle builds itself grain by grain on an empty beach in time-lapse. Audio: soft waves, distant seagulls.) |
| negative_prompt | string | No | The negative prompt for the generation |
| audio_url | string | No | Audio URL for the generation (image URL) |
| resolution | string | No | The resolution of output (options: 720p | 1080p) (default: 1080p) |
| ratio | string | No | The ratio of output (options: 16:9 | 9:16 | 1:1 | 4:3 | 3:4) (default: 16:9) |
| duration | number | No | Total duration of output (range 2-15) (default: 5) |
| prompt_extend | boolean | No | Wether to enable the prompt optimizer (true/false) (default: true) |
| watermark | boolean | No | Wether to enable the watermark (true/false) (default: false) |
| seed | number | No | The random seed to use for the generation.(>=0,<=2147483647) (default: 0) |
| nsfw_checker | boolean | No | A configurable parameter. Defaults to true in the Playground. (true/false) (default: true) |

### Request example

```json
{
  "modelId": "wan-2-7-text-to-video",
  "input": {
    "prompt": "A cinematic aerial shot of a coastal town at golden hour, gentle waves rolling onto the shore, warm light, slow camera push-in.",
    "negative_prompt": "blurry, low quality, distorted, watermark, text",
    "audio_url": "https://example.com/input.jpg",
    "resolution": "1080p",
    "ratio": "16:9",
    "duration": "5",
    "prompt_extend": true,
    "watermark": false,
    "seed": "0",
    "nsfw_checker": true
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 24
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=wan-2-7-text-to-video`

When `state` is `success`, the output is in `resultUrls`: `{ "state": "success", "resultUrls": [ ... ] }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, check API Key |
| 402 | Insufficient account balance |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |
