---
name: chinaapi-seedance-2-video
description: Create, poll, download, and verify a Seedance 2 video through ChinaAPI.
version: 1.1.0
---

# Seedance 2 video via ChinaAPI

Use this skill when the user wants a runnable Seedance 2 text-to-video workflow. Supported model IDs: `doubao-seedance-2-0-260128`, `doubao-seedance-2-0-fast-260128`, `doubao-seedance-2-0-mini-260615`. Default: `doubao-seedance-2-0-mini-260615`.

## Safety

- Read the API key from CHINAAPI_API_KEY; never write it to source, logs, shell history, or URLs.
- Keep uploaded reference media free of secrets and content you do not have permission to process.
- Only create artifacts/seedance-2.mp4 inside the current project; do not overwrite another path.

## Execute

1. Confirm `CHINAAPI_API_KEY` exists without printing it: `test -n "${CHINAAPI_API_KEY:-}"`.
2. Download the runner from `https://chinaapi.ai/agent-recipes/seedance-2/run.py` into an empty project, inspect it, then run `python3 run.py`.
3. The runner creates once with `POST /v1/video/generations`, polls `GET /v1/video/generations/{task_id}`, downloads `artifacts/seedance-2.mp4`, and validates the media signature and minimum size.
4. Run the independent acceptance command: `python3 -c "from pathlib import Path; p=Path('artifacts/seedance-2.mp4'); b=p.read_bytes(); assert len(b)>=1024 and (b[4:8]==b'ftyp' or b.startswith(b'\x1aE\xdf\xa3')), (len(b), b[:12]); print(f'verified {p}: {len(b)} bytes')"`.

## Error recovery

- `400`: Validate the exact model ID and request fields shown by the response before retrying.
- `401`: Confirm CHINAAPI_API_KEY is exported in this shell and has not been pasted into a file.
- `402`: Check balance and live pricing in Dash; do not loop a billable create request.
- `429`: Honor Retry-After when present and retry the poll; do not create a duplicate job.
- `5xx`: Retry polling the existing task with backoff. Create a new task only after confirming the old task failed.
- `network`: The runner retries a dropped poll or download against the same task automatically. If it still exits, resume polling that task ID; a network failure never means the job was lost.
- `timeout`: Print the task ID and resume polling that task; do not silently submit another billable job.

Never convert a poll retry into another billable create request. Report the task ID on timeout so polling can resume.

Source schema: `chinaapi.agent-recipe.v1` · recipe `seedance-2-video@1.1.0` · verified 2026-08-09.
