Generate videos with HiAPI's seedance-2-0 model via the HiAPI unified async task API. Use when a user asks to create a video with Seedance 2.0, HiAPI Seedanc...
---
name: hiapi-seedance-2-0-video
description: Generate videos with HiAPI's seedance-2-0 model via the HiAPI unified async task API. Use when a user asks to create a video with Seedance 2.0, HiAPI Seedance 2.0, or this specific skill.
metadata:
short-description: Generate Seedance 2.0 videos through HiAPI
---
# HiAPI Seedance 2.0 Video
Use this skill when the user wants video generation through HiAPI's `seedance-2-0` model.
## Requirements
- Node.js 18 or newer.
- `HIAPI_API_KEY` must be set in the environment.
- `HIAPI_BASE_URL` is optional and defaults to `https://api.hiapi.ai`.
Important links:
- Get API key: https://www.hiapi.ai/en/register
- Pricing: https://www.hiapi.ai/en/pricing
- Docs: https://docs.hiapi.ai
Never invent a video result. If the API call fails, report the status code, compact error message, and the next action from the Error Guidance section.
## Generate A Video
Run:
```bash
node scripts/hiapi-seedance-2-video.mjs \
--prompt "A cinematic ocean cliff shot at golden hour" \
--seconds 5 \
--resolution 720p \
--ratio 16:9
```
For image-to-video, pass a public image URL or data URI:
```bash
node scripts/hiapi-seedance-2-video.mjs --prompt "The product photo comes alive with soft camera movement" --input-reference "https://example.com/product.jpg"
```
Supported durations:
- any integer from `4` to `15`
Supported resolutions:
- `480p`
- `720p`
- `1080p`
Supported ratios:
- `16:9`
- `9:16`
- `1:1`
- `4:3`
- `3:4`
- `21:9`
- `adaptive`
Media modes are mutually exclusive:
- **Text-to-video**: no media fields.
- **First-frame image-to-video**: use `--first-frame-url` or legacy alias `--input-reference`.
- **First+last-frame image-to-video**: use both `--first-frame-url` and `--last-frame-url`.
- **Multimodal reference video generation**: use `--reference-image-url`, `--reference-video-url`, and/or `--reference-audio-url`.
Do not mix first/last-frame fields with reference image/video/audio fields. Multimodal reference mode can ask in the prompt for a reference image to act as first or last frame, but strict first/last-frame identity should use first+last-frame mode.
Reference material limits:
- `reference_image_urls` plus first/last-frame images: at most 9 images total.
- `reference_video_urls`: at most 3 videos; each 2-15 seconds; total duration at most 15 seconds. The CLI requires one `--reference-video-duration` per video URL.
- `reference_audio_urls`: at most 3 audio clips; each 2-15 seconds; total duration at most 15 seconds. The CLI requires one `--reference-audio-duration` per audio URL.
The script creates a video task, polls until it finishes, downloads the video to `outputs/` when possible, and prints JSON with the saved file path or remote URL.
## API Contract
This skill calls:
```text
POST /v1/tasks
GET /v1/tasks/{taskId}
```
with:
```json
{
"model": "seedance-2-0",
"input": {
"prompt": "...",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"first_frame_url": "https://example.com/photo.jpg",
"last_frame_url": "https://example.com/end.jpg",
"reference_image_urls": ["asset://image-1"],
"reference_video_urls": ["asset://video-1"],
"reference_audio_urls": ["asset://audio-1"],
"return_last_frame": false,
"web_search": false,
"nsfw_checker": false,
"generate_audio": true,
"seed": 12345
}
}
```
`first_frame_url` is optional. The CLI still accepts `--input-reference` as a convenience alias, then sends it as `input.first_frame_url`. Do not include `reference_*_urls` in the same request as first/last-frame fields. `generate_audio` is omitted from the request unless explicitly set — the API default is `true` (audio on); pass `--no-audio` (or `--no-generate-audio`) to disable it, `--generate-audio` to force it on. `seed` is an optional integer from 0 to 2147483647 for reproducible generation; it is omitted unless `--seed` is passed.
For details, read `references/api.md` and `references/output.md`.
## Check Configuration
Run:
```bash
node scripts/check-config.mjs
```
Use `--live` only when you want to verify that the configured key can reach the HiAPI pricing endpoint.
## Error Guidance
- Missing `HIAPI_API_KEY`: tell the user to create or copy a key from https://www.hiapi.ai/en/register and export it.
- HTTP `401` or `403`: tell the user to verify the HiAPI API key.
- HTTP `402`, HTTP `403` with quota text, insufficient balance, credits, quota, or payment errors: tell the user to add credits or check billing at https://www.hiapi.ai/en/dashboard and review pricing at https://www.hiapi.ai/en/pricing.
- HTTP `400`: tell the user to check duration, resolution, ratio, media mode, reference counts, and reference audio/video durations.
- HTTP `429`: tell the user to wait and retry or reduce concurrent video generations.
- Task failure: ask the user to try a clearer prompt or a different image.
- Timeout: explain that video generation may still be running and the user can retry later.
- Optional skill update notice: tell the user the printed update command can be run later.
- Required skill update notice: tell the user the printed update command must be run before using this skill again.
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit intent, inputs with HiAPI connection setup, numbered procedure with input/output per step, decision points for auth/quota/rate-limit/format errors, and output contract with JSON schemas for success and failure.
generate videos using HiAPI's seedance-2-0 model through their unified async task API. use this skill when a user asks to create a video with seedance 2.0, either from text alone (text-to-video), from a single image (image-to-video), from paired first and last frames, or from multimodal references (images, videos, audio). the skill handles task creation, polling for completion, downloading the result, and reporting status or errors.
https://api.hiapi.ai. override only if using a custom HiAPI endpoint.480p, 720p, 1080p. defaults to 720p.16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive. defaults to 16:9.--first-frame-url or --input-reference (legacy alias).--first-frame-url and --last-frame-url.--reference-image-url, --reference-video-url, --reference-audio-url.--reference-video-duration per video.--reference-audio-duration per clip.--generate-audio to force audio generation on, or --no-audio/--no-generate-audio to disable. API default is on.verify configuration: run node scripts/check-config.mjs. this validates that HIAPI_API_KEY is set and (with --live) confirms the key can reach HiAPI's pricing endpoint. if missing, stop and direct user to https://www.hiapi.ai/en/register.
construct the command: build a node script call with the user's prompt and optional parameters. example for text-to-video:
node scripts/hiapi-seedance-2-video.mjs \
--prompt "A cinematic ocean cliff shot at golden hour" \
--seconds 5 \
--resolution 720p \
--ratio 16:9
for image-to-video:
node scripts/hiapi-seedance-2-video.mjs \
--prompt "The product photo comes alive with soft camera movement" \
--first-frame-url "https://example.com/product.jpg"
submit the task: the script POSTs to POST /v1/tasks with model seedance-2-0 and the input object. the request body includes prompt, duration, resolution, aspect_ratio, and any media fields. omit generate_audio unless explicitly set; omit seed unless provided.
poll for completion: the script calls GET /v1/tasks/{taskId} repeatedly (with backoff) until the task status is succeeded or failed. typical generation takes 1-5 minutes depending on video length and complexity.
download the result: if the task succeeds and a downloadable URL is present, the script saves the video to outputs/ with an auto-generated filename. if download fails or is unavailable, the script returns the remote URL instead.
report output: the script prints a JSON object containing the file path (local) or remote URL, task ID, and status. on failure, it prints the HTTP status code, error message, and guidance from the error section below.
if media mode is ambiguous (e.g., user passes both first-frame-url and reference-image-url): reject with a clear message. first/last-frame fields and multimodal reference fields are mutually exclusive. the API will return HTTP 400 if both are present.
if HIAPI_API_KEY is missing: tell the user to create or copy a key from https://www.hiapi.ai/en/register and export HIAPI_API_KEY=<key>.
if HTTP 401 or 403 (auth error): tell the user to verify their HiAPI API key is correct and not expired.
if HTTP 402 or 403 with quota/credit language: tell the user to add credits or check billing at https://www.hiapi.ai/en/dashboard and review pricing at https://www.hiapi.ai/en/pricing.
if HTTP 400 (bad request): tell the user to check duration (4-15), resolution (480p/720p/1080p), ratio, media mode exclusivity, and reference counts (max 9 images, max 3 videos/audio each, max 15s total per type).
if HTTP 429 (rate limit): tell the user to wait and retry or reduce concurrent video generations.
if task status is failed: ask the user to try a clearer or more specific prompt, use a different image, or report the error details to HiAPI support.
if polling times out (no completion after ~30 minutes): explain that video generation may still be running. the user can retry the task ID later or submit a new request.
if download fails but the video exists on HiAPI: return the remote URL and tell the user they can download it manually.
if skill update is required: print a required update notice and ask the user to run the printed update command before using the skill again.
success is a JSON object printed to stdout with the structure:
{
"task_id": "abc123...",
"status": "succeeded",
"video_url": "https://...",
"local_path": "outputs/seedance-2-0-abc123-uuid.mp4",
"duration_seconds": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"model": "seedance-2-0"
}
task_id: the HiAPI task ID for reference or retry.status: must be succeeded.video_url: remote URL where the video is stored. always present on success.local_path: file path in outputs/ where the video was saved. present only if local download succeeded; otherwise omitted.duration_seconds, resolution, aspect_ratio, model: echo the request parameters for confirmation.on failure, the JSON includes status, task_id, http_status, and error_message, e.g.:
{
"task_id": "abc123...",
"status": "failed",
"http_status": 400,
"error_message": "Invalid aspect ratio"
}
the user knows the skill worked when:
"status": "succeeded".outputs/ (if local_path is set).video_url.the user knows the skill failed when:
"status": "failed" or "error".outputs/ and no valid video_url is returned.