Generate video from media URLs
Submit HTTPS media URLs to create a video task. Token168 prepares the assets automatically, then uses the existing video generation workflow.
Before you start Use a generation API key with access to the selected model and group and sufficient quota. For requests with reference media, create and enable an asset key in Console under the same account first. Do not send asset AK/SK or a group_id in this request; the platform reuses the existing enabled asset key and prepares the default asset group.
This first-frame example uses Seedance 2.0. Replace the model with an available supported model and replace example.com with your own accessible HTTPS image. duration, resolution, ratio and generate_audio depend on the model.
POST /v1/videos/urlcurl https://www.token168.cc/v1/videos/url \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "Move the clouds slowly while keeping the subject stable."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/your-reference.png"
},
"role": "first_frame"
}
],
"duration": 4,
"resolution": "720p",
"ratio": "adaptive",
"generate_audio": false
}'Generate Seedance video from text
For a supported Dreamina Seedance model, send text items in content or a non-empty prompt. Leave out media fields and moderation_strategy. Text-only requests use the generation API key and regular video billing. An asset key is required only for requests with reference media. If submission fails before you receive a task_id, read the error in the create response.
POST /v1/videos/urlcurl https://www.token168.cc/v1/videos/url \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-5-260628",
"content": [
{
"type": "text",
"text": "Clouds drift slowly above a quiet lake."
}
],
"duration": 4,
"resolution": "480p",
"ratio": "16:9",
"generate_audio": false
}'Edit a video with Seedance 2.5
If Seedance 2.5 video editing is enabled for your account, use a 4–30 second HTTPS reference video with edit and ratio=adaptive. You can omit duration or set it to -1 to follow the source video's duration.
POST /v1/videos/urlcurl https://www.token168.cc/v1/videos/url \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-5-260628",
"content": [
{
"type": "text",
"text": "Change the bicycle from blue to red."
},
{
"type": "video_url",
"video_url": {
"url": "https://example.com/your-reference.mp4"
},
"role": "reference_video"
}
],
"omni_reference_task_type": "edit",
"duration": -1,
"ratio": "adaptive",
"resolution": "480p",
"generate_audio": false
}'HTTP 200
HTTP 200 with queued means the task has been accepted, not completed. Save the returned task_id; the id field contains the same value. IDs and timestamps below are illustrative.
JSON{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "dreamina-seedance-2-0-260128",
"status": "queued",
"created_at": 1794096000,
"progress": 0
}Supported models and availability
This entry supports text-to-video for eligible Dreamina Seedance models and automatic asset preparation for enabled image-to-video models and other supported reference requests. The first-frame examples have been verified with Seedance 2.0 and Mini; model visibility alone does not prove URL-entry support. Confirm the exact model and group for your account. Availability depends on the target deployment; HTTP 503 with url_video_disabled means that entry is not enabled there.
Media fields
For requests with reference media, provide at least one media URL. The collector reads image, input_reference, images[], and image_url/video_url/audio_url objects inside content[] or metadata.content[]. Recognition does not imply that every model supports every combination. Prefer top-level content; if metadata.content is also sent, both must match. private_data is rejected. moderation_strategy defaults to Default; Skip remains subject to the existing policy and does not guarantee acceptance.
Input limits
Send application/json with a body up to 1 MiB. Use HTTPS URLs of at most 16384 characters, without embedded user credentials or fragments. Up to 20 distinct URL/media-type resources are collected; model limits may be stricter. Sources must remain accessible throughout preparation. Signed URLs need enough remaining validity.
Choose an entry
| API | Use |
|---|---|
| POST /v1/videos/url | Create a Seedance video from text, or use HTTPS media URLs for automatic asset preparation. |
| POST /v1/videos · POST /v1/video/generations | Keep the existing model-specific request format; prepare asset references when required. |
| POST /api/v3/contents/generations/tasks | Use the separate Seedance native request format and native task queries. |
Billing, reuse and retries
Preparation failures do not reserve video quota. Once assets are ready, the selected model and group use the existing reservation, settlement and refund rules. Asset reuse does not deduplicate video tasks: submitting the same URL again can create another billable task, even with the same client idempotency key. After receiving a task_id, query it instead of resubmitting. If acceptance is unknown after a timeout, check request records first. Internal asset caching is not a media-lifetime or storage guarantee.
Query the same task_id until completed or failed. queued and in_progress can include asset preparation. No fixed completion time is promised. The public query keeps its existing fields; internal preparation stages are not public response fields.
GET /v1/videos/{task_id}curl https://www.token168.cc/v1/videos/task_example \
-H "Authorization: Bearer $TOKEN168_API_KEY"Errors and recovery
HTTP 400 with error.type=invalid_request indicates invalid URLs, media fields or resource counts; invalid_channel means this request cannot use the entry with the selected model. HTTP 415 has a string error when Content-Type is not JSON. Normalization errors can also use a string error. Read the actual response shape rather than assuming every error has error.code.
If HTTP 400 says that the selected channel cannot use a fixed aspect ratio for first-frame or first-and-last-frame video, set ratio=adaptive only if you want the video to follow the first image. Use a resolution tier such as 720p instead of fixed pixel dimensions.
HTTP 503 with error.type=material_preflight_failed means the asset preparation preflight could not be completed: check the enabled asset key, then retain the request ID for support. error.type=task_persist_failed indicates persistence failure. url_video_disabled uses error.code. After acceptance, preparation or generation failures appear on the original task. Do not blindly retry POST requests.
Download only after status is completed, using your generation API key. Save the video promptly.
GET /v1/videos/{task_id}/contentcurl https://www.token168.cc/v1/videos/task_example/content \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
--output video.mp4