GPT-Image-2.6 Ext Image Generation
Generate images at a fixed per-image price with gpt-image-2.6-ext. Select Flare or Sunburst with version; use references, SVG, or GIF output.
Toda a documentação/v1/images/generationsNote
Use
gpt-image-2.6-extand selectflareorsunburstwithversion. Billing is per image. Supported:resolution1k/2k/4kwithn: 1, all quality levels, and PNG / JPEG / WebP / SVG / GIF output.
This is the Ext API. Its model name and parameter rules differ from the token-billed GPT-Image-2.6 models.
Exemplos de pedidos
curl --request POST \
--url https://api.apisea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2.6-ext",
"version": "flare",
"prompt": "An orange cat resting on a sunny windowsill, a city after the rain, warm cinematic lighting",
"size": "16:9",
"resolution": "1k",
"quality": "high",
"n": 1
}'Authentication
AuthorizationstringrequiredAuthenticate with a platform API Key using Bearer Token. Get a key from the API Key page. Submit requests with Content-Type: application/json.
Version selection
| Version | Use case |
|---|---|
flare | Default; prioritizes speed for everyday images, batches, and rapid iteration. |
sunburst | Prioritizes composition and editing precision for finished assets, text in images, and detailed edits. |
Request parameters
Enum values are case-insensitive and trimmed. Examples use lowercase.
modelstringrequiredMust be gpt-image-2.6-ext.
nsfw_checkbooleandefault: falseWhether to run content moderation before submitting the image task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstringrequiredRequired, non-empty generation or editing instructions. For multiple references, identify the first or second image and describe what to change and preserve.
versionstringdefault: flareflare / sunburst; defaults to flare. Other values return HTTP 400. Prices may differ between versions.
resolutionstringdefault: 1k1k / 2k / 4k (uppercase 1K / 2K / 4K also accepted). Combined with the size ratio to determine output pixels; see the "Aspect ratios and dimensions" table below. The per-image price varies by tier; other values such as hd / 8k return HTTP 400.
sizestringdefault: autoAccepts auto or the 10 ratios below, not pixels such as 1024x1024. For text-to-image, auto gives 1:1. For editing, it matches the closest supported ratio to the first reference whose dimensions can be read. For GIF, omit this field or use auto.
aspect_ratiostringAlias for size; use either one. If both are provided, they must match or submission returns HTTP 400. For GIF, also omit it or use auto.
nintegerdefault: 1Currently use integer 1.
qualitystringauto / low / medium / high / xhigh / max. Omitted values are not forwarded; the upstream model chooses automatically. auto is not fixed to low. Quality does not change the per-image price; higher levels usually take longer. Other values return HTTP 400.
output_formatstringdefault: pngpng / jpeg / webp / svg / gif; jpg aliases jpeg. SVG and GIF support text-to-image only. Other formats return HTTP 400.
Warning
SVG output is not supported yet.
complexitystringlow / medium / high; omitted values are not forwarded and the upstream model decides. Controls scene complexity: low suits simple icons and flat illustrations; high suits richer detail. Does not change the per-image price.
image_urlsstring[]Up to 16 images, each at most 20 MB; PNG / JPEG / WebP / GIF / BMP. Accepts public HTTP(S) URLs or image Base64 Data URLs such as data:image/png;base64,.... Providing references enables editing. SVG and GIF cannot include references.
Warning
When
resolutionis2k/4k, reference images cannot be GIF / BMP.
Accepted field aliases: image_url, image, images, input_image, input_images. Prefer image_urls. URLs must be publicly accessible without login.
Aspect ratios and dimensions
| Ratio | 1k | 2k | 4k |
|---|---|---|---|
1:1 | 1024×1024 | 2048×2048 | 2880×2880 |
3:2 | 1536×1024 | 2048×1360 | 3520×2336 |
2:3 | 1024×1536 | 1360×2048 | 2336×3520 |
4:3 | 1024×768 | 2048×1536 | 3312×2480 |
3:4 | 768×1024 | 1536×2048 | 2480×3312 |
5:4 | 1280×1024 | 2560×2048 | 3216×2576 |
4:5 | 1024×1280 | 2048×2560 | 2576×3216 |
16:9 | 1536×864 | 2048×1152 | 3840×2160 |
9:16 | 864×1536 | 1152×2048 | 2160×3840 |
21:9 | 2016×864 | 2688×1152 | 3840×1648 |
With auto, text-to-image uses 1:1: 1024×1024 at 1k, 2048×2048 at 2k, 2880×2880 at 4k. Editing selects the closest ratio in this table; it does not guarantee the original pixel dimensions.
Reference-image editing example
Editing also uses POST /v1/images/generations. Replace example URLs with accessible image files.
{
"model": "gpt-image-2.6-ext",
"version": "sunburst",
"prompt": "Place the product from the first image into the scene in the second image. Preserve the logo and packaging text, and match the lighting.",
"image_urls": [
"https://example.com/product.png",
"https://example.com/scene.jpg"
],
"size": "auto",
"quality": "high",
"n": 1
}SVG output
Set output_format: "svg". Text-to-image only, with n=1. size accepts aspect ratios; complexity: "low" suits simple vector artwork.
svgobjectOptional SVG authoring-model configuration, for SVG output only. The entire object may be omitted. The text model that authors the SVG incurs no additional charge.
svg
modelstringrequiredRequired if the svg object is provided. For example, gpt-4.1-mini.
reasoningobjectreasoning
effortstringOptional: none / minimal / low / medium / high / xhigh / max. Supported values depend on the text model; omit if unsure.
{
"model": "gpt-image-2.6-ext",
"prompt": "A minimalist rocket icon in a single line color, flat vector style, no text",
"size": "1:1",
"output_format": "svg",
"complexity": "low",
"svg": {
"model": "gpt-4.1-mini"
},
"n": 1
}Animated GIF output
Set output_format: "gif". Text-to-image only. Omit size / aspect_ratio or use auto; ratios and pixel dimensions return HTTP 400. Describe the motion and loop in the prompt.
{
"model": "gpt-image-2.6-ext",
"prompt": "A cartoon puppy raises one paw to wave, then returns to the starting pose. White background, fixed camera, seamless loop.",
"output_format": "gif",
"quality": "medium",
"n": 1
}Unsupported and ignored parameters
| Parameter | Behavior |
|---|---|
width / height / markup / markup_url | Returns HTTP 400 at submission. Use aspect-ratio names for size; markup-guided editing is not supported. |
background / moderation / output_compression / seed / negative_prompt / style | Accepted but has no effect. |
response_format | Does not change delivery: results are file URLs, not Base64 images. |
Submission and task results
Successful submission returns HTTP 200. Read data[0].task_id, then poll the task status endpoint every 3–5 seconds until completed or failed. If the client times out, keep querying that task instead of resubmitting generation.
curl --request GET \
--url https://api.apisea.ai/v1/tasks/task_01EXAMPLE \
--header 'Authorization: Bearer <token>'The example below shows the task object. If the response uses a {code, data} wrapper, read data first. The Python / JavaScript examples handle either shape.
{
"id": "task_01EXAMPLE",
"status": "completed",
"progress": 100,
"result": {
"images": [
{
"url": [
"https://cdn.example.com/images/example.png"
],
"expires_at": 1793923252
}
]
}
}result.images[0].url is an array; its first link is result.images[0].url[0]. Download before expires_at; the recommended validity period is 24 hours after completion. cost / credits_cost report final charges.
| Status | Action |
|---|---|
pending / processing | Continue polling. |
completed | Read and save the output files. |
failed | Inspect error.message. Failures are fully refunded and cost is 0. Correct the cause before submitting again. |
Batch queries use POST /v1/tasks/batch with {"task_ids":["task_xxx","task_yyy"]}.
Billing
The per-image price depends only on version × resolution. Quality, format (including SVG / GIF), complexity, ratio, reference count, and svg.model do not affect it. Currently use n=1; failed tasks are fully refunded. Check current rates on the APISea pricing page or /api/pricing.
Error handling
| Stage / status | Cause and action |
|---|---|
| HTTP 400 | Invalid parameters; rejected before task creation with no charge. Check enums, ratios, reference limits, and whether SVG / GIF fields match the output format. |
| HTTP 401 | Missing or invalid API Key; check Authorization. |
| HTTP 403 | model_price_not_configured: no price is configured for this version × resolution. Contact support or choose another tier. |
| HTTP 429 | Too many requests; reduce concurrency before retrying. |
status: "failed" | Execution failed, for example with still-image / GIF n=2–4, inaccessible references, or a content-safety rejection. Read error.message and adjust the request. Charges are fully refunded. |
Respostas
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01EXAMPLE"
}
]
}Modelos que usam este endpoint
Encontrou um problema nesta documentação? Envie um e-mail para support@apisea.ai.