Skip to content
הדף עדיין אינו זמין בשפה שלכם, ולכן הוא מוצג באנגלית.

GPT-Image-1.5 Image Generation

Asynchronous processing mode, returns task ID for subsequent queries

כל התיעוד
POST/v1/images/generations
  • 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

דוגמאות לבקשות

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

Supported Models

ModelDescriptionModesImage-to-ImageMax ImagesBilling
gpt-image-1.5-officialNew version, suitable for higher quality and complex editingText-to-Image / Image-to-ImageSupported4Size x Quality

Authorizations

Authorizationstringrequired

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:

text
Authorization: Bearer YOUR_API_KEY

Body

modelstringrequired

Model name

  • gpt-image-1.5-official - New version, suitable for higher quality and complex editing
nsfw_checkbooleandefault: false

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)
promptstringrequired

Text description for image generation, supports both Chinese and English

sizestringdefault: 1:1

Aspect ratio

Supported ratios:

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

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

qualitystringdefault: auto

Image quality

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

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

moderationstringdefault: auto

Moderation level

  • auto - Default moderation level
  • low - More lenient moderation
output_formatstringdefault: png

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_compressioninteger

Output compression level, range 0-100

  • Recommended only for jpeg
  • Not recommended for png
image_urlsarray

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

Details

  • 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_urlstring

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.

RatioActual SizeDescription
1:11024x1024Square
2:31024x1536Portrait
3:21536x1024Landscape

Usage Examples

Text-to-Image (minimal)

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

Text-to-Image (full parameters)

json
{
  "model": "gpt-image-1.5-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)

json
{
  "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)

json
{
  "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)

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

Response

codeinteger

Response status code

dataarray

Response data array

Properties

statusstring

Task status

  • submitted - Submitted
task_idstring

Unique task identifier

Notes

  1. Asynchronous processing: After submission, a task_id is returned. Poll /v1/tasks/{task_id} to get results
  2. Image URL requirements: For image-to-image, use publicly accessible and stable image URLs
  3. Billing: Charged per successfully generated image; no charge for failures

תגובות

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

מצאתם בעיה בתיעוד? אפשר לשלוח אימייל לכתובת support@apisea.ai.