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

> ## Agent Instructions
> Authenticate every request with your API key in the `X-API-Key` header or `Authorization: Bearer`. Keys start with `sk-nunchux-`.
> Image generation is synchronous: the image is in the response.
> Video generation is asynchronous: submit the job, poll its task until it reaches a terminal status, then download the output promptly, because output URLs expire.

# Seedance

> ByteDance's Seedance video model for text-to-video and image-to-video with generated audio.

# Seedance

Seedance is ByteDance's video model line. Each version generates a clip from a text prompt, from a starting image or from reference media, and can score the clip with generated audio. Generation is asynchronous. You submit a task, poll it until the status is terminal, then download the clip. The route mirrors ByteDance's own API, so the request and response shapes are the provider's.

> [!NOTE]
>
> Best for
>
> * Prompt-driven scenes. A usable clip from a written description, with no shoot and no source footage.
> * Animating a still. A first frame fixes the composition and the prompt drives the motion.
> * Guiding a clip with references. Reference images, a video or audio steer the subject, motion or sound without fixing the first frame.
> * Clips with sound. The model generates a track with the picture unless you turn it off.

## Models

| Model | Model ID | Tasks | Resolution | Duration |
| - | - | - | - | - |
| Seedance 2.5 | `dreamina-seedance-2-5-260628` | t2v, i2v, reference-to-video | 480p, 720p | From 4 s |

One model ID serves every task. The items in `content[]` select the task. A `text` item alone gives text-to-video. A `text` item plus a `first_frame` image item gives image-to-video. A `text` item plus one or more reference items gives reference-to-video. A request cannot mix first or last frame items with reference items; that request returns a 400.

On image-to-video the output shape follows the first frame. Crop the image to the shape you want before you upload it.

## Endpoints

| Step | Route |
| - | - |
| Submit | `POST /v1/bytedance/contents/generations/tasks` |
| Poll | `GET /v1/bytedance/contents/generations/tasks/{task_id}` |

The poll route is the submit route with the task ID appended.

## Request

