# Seedance 2.0 Mini API

> Seedance 2.0 Mini — high-quality AI video generation.

- **Provider**: ByteDance
- **Model id**: `bytedance-seedance-2-mini`
- **Modality**: video
- **Price**: 6.15–13.22 credits /sec

## Overview

Seedance 2.0 Mini 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: `bytedance-seedance-2-mini` |
| 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 |
|-----------|------|----------|-------------|
| first_frame_url | string | No | Click to upload or drag and drop images. JPG/PNG/WEBP/BMP/GIF, max 30MB each. (image URL) |
| last_frame_url | string | No | Click to upload or drag and drop images. JPG/PNG/WEBP/BMP/GIF, max 30MB each. (image URL) |
| prompt | string | No | The text prompt or description for the video. (default: Animate from the first frame: the drummer's sticks blur into a fast roll across the kit, cymbals trembling and catching the stage light, the camera pushing in tight as the tempo builds.) |
| reference_image_urls | string[] | No | A list of input image URLs. (image URL) |
| reference_video_urls | string[] | No | A list of input video URLs. Furthermore, the total length of the three videos must not exceed 15 seconds. (image URL) |
| reference_audio_urls | string[] | No | A list of input audio URLs. Furthermore, the total length of the three audios must not exceed 15 seconds. (image URL) |
| generate_audio | boolean | No | Whether to generate AI audio synchronized with the video. (true/false) (default: true) |
| resolution | string | No | The output video resolution. (options: 480p | 720p) (default: 720p) |
| aspect_ratio | string | No | The aspect ratio of the generated video. (options: 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9 | adaptive) (default: 16:9) |
| duration | number | No | Video duration in seconds. (range 4-15) (default: 15) |
| web_search | boolean | No | Use online search (true/false) (default: false) |
| nsfw_checker | boolean | No | A configurable parameter. Defaults to true in the Playground. (true/false) (default: true) |

### Request example

```json
{
  "modelId": "bytedance-seedance-2-mini",
  "input": {
    "first_frame_url": "https://example.com/input.jpg",
    "last_frame_url": "https://example.com/input.jpg",
    "prompt": "A cinematic aerial shot of a coastal town at golden hour, gentle waves rolling onto the shore, warm light, slow camera push-in.",
    "reference_image_urls": [
      "https://example.com/input.jpg"
    ],
    "reference_video_urls": [
      "https://example.com/input.jpg"
    ],
    "reference_audio_urls": [
      "https://example.com/input.jpg"
    ],
    "generate_audio": true,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": "15",
    "web_search": false,
    "nsfw_checker": true
  }
}
```

### Response example

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

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=bytedance-seedance-2-mini`

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 |
