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_edit
prompt string required
Text description of the desired edit, maximum length 32000 characters
images string | array required
Input image reference(s) to edit. Provide a public URL, a data URL, or an equivalent image reference accepted by the configured provider. A single string or an array of image references is accepted.
The runtime forwards this field as multipart image parts to the upstream image-edit API.
mask string | object
Optional mask image used to limit the edit area. Provide a URL, data URL, or provider-compatible image reference.
size string
Size of the generated image
Options: 1024x1024, 1024x1536, 1536x1024, auto
The value is forwarded to the provider. If omitted, the provider default is used.
n integer
Number of images to generate
Range: 1 - 4
Default: 1
quality string
Image quality level
Options: low, medium, high, auto
Default: auto
The value is forwarded to the provider. If omitted, the provider default is used.
background string
Optional background handling mode. The value is forwarded to the provider.
input_fidelity string
Optional input-image fidelity mode. The value is forwarded to the provider.
output_format string
Optional output image format. The value is forwarded to the provider.
output_compression integer
Optional output compression level. The value is forwarded to the provider.
moderation string
Optional content-moderation mode. The value is forwarded to the provider.
user string
Optional end-user identifier for abuse monitoring and tracing.
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 resource content
type
stringResource type
Value:
image|videourl
stringProcessed resource URL
jobId
stringRemote task ID
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information