Seedance video and asset library
Authenticate with your site API key. BASE_URL is the API origin, without /v1.
export BASE_URL='https://api.nbility.ai'
export API_KEY='YOUR_API_KEY'
Models and capabilities
| model | resolution | duration |
|---|---|---|
doubao-seedance-2-0 | 480p, 720p, 1080p, 4k | 4–15 seconds, or -1 for automatic duration |
doubao-seedance-2-0-fast | 480p, 720p | 4–15 seconds, or -1 |
doubao-seedance-2-0-mini | 480p, 720p | 4–15 seconds, or -1 |
doubao-seedance-2-5 | 480p, 720p, 1080p | 4–30 seconds, or -1 |
The default resolution is 720p. Resolution is a separate parameter. The old seedance-2-720p, seedance-2-cheap names and legacy file fields have been replaced by this protocol.
Playground parameter form
Choose video mode and a supported model in the Playground to set resolution, aspect ratio, a fixed or automatic duration, audio generation, watermark, and last-frame output. References accept online URLs, local files, and your own library's asset://ll2_asset_… references, with first-frame, last-frame, reference-image, reference-video, and reference-audio roles.
2.5 also offers MP4/MOV output and auto, reference, edit, and extend task modes. Edit automatically selects automatic duration and the adaptive ratio; extend selects adaptive. Both require a reference video. Using first/last frames with 2.5 also selects adaptive. The form validates parameters before uploading media or creating a task.
Create and retrieve videos
| Operation | Method and path |
|---|---|
| Native creation | POST /seedance/api/v3/contents/generations/tasks |
| Native retrieval | GET /seedance/api/v3/contents/generations/tasks/{task_id} |
| OpenAI Video creation | POST /v1/videos |
| OpenAI Video retrieval | GET /v1/videos/{task_id} |
| OpenAI Video download | GET /v1/videos/{task_id}/content |
| Responses | POST /v1/responses, supporting synchronous replies, streamed progress and background: true |
Native request parameters
| Field | Type | Description |
|---|---|---|
model | string | Required model ID from the table above |
content | array | Text, first/last frames, reference images, videos and audio; at least one item |
resolution | string | Model-specific resolution, default 720p |
duration | integer | Output duration, or -1; omission lets the model choose |
ratio | string | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive |
generate_audio | boolean | Generate output audio, default true; explicit false disables it |
watermark | boolean | Add a watermark |
return_last_frame | boolean | Request a last-frame image |
output_format | string | 2.5 only: mp4 or mov |
omni_reference_task_type | string | 2.5 only: auto, reference, edit, extend |
draft, draft_task and callback addresses are unsupported. Poll the task for progress.
curl -sS "${BASE_URL}/seedance/api/v3/contents/generations/tasks" \
-H "Authorization: Bearer ${API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"model": "doubao-seedance-2-0-mini",
"content": [{"type":"text","text":"A paper boat floating on a calm pond, static camera"}],
"resolution": "720p",
"duration": 5,
"ratio": "16:9",
"generate_audio": false,
"watermark": false,
"return_last_frame": true
}'
The response is {"id":"task_example"}. Keep this site task ID and retrieve it with an API key belonging to the same user:
curl -sS "${BASE_URL}/seedance/api/v3/contents/generations/tasks/task_example" \
-H "Authorization: Bearer ${API_KEY}"
{
"id": "task_example",
"model": "doubao-seedance-2-0-mini",
"status": "succeeded",
"resolution": "720p",
"duration": 5,
"content": {
"video_url": "/v1/tasks/task_example/artifacts/video/content",
"last_frame_url": "/v1/tasks/task_example/artifacts/last_frame/content"
}
}
Statuses are queued, running, succeeded and failed. Expiry and cancellation also become failures. Failure details appear in error.message. Poll every 5–10 seconds and increase the interval after 429 or transient errors.
Result addresses are relative site paths. Prefix them with BASE_URL and include your site key when downloading. A browser <video> element cannot attach the required header: download the media into a file or Blob URL, or use a temporary signed link from the site's task artifact listing.
curl -fL "${BASE_URL}/v1/tasks/task_example/artifacts/video/content" \
-H "Authorization: Bearer ${API_KEY}" -o output.mp4
Use the matching extension when requesting mov. last_frame_url appears only when a last frame was actually produced.
OpenAI Video and Responses
POST /v1/videos accepts the native JSON fields above. It also accepts prompt for the text item and seconds for duration. Extended fields may be placed in metadata; conflicting values at the top level and in metadata are rejected. size accepts a resolution name such as 720p. Upload references to obtain URLs before generating; do not send binary files directly to the generation endpoint.
{
"model": "doubao-seedance-2-5",
"prompt": "Follow the reference camera movement through a quiet seaside town",
"seconds": 8,
"metadata": {
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true,
"content": [
{"type":"video_url","video_url":{"url":"https://example.com/reference.mp4"},"role":"reference_video"}
]
}
}
For Responses, replace prompt with input; extended settings can stay in metadata. stream: true streams progress and the completed video result, not a live video encoding stream. background: true returns a pending response immediately; retrieve it with GET /v1/responses/{id}.
Reference media and task modes
Media items contain type, a matching URL object and a role:
| type | URL field | role |
|---|---|---|
text | Use a text string | Omit |
image_url | image_url.url | first_frame, last_frame, reference_image |
video_url | video_url.url | reference_video |
audio_url | audio_url.url | reference_audio |
A media address can be a publicly downloadable HTTPS URL or an asset://ll2_asset_... reference created with the asset library below. Arbitrary external asset IDs, Base64 and local paths are not accepted.
- Use at most one first frame and one last frame. A last frame requires a first frame. Frame mode cannot be mixed with other reference media.
- 2.0 / fast / mini accept up to 9 reference images, 3 videos and 3 audio clips. Each video or audio clip must be 2–15 seconds, with a total below 15 seconds for each media type. Audio references require an image or video too.
- 2.5 accepts up to 30 reference images, 10 videos and 10 audio clips. Reference video and audio duration combined must not exceed 30 seconds. Audio-only references are supported.
- 2.5 frame mode,
editandextendrequireratio: "adaptive". editrequires a reference video andduration: -1;extendalso requires a reference video.- In prompts,
@图像1,@视频1and@音频1refer to the first item of that media type incontent, continuing in appearance order.
The media service additionally checks duration, dimensions and formats. Assets still in Processing cannot be referenced.
Billing
Billing uses actual billable tokens, with prices selected by model, output resolution and whether a reference video is present. Reference audio and generated audio are different: audio_url is an input; generate_audio controls the output. The current four models have no separate generated-audio surcharge. Current retail rates and group multipliers are shown on the pricing page.
Submission reserves an estimated amount based on duration and resolution. Omitted duration or -1 reserves the model's maximum output duration. Reference-video requests also reserve reference-video usage. Completion reconciles the reservation using actual billable tokens and the delivered resolution; differences are refunded or charged, and failed tasks follow the normal refund flow. Do not use the old “reference video seconds + reference audio seconds + output seconds” formula for these models.
Asset library
The selected route must have asset-library access enabled. If create or query requests consistently return 502, contact support to confirm availability before repeatedly creating resources.
Groups, assets and verification sessions belong to the authenticated site user. Resources stay bound to their original channel credential; they cannot be shared across users or moved to an arbitrary account. Id / id, GroupId and SessionToken in responses are site identifiers. Do not replace them with identifiers from another service.
| Operation | Method and path |
|---|---|
| Create / get / update / delete a group | POST / GET / PUT / DELETE /seedance/api/v3/asset-groups |
| List groups | POST /seedance/api/v3/asset-groups/list |
| Create / get / update / delete an asset | POST / GET / PUT / DELETE /seedance/api/v3/assets |
| List assets | POST /seedance/api/v3/assets/list |
| Create a verification session | POST /seedance/api/v3/real-person/sessions |
| Retrieve verification outcome | POST /seedance/api/v3/real-person/sessions/result |
Initial creation selects a route for doubao-seedance-2-0 by default. Add ?model=doubao-seedance-2-5 to choose another model when your key only permits particular models. Asset operations do not charge video-generation quota. Creating a video reserves quota normally. Model permissions and per-user operation limits still apply.
Create a group and an asset
Ordinary groups use AIGC. Name allows up to 64 characters; Description allows up to 300. LivenessFace groups can only be created through verification.
curl -sS "${BASE_URL}/seedance/api/v3/asset-groups" \
-H "Authorization: Bearer ${API_KEY}" -H 'Content-Type: application/json' \
-d '{"Name":"Characters","Description":"Recurring characters","GroupType":"AIGC"}'
Response: {"code":0,"message":"","result":{"id":"ll2_group_example"}}.
curl -sS "${BASE_URL}/seedance/api/v3/assets" \
-H "Authorization: Bearer ${API_KEY}" -H 'Content-Type: application/json' \
-d '{"GroupId":"ll2_group_example","URL":"https://example.com/hero.png","AssetType":"Image","Name":"Hero"}'
Keep result.id, for example ll2_asset_example. Use Image, Video or Audio as the asset type. The URL must be publicly downloadable.
| Type | Formats and limits enforced by the asset service |
|---|---|
| Image | jpeg, png, webp, bmp, tiff, gif, heic, heif; below 30MB; aspect ratio (0.4, 2.5), side lengths (300, 6000) |
| Video | mp4, mov; at most 50MB; 2–15 seconds; 480p, 720p or 1080p; 24–60 FPS; aspect ratio [0.4, 2.5], side lengths [300, 6000], pixel count [409600, 2086876] |
| Audio | wav, mp3; at most 15MB; 2–15 seconds |
If you do not have a public URL, use POST /v1/media/uploads described in the reference upload guide to obtain a one-hour HTTPS URL, then register it. That upload utility supports common formats; it does not accept every format supported by the asset service.
curl -sS "${BASE_URL}/seedance/api/v3/assets?id=ll2_asset_example" \
-H "Authorization: Bearer ${API_KEY}"
Statuses are Processing, Active and Failed. Retrieve the asset until it is Active, then use asset://ll2_asset_example as the media URL. Retrieval refreshes the site's cached status; lists show the most recently queried status. Failures include Error.Code, such as FaceMismatch, DownloadFailed, TypeMismatch, FormatUnsupported or DurationTooLong.
List, update and delete
Lists only contain the current user's site resources. PageNumber starts at 1, PageSize is at most 100. Sort by CreateTime or UpdateTime; SortOrder is Asc or Desc, defaulting to descending.
{
"Filter":{"GroupIds":["ll2_group_example"],"GroupType":"AIGC","Statuses":["Active"]},
"PageNumber":1,
"PageSize":10,
"SortBy":"CreateTime",
"SortOrder":"Desc"
}
POST this JSON to /seedance/api/v3/assets/list. The response includes result.Items, TotalCount, PageNumber and PageSize. Group lists use /asset-groups/list and accept Name, GroupIds and GroupType filters. Statuses is only supported for assets.
Update an asset with PUT /assets and {"Id":"ll2_asset_example","Name":"New name"}. Update groups with PUT /asset-groups, supplying Id, Name and/or Description. Delete with DELETE on the corresponding address and {"Id":"..."}. Delete the group's assets before deleting the group. Deleted resources cannot be queried or referenced.
Real-person verification
curl -sS "${BASE_URL}/seedance/api/v3/real-person/sessions" \
-H "Authorization: Bearer ${API_KEY}" -H 'Content-Type: application/json' \
-d '{"Name":"Real-person character"}'
{"code":0,"message":"","result":{"Result":{"Id":"ll2_group_face","H5Link":"https://verification.example/session","SessionToken":"ll2_session_example","ExpiresAt":1800000000}}}
Parse the JSON and let the person open H5Link on a phone to complete the liveness check. The group ID is only a placeholder until verification succeeds; it cannot accept assets yet. SessionToken is private. Site sessions expire after 30 minutes, and successful outcome retrieval is idempotent.
Poll every 3–5 seconds, with an overall waiting deadline:
curl -sS "${BASE_URL}/seedance/api/v3/real-person/sessions/result" \
-H "Authorization: Bearer ${API_KEY}" -H 'Content-Type: application/json' \
-d '{"SessionToken":"ll2_session_example"}'
Pending: {"code":0,"result":{"Status":"Pending"}}. Do not immediately recreate the session. Success: {"code":0,"result":{"Result":{"GroupId":"ll2_group_face"}}}. You may then register media in that group. Images will undergo face-consistency checks.
Errors and troubleshooting
400: Unsupported settings, invalid media roles/counts, out-of-range duration or invalid pagination.401: Missing or invalid API key.403: Insufficient model permissions, or the resource's channel credential is unavailable.404: Resource missing, owned by another user, deleted, or verification session expired.409: Group not active, or assets remain in a group being deleted.429: Requests too frequent; increase your polling interval.502: The asset service is unavailable or returned an unrecognized response. Retry later; do not automatically repeat resource creation.
Both generation and asset operations use your site key. Task, asset and group IDs cannot be mixed with another service's identifiers. This protocol replaces the legacy examples.