GPT-Image-2.5 Ext Image Generation
Use gpt-image-2.5-ext and select Flare or Sunburst with version
Semua dokumentasi/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
Contoh permintaan
# 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
AuthorizationstringrequiredThe generation and task query endpoints use a platform API Key for Bearer Token authentication. Get a key from the API Key management page.
Authorization: Bearer YOUR_API_KEYQuery the task using an API Key belonging to the same platform user.
Content-TypestringrequiredUse application/json for submission. Both text-to-image and image-to-image use a JSON request body.
Version selection
| Display name | model | version |
|---|---|---|
| Flare (default) | gpt-image-2.5-ext | flare |
| Sunburst | gpt-image-2.5-ext | sunburst |
Request parameters
modelstringrequiredFixed value: gpt-image-2.5-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)
versionstringdefault: flareModel version. Options: flare, sunburst.
promptstringrequiredThe 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: 1KOutput resolution tier. Options: 1K, 2K, 4K.
sizestringdefault: autoOutput 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: 1The 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
{
"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
{
"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
{
"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
{
"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:
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.
{
"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
codeintegerResponse status code. A successful submission in the unified format returns 200.
request_idstringThe identifier for this request, used for troubleshooting.
dataobjectThe accepted asynchronous task.
Task fields
idstringThe unique task identifier, used to query task status and image results.
objectstringObject type. The value is generation.task.
typestringTask type. The value is image.
statusstringThe initial status is pending, indicating that the task has been accepted.
progressintegerCurrent progress, initially 0.
poll_urlstringThe relative path for querying the task, such as /v1/tasks/task_01EXAMPLE.
Respons
{
"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"
}
}Model yang menggunakan endpoint ini
Menemui masalah dalam dokumentasi ini? E-mel support@apisea.ai.