Docs/Video/Text to Image
Seedance 2 Image To Video· Text to Image
Text to Image
POST
https://api.sozdai.ai/v1/media/generationsPricing Model
480p 11,05 ₽/s · 720p 22,1 ₽/s · 1080p 55,25 ₽/s × 4–15s
Execution Flow
Asynchronous submission model. Submitting requests queues background workers.
#Submit a task
Media generation is asynchronous: you get a task id immediately, without waiting.
bash
curl https://api.sozdai.ai/v1/media/generations \
-H "Authorization: Bearer $CORRY_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "seedance-2-image-to-video", "prompt": "a cute robot mascot, flat vector logo" }'
# → { "id": "cmus7q0x9000108l3f5g2abcd", "status": "queued" }#Request parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Text prompt describing the video (3–20000 chars). |
first_frame_url | string | No | — | First-frame image (URL or asset://id). |
last_frame_url | string | No | — | Last-frame image; pair with first_frame_url for first&last-frame mode. |
resolution | string | No | 720p | Video resolution. Higher resolution costs more: 720p ≈ 2×, 1080p ≈ 5× of 480p — see the pricing page. (4K not supported.) Options: 480p, 720p, 1080p |
aspect_ratio | string | No | 16:9 | Aspect ratio. Options: 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, adaptive |
duration | number | No | 5 | Video length in seconds (4–15). Billed per second × resolution. |
generate_audio | boolean | No | true | Generate an audio track (default on). |
web_search | boolean | No | — | Use online search to enrich generation. |
nsfw_checker | boolean | No | false | Content filter; false disables filtering. |
callback_url | string | No | — | Optional public http(s) URL. We POST the task result here the moment generation finishes (success or failure). |
#Poll for the result
Generation runs asynchronously — the submit call returns immediately with a task id. Poll this endpoint with that id every few seconds until status becomes succeeded (result ready) or a terminal error (failed / timeout).
GET
https://api.sozdai.ai/v1/media/generations/{id}bash
# take the id from the submit response, then poll every ~3s
curl https://api.sozdai.ai/v1/media/generations/cmus7q0x9000108l3f5g2abcd \
-H "Authorization: Bearer $CORRY_KEY"
# repeat until "status" is "succeeded" (or "failed" / "timeout")#Response example
On submit
json
{
"id": "cmus7q0x9000108l3f5g2abcd",
"status": "queued",
"type": "video",
"model": "seedance-2-image-to-video"
}On success (after polling)
json
{
"id": "cmus7q0x9000108l3f5g2abcd",
"status": "succeeded",
"type": "video",
"model": "seedance-2-image-to-video",
"result": { "urls": ["https://cdn.sozdai.ai/video/1782537315223-b49c0c1b771f.mp4"] },
"cost": "1.6000",
"currency": "USD"
}Response fields
| Field | Type | Description |
|---|---|---|
status | string | Task status: queued / submitted / succeeded / failed / timeout. |
type | string | Media type: image / video / music. |
model | string | The model you requested. |
result | object | Present on success. result.urls is an array of permanent file URLs. |
error | string | Error message, present when the task failed. |
cost | string | Amount charged for this task — a USD string (e.g. "0.1200"). See the currency field. |
currency | string | Currency of cost — always "USD". |