Skip to main content
POST
  • Unified image generation API
  • Select the gpt-image-2-vip model via the model parameter
  • Parameters are the same as gpt-image-2
  • Supports text-to-image, single-reference, and multi-reference image generation
  • Async task management with task ID based result lookup
Important Change: For better performance and cost control, base64 image data is no longer supported in image_urls or reference_images. Please use the Upload Image API first to upload images and obtain a URL.

Authorizations

string
required
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:

Body

string
default:"gpt-image-2-vip"
required
Image generation model nameExample: "gpt-image-2-vip"
string
required
Text prompt for image generationMaximum 32,000 characters for GPT image models
string
default:"1:1"
Output image aspect ratioPreset ratios:1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 21:9, 9:21You may also pass any ratio in width:height format, such as 1:3 or 7:4, subject to the custom-size limits below.You can pass auto to let the upstream provider choose the dimensions, but the final aspect ratio and pixel dimensions are not guaranteed.
string
default:"1k"
Output resolution tierSupported values: 1k, 2k, 4k

Custom Resolutions

In addition to the presets above, pass any ratio in width:height format through size. The service calculates pixel dimensions from the selected resolution tier. The resulting dimensions must meet all of these limits:
  • Both sides must be multiples of 16 pixels
  • The long edge can be at most 3,840 pixels (4K)
  • The aspect ratio can be at most 3:1
  • Total pixel count must be between 655,360 and 8,294,400
Examples:
  • size: "1:3" with resolution: "2k"1024x3072
  • size: "7:4" with resolution: "1k"1344x768
string
default:"medium"
Image quality
  • low — fast and economical, suitable for drafts/previews
  • medium — balanced speed and quality
  • high — maximum detail, suitable for final outputs
integer
default:1
Number of images to generateDefault: 1
string
default:"url"
Response formatThe API returns image URLs, so url is the recommended value
string[]
Reference image URLs for image-to-image generation⚠️ URL format only (base64 no longer supported)
  • Publicly accessible URLs (http:// or https://)
  • You can use the Upload Image API to upload local files and get URLs
  • Supports single-image and multi-image reference
string[]
Backward-compatible reference image fieldToAPIs automatically normalizes it to reference_images
string
ToAPIs standardized task-completion callback. Configure the Token HTTPS URL and signing secret first; request URLs must be same-origin. See Task Webhooks.

Response

string
Unique task identifier for status queries
string
Object type, always generation.task
string
Model name used
string
Task status
  • queued
  • in_progress
  • completed
  • failed
integer
Task progress percentage (0-100)
integer
Task creation timestamp (Unix timestamp)