Skip to main content
POST

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json

Generate one or more images from a text prompt.

prompt
string
required

Text description of the image to generate.

Minimum string length: 1
Example:

"A collage of London landmarks in a stenciled street-art style"

n
integer
default:1

Number of images to generate.

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

1

aspect_ratio
enum<string>
default:auto

Aspect ratio of the generated image. auto lets the model choose a ratio that fits the prompt.

Available options:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3,
2:1,
1:2,
19.5:9,
9:19.5,
20:9,
9:20,
21:9,
5:2,
auto
Example:

"16:9"

resolution
enum<string>
default:1k

Output resolution.

Available options:
1k,
2k
Example:

"2k"

quality
enum<string>
default:medium

Generation quality.

Available options:
low,
medium
Example:

"medium"

response_format
enum<string>
default:url

How images are returned: a temporary URL, or base64 in the task result.

Available options:
url,
b64_json
Example:

"url"

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.