Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Options: gpt_image_1_5
prompt string required
Text description of the desired image(s), maximum length 32000 characters
size string
Size of the generated image
Options: 1024x1024, 1024x1536, 1536x1024, auto
Default: auto
n integer
Number of images to generate
Range: 1 - 4
Default: 1
quality string
Image quality level
Options: low, medium, high, auto
Default: auto
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
Response Format
error object
Error information, only present when status is failed
code
stringError code
message
stringDetailed error message
output array
Generation results, only present when status is completed
content
arrayList of generated content
type
stringResource type, e.g.,
imageurl
stringGenerated content URL
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information
Error Codes
| Error Code | Description |
|---|---|
| 014002095 | Internal generation error |
| 014002096 | Result parsing error |
| 014002097 | HTTP error response |
| 014002099 | Sync generation error |