Skip to main content
POST
https://api.apimart.ai
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-4-5",
    "prompt": "A cute panda playing in a bamboo forest",
    "size": "1:1",
    "n": 1,
    "image_urls": [
      "https://cdn.apimart.ai/doc/1761215838466614297_9852.png"
    ]
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-4-5",
    "prompt": "A cute panda playing in a bamboo forest",
    "size": "1:1",
    "n": 1,
    "image_urls": [
      "https://cdn.apimart.ai/doc/1761215838466614297_9852.png"
    ]
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}

Authorizations

Authorization
string
required
All API endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"doubao-seedance-4-5"
required
Image generation model nameExample: "doubao-seedance-4-5"
prompt
string
required
Text description for image generation
size
string
Image generation sizeSupported aspect ratios:
  • 1:1
  • 4:3
  • 3:4
  • 16:9
  • 9:16
  • 3:2
  • 2:3
  • 21:9
Supported resolutions:
  • 2k
  • 4k
n
integer
Number of images to generateRange: 1-15 (minimum 1, maximum 15)Default: 1Note:
  • The actual number of images that can be generated is affected by both this parameter and the number of input reference images. The total of reference images + generated images must be ≤ 15
  • Must enter a plain number (e.g., 1), do not use quotes or it will cause an error
Charges will be pre-deducted based on the number
image_urls
array
Reference image URL list for image-to-image or image editing
  • Maximum 10 images
  • Image formats: jpeg, png
  • Aspect ratio (width/height) range: [1/3, 3]
  • Width and height (px) > 14
  • Size: not exceeding 10MB
  • Total pixels: not exceeding 6000×6000 px
optimize_prompt_options.mode
string
default:"standard"
Prompt optimization mode
  • standard: Standard mode, generates higher quality content with longer processing time
  • fast: Fast mode, generates content in shorter time with regular quality
Default: standard
sequential_image_generation
string
default:"disabled"
Sequential image generation mode (Doubao-specific feature)Controls whether to generate multiple images:
  • disabled: Disable sequential mode, generates only 1 image even with multiple reference images (default)
  • auto: Enable sequential mode, can generate multiple images
Usage Notes:
  • ✅ Must provide image_urls - at least 1 reference image required
  • ✅ Set n: 3 or use sequential_image_generation: "auto" + max_images: 3
  • ✅ This will generate 3 different images based on reference images
  • ⚠️ When n > 1, it will automatically be set to auto
Limitations:
  • Pure text-to-image (without image_urls) cannot generate multiple images - this is a Doubao API limitation
sequential_image_generation_options
object
Sequential image generation optionsAvailable when sequential_image_generation is set to autoProperties:
  • max_images (integer): Specify the number of images to generate, Range: 1-15
Example:
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
  "max_images": 3
}
watermark
boolean
default:"false"
Whether to add a watermark to the generated image
  • true: Add watermark
  • false: No watermark (default)

Response

code
integer
Response status code
data
array
Response data array