Send your API key in the `X-API-Key` header. See [Authentication](https://docs.nunchux.ai/authentication.md). Set `Content-Type: application/json`. The examples also send a `User-Agent` header that names your application.

**model** `string` *required*

The model ID: `dreamina-seedance-2-5-260628`.

**content** `array` *required*

The prompt, plus the first frame on image-to-video or the reference media on reference-to-video. Put the `text` item first.

**item properties**

**type** `string` *required*

`text` for the prompt. `image_url` for an image. `video_url` for a video. `audio_url` for an audio clip.

**text** `string`

The prompt. Required on a `text` item. All tasks. Describe the subject, the action and the camera move.

**role** `string`

On a media item. What the item is for. Set `first_frame` on an `image_url` item for the image the clip starts on (image-to-video). Set `reference_image`, `reference_video` or `reference_audio` on an `image_url`, `video_url` or `audio_url` item to guide the clip without fixing its first frame (reference-to-video).

**image\_url** `object`

On an `image_url` item. The image container.

**properties**

**url** `string` *required*

The URL of the image. The provider fetches it, so the URL must be reachable from the internet.

**video\_url** `object`

On a `video_url` item. The video container.

**properties**

**url** `string` *required*

The URL of the video. It must be a web URL that the provider can fetch. A `data:` URI returns a 400.

**audio\_url** `object`

On an `audio_url` item. The audio container.

**properties**

**url** `string` *required*

The URL of the audio clip. The provider fetches it, so the URL must be reachable from the internet. The clip can be up to 30 seconds long.

**duration** `integer`

The clip length in seconds, as a whole number. All tasks. The minimum is 4. A longer clip uses more video tokens.

**resolution** `string` (default: 720p)

The output tier: `480p` or `720p`. All tasks. A larger frame uses more video tokens.

**generate\_audio** `boolean` (default: true)

Send `false` for a silent clip. All tasks. The flag is a billing dimension: a clip with sound and a silent clip are priced differently.

## Response

### Submit

A 200 status means that the provider accepted the task. It does not mean that the clip is ready.

**id** `string` *required*

The task ID. Treat it as an opaque string. Poll `GET /v1/bytedance/contents/generations/tasks/{task_id}` with it.

### Poll

**status** `string` *required*

`queued` or `running` while the task runs. `succeeded`, `failed`, `cancelled` or `expired` when it ends. Poll until you read one of the four terminal values.

**content.video\_url** `string`

The URL of the clip. Present only when `status` is `succeeded`. The URL expires. Download the clip as soon as the task succeeds.

**error** `object`

The failure detail. Present when the task did not succeed. Read it before you resubmit.

**duration** `integer`

The clip length in seconds.

**ratio** `string`

The output aspect ratio, such as `16:9`.

**usage.completion\_tokens** `integer`

The number of video tokens the clip used. Present when `status` is `succeeded`. Seedance is billed by this count, so the cost is known when the task completes.

## Example

Submit, poll, download. The submit and the poll use the same path. The poll appends the task ID.

```bash cURL theme={"system"}
BASE=https://api.nunchux.com
TASKS=$BASE/v1/bytedance/contents/generations/tasks

# 1. Submit
SUBMIT=$(curl -sS --fail-with-body "$TASKS" \
  -H "X-API-Key: $NUNCHUX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: YourApp/1.0" \
  -d '{
    "model": "dreamina-seedance-2-5-260628",
    "content": [
      { "type": "text", "text": "a fox trotting through a snowy forest at dawn" }
    ],
    "resolution": "720p",
    "generate_audio": false
  }') || { echo "submit failed: $SUBMIT" >&2; exit 1; }
TASK=$(jq -er '.id' <<<"$SUBMIT") || { echo "no id in: $SUBMIT" >&2; exit 1; }

# 2. Poll until the status is terminal
DELAY=5
for _ in $(seq 1 90); do
  RESP=$(curl -sS "$TASKS/$TASK" \
    -H "X-API-Key: $NUNCHUX_API_KEY" \
    -H "User-Agent: YourApp/1.0")
  STATUS=$(jq -r '.status // ""' <<<"$RESP")
  case "$STATUS" in succeeded|failed|cancelled|expired) break ;; esac
  sleep "$DELAY"; DELAY=$(( DELAY * 2 > 30 ? 30 : DELAY * 2 ))
done

# 3. Check for failure
[ "$STATUS" = "succeeded" ] || { echo "task $STATUS: $(jq -r '.error // "no error"' <<<"$RESP")" >&2; exit 1; }

# 4. Download
curl -sSL -o seedance.mp4 "$(jq -r '.content.video_url' <<<"$RESP")"
```

```python Python theme={"system"}
# pip install requests
import os, time, requests

BASE = "https://api.nunchux.com"
TASKS = f"{BASE}/v1/bytedance/contents/generations/tasks"
HEADERS = {
    "X-API-Key": os.environ["NUNCHUX_API_KEY"],
    "User-Agent": "YourApp/1.0",
}

# 1. Submit
submit = requests.post(
    TASKS,
    headers=HEADERS,
    json={
        "model": "dreamina-seedance-2-5-260628",
        "content": [
            {"type": "text", "text": "a fox trotting through a snowy forest at dawn"}
        ],
        "resolution": "720p",
        "generate_audio": False,
    },
)
if not submit.ok:
    raise RuntimeError(f"submit failed: HTTP {submit.status_code} {submit.text}")
task = submit.json()["id"]

# 2. Poll until the status is terminal
delay = 5
for _ in range(90):
    data = requests.get(f"{TASKS}/{task}", headers=HEADERS).json()
    status = data.get("status", "")
    if status in ("succeeded", "failed", "cancelled", "expired"):
        break
    time.sleep(delay)
    delay = min(delay * 2, 30)
else:
    raise TimeoutError("Seedance task did not reach a terminal status")

# 3. Check for failure
if status != "succeeded":
    raise RuntimeError(f"Seedance task {status}: {data.get('error')}")

# 4. Download
with requests.get(data["content"]["video_url"], stream=True, timeout=300) as r:
    r.raise_for_status()
    with open("seedance.mp4", "wb") as f:
        for chunk in r.iter_content(1 << 14):
            f.write(chunk)
```

To animate a still, append an item with `type` set to `image_url` and `role` set to `first_frame`, with the image URL under `image_url.url`. The body below replaces the submit body in the example.

```json Image-to-video theme={"system"}
{
  "model": "dreamina-seedance-2-5-260628",
  "content": [
    { "type": "text", "text": "the fox turns and trots toward the camera" },
    {
      "type": "image_url",
      "role": "first_frame",
      "image_url": { "url": "https://example.com/frame.jpg" }
    }
  ],
  "resolution": "720p",
  "generate_audio": false
}
```

To guide the clip with references instead, give each reference item a `reference_*` role. The body below uses a reference image and a reference audio clip. Do not add a `first_frame` item to a reference request.

```json Reference-to-video theme={"system"}
{
  "model": "dreamina-seedance-2-5-260628",
  "content": [
    { "type": "text", "text": "the fox from the reference image dances to the music" },
    {
      "type": "image_url",
      "role": "reference_image",
      "image_url": { "url": "https://example.com/fox.jpg" }
    },
    {
      "type": "audio_url",
      "role": "reference_audio",
      "audio_url": { "url": "https://example.com/music.mp3" }
    }
  ],
  "resolution": "720p",
  "duration": 5
}
```

## Tips

* Describe motion and camera, not just the scene. A static description gives the model nothing to animate.
* Keep the prompt to one clear action. Busy, multi-event prompts are harder to render cleanly.
* Draft at 480p to settle the wording, then re-run the same prompt at 720p. A smaller frame uses fewer video tokens.
* Decide about audio before you run. The flag changes the price, so a silent draft is the cheaper way to test a prompt.
* Poll every 5 seconds at first, then back off to 30 seconds. Polls are free and never use a concurrency slot.

## Errors and limits

A 200 status on submit means that the provider accepted the task. It does not mean that the task succeeded. A task that fails later ends with `status` set to `failed`, `cancelled` or `expired`, and `error` explains why. Read it before you resubmit.

A failed submit returns an HTTP error status. See [Error codes](https://docs.nunchux.ai/errors.md).

A 5xx status or a timeout on submit does not tell you whether the task was created. Never resubmit blindly. If the submit returned an `id`, poll it. If it returned nothing, check your credits before you try again.

ByteDance applies these limits to each first or last frame image you attach:

* 300 to 6,000 pixels on each side
* An aspect ratio, width over height, between 0.4 and 2.5
* Under 30 MB per file

ByteDance also applies these limits to the content of a request:

* First or last frame items cannot be mixed with reference items.
* A reference video must be a web URL. A `data:` URI returns a 400.
* A reference audio clip can be up to 30 seconds long.
* `duration` is 4 seconds or more.

Seedance is billed by the number of video tokens the finished clip uses. The charge is known when the task completes, not before it starts. A longer or larger clip uses more tokens, and the audio flag changes the rate. Every task counts toward the simultaneous-jobs cap of your plan. See [Rate limits](https://docs.nunchux.ai/rate-limits.md), [Credits & pricing](https://docs.nunchux.ai/credits-pricing.md) and the [Partner models overview](https://docs.nunchux.ai/partner-models/overview.md).


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