Skip to main content
POST

Supported Models

Authorizations

string
required
All API requests require Bearer Token authenticationGet your API Key:Visit the API Key management page to obtain your API KeyAdd the following to your request headers:

Body

string
required
Model name
  • gpt-image-1-official - Stability-first, suitable for general image generation
  • gpt-image-1.5-official - New version, suitable for higher quality and complex editing
string
required
Text description for image generation, supports both Chinese and English
string
default:"1:1"
Aspect ratioSupported ratios:
  • 1:1 - Square (default)
  • 3:2 - Landscape
  • 2:3 - Portrait
integer
default:"1"
Number of images to generateRange: 1-4
  • Values ≤ 0 will be treated as 1
  • Values > 4 will be treated as 4
Warning: Must be a plain number (e.g. 1), do not add quotes, otherwise it will cause an error
string
default:"auto"
Image quality
  • auto - Auto quality selection (default)
  • low - Faster, more economical
  • medium - Balance between quality and cost
  • high - Higher quality, higher cost
string
default:"auto"
Background mode
  • auto - Auto background (default)
  • opaque - Opaque background
  • transparent - Transparent background, recommended with png output format
background: transparent cannot be used with output_format: jpeg simultaneously
string
default:"auto"
Moderation level
  • auto - Default moderation level
  • low - More lenient moderation
string
default:"png"
Output format
  • png - Default format, suitable for transparent backgrounds
  • jpeg - Smaller file size, suitable for general image output
background: transparent cannot be used with output_format: jpeg simultaneously
integer
Output compression level, range 0-100
  • Recommended only for jpeg
  • Not recommended for png
array
Array of reference image URLs, enables image-to-image mode when providedLimit: Up to 15 reference images
string
Mask image URL for inpainting
  • Must be used together with image_urls
  • Will be submitted via the official editing API
  1. Before uploading the mask image, please confirm that the image Alpha channel is “Yes”.
  2. The mask image size must match the first reference image.

Size Reference

Aspect ratios are used externally; the system automatically maps them to official dimensions internally.

Usage Examples

Text-to-Image (minimal)
Text-to-Image (full parameters)
Image-to-Image (single reference)
Image-to-Image (multi-reference fusion)
Multiple images (n > 1)

Response

integer
Response status code
array
Response data array

Notes

  1. Asynchronous processing: After submission, a task_id is returned. Poll /v1/tasks/{task_id} to get results
  2. Model selection: Use gpt-image-1-official for general image generation; use gpt-image-1.5-official for high-quality editing and complex image-to-image tasks
  3. Image URL requirements: For image-to-image, use publicly accessible and stable image URLs
  4. Billing: Charged per successfully generated image; no charge for failures