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-seedream-5-0-lite",
    "prompt": "A golden retriever playing in a garden, sunny day, high-definition photography style",
    "size": "16:9",
    "resolution": "2K",
    "n": 1
  }'
{
  "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-seedream-5-0-lite",
    "prompt": "A golden retriever playing in a garden, sunny day, high-definition photography style",
    "size": "16:9",
    "resolution": "2K",
    "n": 1
  }'
{
  "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-seedream-5-0-lite"
required
Image generation model nameExample: "doubao-seedream-5-0-lite"
prompt
string
required
Text description for image generation
size
string
default:"1:1"
Image aspect ratioSupported aspect ratios:
  • 1:1 - Square (default)
  • 4:3 - Landscape 4:3
  • 3:4 - Portrait 3:4
  • 16:9 - Landscape widescreen
  • 9:16 - Portrait vertical
  • 3:2 - Landscape 3:2
  • 2:3 - Portrait 2:3
  • 21:9 - Ultra-wide
  • auto - Auto-match reference image aspect ratio (requires image_urls)
Note: Seedream-5.0-Lite does not support 9:21 ratio
resolution
string
default:"2K"
Image resolutionSupported resolutions:
  • 2K - Standard resolution (default)
  • 3K - High definition
Note: Seedream-5.0-Lite only supports 2K and 3K resolutions, 1K and 4K are not supported
Resolution reference sizes:
Resolution1:1 Size16:9 Size
2K2048x20482848x1600
3K3072x30724096x2304
n
integer
Number of images to generateRange: 1-4Default: 1Note:
  • When n > 1, sequential image generation mode is automatically enabled
  • 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 generationTwo formats are supported:1. Full image URL
  • Publicly accessible image URL (http:// or https://)
  • Example: https://example.com/image.jpg
2. Base64 encoded format
  • Must use the full Data URI format
  • Format: data:image/{format};base64,{base64data}
  • Supported image formats: jpeg, png
  • Example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...
  • ⚠️ Note: Must include the data:image/jpeg;base64, prefix
Limitations:
  • Image formats: jpeg, png
  • Aspect ratio (width/height) range: [1/3, 3]
  • Width and height (px) > 14
  • Size: not exceeding 10MB per image
  • Total pixels: not exceeding 6000×6000 px
output_format
string
default:"jpeg"
Output image format
  • jpeg: JPEG format (default)
  • png: PNG format, suitable for transparent backgrounds and similar use cases
Note: The output_format parameter is exclusive to Seedream-5.0-Lite. Other image models will ignore this parameter.
sequential_image_generation
string
default:"disabled"
Sequential image generation modeControls whether to generate multiple images:
  • disabled: Disable sequential mode (default)
  • auto: Enable sequential mode, can generate multiple images
Usage Notes:
  • When n > 1, it will automatically be set to auto
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
Example:
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
  "max_images": 4
}
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