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/generations

Required headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request body

FieldTypeRequiredDescription
promptstringYesWhat you want to generate. Be specific about subject, style, lighting, and composition.
modelstringNoImage model. Defaults to gpt-image-2-all. You can also use gpt-image-1.5-all.
providerstringNoImage provider. Defaults to the Seedance 2.1 image service.
nnumberNoNumber of images. Allowed values: 1, 2, or 4. Defaults to 1.
sizestringNo1K aspect ratio or pixel size. Examples: 1:1, 4:5, 16:9, 9:16, 1024x1024.
resolutionstringNoUse 1k for standard output or 4k for high-resolution output. Defaults to 1k.
imageResolutionstringNoSame meaning as resolution; useful if your client already uses this field name.
imageSizePresetstringNoAspect ratio preset, especially useful for 4K requests.

Size and resolution

For 1K images, common presets are:

PresetOutput size
1:11024x1024
4:51024x1280
16:91536x864
9:16864x1536

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 n is greater than 1, 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.

Image Generation