Get API Key Get API
Docs

GPT-Image(1/1.5) Image Generation

- Asynchronous processing mode, returns task ID for subsequent queries

  • Supports text-to-image, image-to-image, and inpainting generation modes
  • Supports transparent backgrounds, multiple output formats, and quality tiers
  • Generate up to 4 images per request, with up to 15 reference images

Request example

curl --request POST \
  --url https://api.openveer.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-1-official",
    "prompt": "An ancient castle under a starry sky",
    "size": "1:1",
    "quality": "auto",
    "n": 1
  }'

Response example

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KXXXXXXXXXXXXXXX"
    }
  ]
}

Supported Models

Model Description Modes Image-to-Image Max Images Billing
gpt-image-1-official Stability-first, suitable for general image generation Text-to-Image / Image-to-Image Supported 4 Size x Quality
gpt-image-1.5-official New version, suitable for higher quality and complex editing Text-to-Image / Image-to-Image Supported 4 Size x Quality

Authorizations

Authorization string

All API requests require Bearer Token authentication

Get your API Key:

Visit the API Key management page to obtain your API Key

Add the following to your request headers:

Authorization: Bearer YOUR_API_KEY

Body

model string

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
nsfw_check boolean

Whether to run content moderation before submitting the image task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
prompt string

Text description for image generation, supports both Chinese and English

size string

Aspect ratio

Supported ratios:

  • 1:1 - Square (default)
  • 3:2 - Landscape
  • 2:3 - Portrait
n integer

Number of images to generate

Range: 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

quality string

Image quality

  • auto - Auto quality selection (default)
  • low - Faster, more economical
  • medium - Balance between quality and cost
  • high - Higher quality, higher cost
background string

Background mode

  • auto - Auto background (default)
  • opaque - Opaque background
  • transparent - Transparent background, recommended with png output format

Warning



background: transparent cannot be used with output_format: jpeg simultaneously

moderation string

Moderation level

  • auto - Default moderation level
  • low - More lenient moderation
output_format string

Output format

  • png - Default format, suitable for transparent backgrounds
  • jpeg - Smaller file size, suitable for general image output

Warning



background: transparent cannot be used with output_format: jpeg simultaneously

output_compression integer

Output compression level, range 0-100

  • Recommended only for jpeg
  • Not recommended for png
image_urls array

Array of reference image URLs, enables image-to-image mode when provided

* 1 image for single reference editing
* 2-15 images for multi-reference fusion editing
* More than 15 images will be rejected
* Must be publicly accessible, stable image URLs

Limit: Up to 15 reference images

mask_url string

Mask image URL for inpainting

  • Must be used together with image_urls
  • Will be submitted via the official editing API

Warning



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.

Ratio Actual Size Description
1:1 1024x1024 Square
2:3 1024x1536 Portrait
3:2 1536x1024 Landscape

Usage Examples

Text-to-Image (minimal)

{
  "model": "gpt-image-1-official",
  "prompt": "An ancient castle under a starry sky"
}

Text-to-Image (full parameters)

{
  "model": "gpt-image-1-official",
  "prompt": "A flat icon of a glass bottle with no background",
  "size": "2:3",
  "quality": "high",
  "background": "transparent",
  "moderation": "low",
  "output_format": "png",
  "n": 1
}

Image-to-Image (single reference)

{
  "model": "gpt-image-1.5-official",
  "prompt": "Convert the reference image to illustration style, preserving the main outline",
  "size": "1:1",
  "quality": "auto",
  "image_urls": [
    "https://your-cdn.com/input.png"
  ],
  "n": 1
}

Image-to-Image (multi-reference fusion)

{
  "model": "gpt-image-1.5-official",
  "prompt": "Merge two reference images into an illustration poster, preserving the main outlines",
  "size": "1:1",
  "quality": "auto",
  "background": "transparent",
  "image_urls": [
    "https://your-cdn.com/input-a.png",
    "https://your-cdn.com/input-b.png"
  ],
  "moderation": "low",
  "output_format": "png",
  "n": 1
}

Multiple images (n > 1)

{
  "model": "gpt-image-1-official",
  "prompt": "Four minimalist poster variations of a red fox",
  "size": "1:1",
  "quality": "low",
  "output_format": "png",
  "n": 4
}

Response

code integer

Response status code

data array
Response data array
status string

Task status

  * submitted - Submitted
task_id string

Unique task identifier

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

This documentation is built and hosted on Mintlify, a developer documentation platform.