Skip to main content
POST

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json
prompt
string
required

Image description text, supports Chinese and English

Required string length: 1 - 1500
Example:

"A girl in futuristic style"

subject_reference_images
string[]
required

Reference image URLs for image-to-image generation. Supports public HTTPS URLs or Base64 Data URLs

Required array length: 1 - 10 elements

Image URL or Base64 Data URL (data:image/jpeg;base64,...). Image requirements: JPG/JPEG/PNG format, <10MB, best with single front-facing portrait photo

Example:
aspect_ratio
enum<string>
default:1:1

Image aspect ratio. If both aspect_ratio and width/height are provided, aspect_ratio takes priority

Available options:
1:1,
16:9,
4:3,
3:2,
2:3,
3:4,
9:16,
21:9
Example:

"1:1"

width
integer

Image width in pixels (must be used with height). Must be divisible by 8. If aspect_ratio is provided, width/height will be ignored

Required range: 512 <= x <= 2048
Example:

1024

height
integer

Image height in pixels (must be used with width). Must be divisible by 8. If aspect_ratio is provided, width/height will be ignored

Required range: 512 <= x <= 2048
Example:

1024

seed
integer

Random seed for reproducible results. Use the same seed with same parameters to generate identical images

Required range: x >= 0
Example:

42

n
integer
default:1

Number of images to generate per request

Required range: 1 <= x <= 9
Example:

1

prompt_optimizer
boolean
default:false

Enable automatic prompt optimization to improve generation quality

Example:

false

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required

Detailed data about the submitted asynchronous task.