On this page
Seedance 2.0 API
Create Seedance 2.0 text-to-video and image-to-video tasks through one asynchronous API. This first public version does not expose reference-to-video or video editing.
REST API · v1 · Async tasks
Make your first request
Choose text-to-video or image-to-video, use a unique idempotency key, then poll the returned task ID.
- 1
Create an API key
Generate a key from your imya account settings.
- 2
Choose a mode
Use text-to-video or image-to-video only.
- 3
Retrieve the result
Poll the task ID until it succeeds or fails.
Authentication and idempotency
Send your API key as a Bearer token. Every generation POST also requires a unique Idempotency-Key so safe retries cannot create a second charge.
Authorization: Bearer YOUR_IMYA_API_KEY
Content-Type: application/json
Idempotency-Key: YOUR_UNIQUE_REQUEST_KEYCreate a video generation
Creates an asynchronous Seedance task and returns the live credits_reserved value calculated for this request.
/v1/videos/generations# Text to video
curl https://imya.ai/v1/videos/generations \
-H "Authorization: Bearer YOUR_IMYA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: seedance-t2v-order-001" \
-d '{
"model": "seedance-2.0",
"mode": "text-to-video",
"prompt": "A coastal train passing cliffs at sunrise",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"generate_audio": true
}'
# Image to video
curl https://imya.ai/v1/videos/generations \
-H "Authorization: Bearer YOUR_IMYA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: seedance-i2v-order-001" \
-d '{
"model": "seedance-2.0",
"mode": "image-to-video",
"prompt": "Wind moves the fabric as the camera arcs right",
"image_url": "https://cdn.example.com/first-frame.jpg",
"duration": 8,
"resolution": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}'Retrieve a task
Returns the latest task state, final credit usage, generated MP4, or a sanitized error. Poll no faster than every 5 seconds. Video result URLs may be temporary, so download them promptly; Production Beta does not yet guarantee 7/30-day API video retention.
/v1/tasks/{task_id}curl https://imya.ai/v1/tasks/task_0123456789abcdef0123456789abcdef \
-H "Authorization: Bearer YOUR_IMYA_API_KEY"Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Use seedance-2.0. |
| mode | string | Yes | text-to-video or image-to-video. |
| prompt | string | Yes | Generation instructions, 3 to 20,000 characters. |
| image_url | string | Conditional | Public HTTPS first frame. Required only for image-to-video. |
| last_frame_url | string | No | Optional public HTTPS last frame for image-to-video. |
| duration | number | No | Integer from 4 to 15 seconds. Default is 5. |
| resolution | string | No | 480p, 720p, or 1080p. Default is 720p. |
| aspect_ratio | string | No | 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, or adaptive. |
| generate_audio | boolean | No | Generate audio. Default is true. |
| web_search | boolean | No | Text-to-video only. Default is false. |
Responses
{
"id": "task_0123456789abcdef0123456789abcdef",
"status": "pending",
"model": "seedance-2.0",
"credits_reserved": 625
}{
"id": "task_0123456789abcdef0123456789abcdef",
"status": "succeeded",
"model": "seedance-2.0",
"credits_used": 625,
"data": [
{
"url": "https://media.example.com/generated/example.mp4"
}
]
}Live credit billing
The server calculates credits_reserved from mode, resolution, duration, and the API key owner’s current plan. Audio and web-search switches do not change the current Imya credit calculation. The numbers in the response examples illustrate the response shape only; always use the value returned for that request and never cache a Seedance price in your client.
Task status
pendingThe task was accepted and is waiting to start.
processingThe model is generating the video.
succeededGeneration finished and data contains the MP4.
failedGeneration failed. Read the sanitized error object.
Errors
400Missing Idempotency-Key or malformed JSON.
401Missing or invalid API key.
402The account does not have enough credits.
403The API account is disabled.
409The idempotency key was reused with a different body.
413The request body exceeds 64 KiB.
422Invalid mode, prompt, image, duration, resolution, or aspect ratio.
429Rate or concurrent-task limit reached.
5xxThe request could not be completed or submitted.
Want to test Seedance before integrating?
Open the hosted Seedance 2.0 tool to compare text-to-video and image-to-video inputs.
Try Seedance 2.0 online