Image Generation
Create image tasks with the Seedance 2.1 public API.
Image generation
Use POST /v1/images/generations to create an image task. The API returns a task id; use Task status to get the final image URL.
Endpoint
POST /v1/images/generationsRequired headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonRequest body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | What you want to generate. Be specific about subject, style, lighting, and composition. |
model | string | No | Image model. Defaults to gpt-image-2-all. You can also use gpt-image-1.5-all. |
provider | string | No | Image provider. Defaults to the Seedance 2.1 image service. |
n | number | No | Number of images. Allowed values: 1, 2, or 4. Defaults to 1. |
size | string | No | 1K aspect ratio or pixel size. Examples: 1:1, 4:5, 16:9, 9:16, 1024x1024. |
resolution | string | No | Use 1k for standard output or 4k for high-resolution output. Defaults to 1k. |
imageResolution | string | No | Same meaning as resolution; useful if your client already uses this field name. |
imageSizePreset | string | No | Aspect ratio preset, especially useful for 4K requests. |
Size and resolution
For 1K images, common presets are:
| Preset | Output size |
|---|---|
1:1 | 1024x1024 |
4:5 | 1024x1280 |
16:9 | 1536x864 |
9:16 | 864x1536 |
For 4K images, set resolution to 4k and choose a supported preset, such as 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, or 9:21.
Credits
- 1K image: 2 credits per image.
- 4K image: 4 credits per image.
- When
nis greater than1, total credits are charged per image.
Example: square 1K image
curl https://sseedance.com/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-all",
"prompt": "A premium skincare bottle on a warm beige pedestal, studio light, realistic shadows",
"size": "1:1",
"n": 1
}'Example: 16:9 image
curl https://sseedance.com/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-all",
"prompt": "A cinematic mountain cabin at sunrise, wide landscape composition",
"size": "16:9",
"n": 1
}'Example: 4K image
curl https://sseedance.com/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-all",
"prompt": "A luxury watch macro photo with crisp metal details and dramatic reflections",
"resolution": "4k",
"imageSizePreset": "1:1",
"n": 1
}'Response
The response is a task, not the final image file.
{
"id": "task_id",
"object": "image.generation.task",
"status": "pending",
"data": [
{
"id": "task_id",
"mediaType": "image",
"status": "pending",
"imageUrls": []
}
]
}Use GET /v1/tasks/{id} to check the final imageUrls.