Skip to main content
POST
Image Generation

Authorizations

Authorization
string
header
required

Pass Authorization: Bearer <token> in the request header.

Headers

Content-Type
enum<string>
default:application/json
required

Media type of the request body. Set to application/json to ensure the request data is in JSON format.

Available options:
application/json

Body

application/json
model
enum<string>
required

Model name. Available value: image-01.

Available options:
image-01
prompt
string
required

Text description of the image, up to 1500 characters.

style
object

Style settings. Only takes effect when model is image-01-live.

aspect_ratio
enum<string>

Image aspect ratio. Defaults to 1:1. Available values:

  • 1:1 (1024x1024)
  • 16:9 (1280x720)
  • 4:3 (1152x864)
  • 3:2 (1248x832)
  • 2:3 (832x1248)
  • 3:4 (864x1152)
  • 9:16 (720x1280)
  • 21:9 (1344x576) (only for image-01)
Available options:
1:1,
16:9,
4:3,
3:2,
2:3,
3:4,
9:16,
21:9
width
integer

Width of the generated image in pixels. Only takes effect when model is image-01. Note: width and height must be set together, value range [512, 2048], and must be a multiple of 8. If set together with aspect_ratio, aspect_ratio takes precedence.

height
integer

Height of the generated image in pixels. Only takes effect when model is image-01. Note: width and height must be set together, value range [512, 2048], and must be a multiple of 8. If set together with aspect_ratio, aspect_ratio takes precedence.

response_format
enum<string>
default:url

Format of the returned image. Defaults to url. Available values: url, base64. ⚠️ Note: URLs are valid for 24 hours.

Available options:
url,
base64
seed
integer<int64>

Random seed. Using the same seed and parameters can generate images with similar content for reproducible results. If not provided, a random seed is generated for each of the n images.

n
integer
default:1

Number of images to generate per request, range [1, 9]. Defaults to 1.

Required range: 1 <= x <= 9
prompt_optimizer
boolean
default:false

Whether to enable automatic prompt optimization. Defaults to false.

aigc_watermark
boolean

Whether to add a watermark to the generated image. Defaults to false.

Response

200 - application/json
data
object
metadata
object

Number of images not returned due to content safety check failures.

id
string

ID of the generation task, used for subsequent task status queries.

base_resp
object