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

GPT-Image-2.5 Ext Image Generation

Use gpt-image-2.5-ext and select Flare or Sunburst with version

כל התיעוד
POST/v1/images/generations
  • Asynchronous processing: query results using the task ID after submission
  • Supports text-to-image and image-to-image with up to 16 reference images
  • Supports 10 aspect ratios and auto, with 1K / 2K / 4K resolution tiers
  • Generate 1–4 images per request, billed by version, resolution, and the number of images actually delivered

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

# Create once per new generation operation; keep the original value when retrying.
IDEMPOTENCY_KEY="$(uuidgen)"

curl --request POST \
  --url https://api.apisea.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-APISea-Response-Version: 2026-07-27' \
  --header "Idempotency-Key: ${IDEMPOTENCY_KEY}" \
  --data '{
    "model": "gpt-image-2.5-ext",
    "version": "flare",
    "prompt": "A cozy reading nook beside a window on a rainy day, a warm table lamp, cinematic lighting",
    "size": "1:1",
    "resolution": "1K",
    "n": 1
  }'

Authentication and headers

Authorizationstringrequired

The generation and task query endpoints use a platform API Key for Bearer Token authentication. Get a key from the API Key management page.

text
Authorization: Bearer YOUR_API_KEY

Query the task using an API Key belonging to the same platform user.

Content-Typestringrequired

Use application/json for submission. Both text-to-image and image-to-image use a JSON request body.

Version selection

Display namemodelversion
Flare (default)gpt-image-2.5-extflare
Sunburstgpt-image-2.5-extsunburst

Request parameters

modelstringrequired

Fixed value: gpt-image-2.5-ext.

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)
versionstringdefault: flare

Model version. Options: flare, sunburst.

promptstringrequired

The prompt for image generation or editing. It must not be empty after trimming leading and trailing whitespace.

For image-to-image, describe what to preserve and what to change in the reference images.

resolutionstringdefault: 1K

Output resolution tier. Options: 1K, 2K, 4K.

sizestringdefault: auto

Output aspect ratio. Choose auto or one of the following 10 ratios:

1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9.

nintegerdefault: 1

The number of images to generate per request. Must be an integer from 1 to 4.

image_urlsstring[]

An array of up to 16 reference images. Omit reference images for text-to-image; include them for image-to-image. Reference images incur no additional charge.

Supported input formats:

  • Accessible image URLs
  • Data URL: data:image/...;base64,...

Usage examples

The following are JSON request bodies for POST /v1/images/generations. Use the authentication and recommended headers described above. Replace the reference image placeholders with real, accessible image URLs.

Text-to-image

json
{
  "model": "gpt-image-2.5-ext",
  "version": "flare",
  "prompt": "A sky garden in a futuristic city, early morning mist, architectural photography",
  "size": "16:9",
  "resolution": "2K",
  "n": 1
}

Image-to-image with Sunburst

json
{
  "model": "gpt-image-2.5-ext",
  "version": "sunburst",
  "prompt": "Preserve the product and packaging text, replace the background with a soft off-white studio setting, and add a natural cast shadow",
  "size": "1:1",
  "resolution": "2K",
  "n": 1,
  "image_urls": [
    "https://example.com/product.png"
  ]
}

Multiple reference images and outputs

json
{
  "model": "gpt-image-2.5-ext",
  "version": "sunburst",
  "prompt": "Use the product in the first image as the subject, take inspiration from the setting in the second image, and create a landscape advertisement",
  "size": "16:9",
  "resolution": "2K",
  "n": 2,
  "image_urls": [
    "https://example.com/product.png",
    "https://example.com/set.jpg"
  ]
}

Automatic aspect ratio and 4K resolution

json
{
  "model": "gpt-image-2.5-ext",
  "version": "flare",
  "prompt": "A minimalist key visual for a product launch, choosing a suitable aspect ratio based on the image content",
  "size": "auto",
  "resolution": "4K",
  "n": 1
}

Query task results

Use the task ID to call the task query endpoint:

bash
curl --request GET \
  --url https://api.apisea.ai/v1/tasks/task_01EXAMPLE \
  --header 'Authorization: Bearer <token>'

Successful task

The task ID, timestamps, URLs, and amounts below illustrate the response structure only. They do not represent a real task or actual prices.

json
{
  "code": 200,
  "data": {
    "id": "task_01EXAMPLE",
    "status": "completed",
    "progress": 100,
    "created": 1788912000,
    "completed": 1788912045,
    "actual_time": 45,
    "estimated_time": 300,
    "cost": 0.2,
    "credits_cost": 2,
    "result": {
      "images": [
        {
          "url": [
            "https://example.com/output-1.png",
            "https://example.com/output-2.png"
          ],
          "expires_at": 1788998445
        }
      ]
    }
  }
}

Response

codeinteger

Response status code. A successful submission in the unified format returns 200.

request_idstring

The identifier for this request, used for troubleshooting.

dataobject

The accepted asynchronous task.

Task fields

idstring

The unique task identifier, used to query task status and image results.

objectstring

Object type. The value is generation.task.

typestring

Task type. The value is image.

statusstring

The initial status is pending, indicating that the task has been accepted.

progressinteger

Current progress, initially 0.

poll_urlstring

The relative path for querying the task, such as /v1/tasks/task_01EXAMPLE.

תגובות

{
  "code": 202,
  "request_id": "req_example",
  "data": {
    "id": "task_01EXAMPLE",
    "object": "generation.task",
    "type": "image",
    "status": "pending",
    "progress": 0,
    "poll_url": "/v1/tasks/task_01EXAMPLE"
  }
}

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