GPT Image 2.5
GPT Image 2.5
GPT Image 2.5 for sharper detail, cleaner typography and up to 4K output, in two looks
- Endpoint
- POST /api/v1/images/generate
- model
- gpt-image-2.5
- Output
- Image
- Credits
- from 5
Отправить задачу
/api/v1/images/generateПараметры
modelstringТребуетсяMust be "gpt-image-2.5"
typestringОпциональноПо умолчаниюtext-to-image"text-to-image" or "image-to-image" (default: text-to-image)
text-to-imageimage-to-imagepromptstringТребуетсяText description (3–20000 chars)
image_urlsstring[]ОпциональноRequired for image-to-image. 1–16 public https image URLs
image_sizestringОпциональноПо умолчаниюautoAspect ratio: "auto" (default), "1:1", "3:2", "2:3", "4:3", "3:4", "16:9", "9:16", "21:9", "27:16", "16:27", "9:8" or "8:9"
auto1:13:22:34:33:416:99:1621:927:1616:279:88:9resolutionstringОпциональноПо умолчанию1K"1K" (default), "2K" or "4K"
1K2K4KvariantstringОпциональноПо умолчаниюflareLook of the image: "flare" (default) or "sunburst"
flaresunburstgeneration_modestringОпциональноПо умолчаниюstandard"standard" (default), "economy" (needs an account with a purchase) or "stable" (same price for every account; needs a fixed image_size, "auto" is refused before charging)
standardeconomystablenum_imagesnumberОпциональноMust be 1
Запрос
curl -X POST https://www.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: docs-gpt25-text-001" \
-d '{
"model": "gpt-image-2.5",
"resolution": "2K",
"image_size": "3:2",
"prompt": "A product shot of a glass perfume bottle on wet black stone, soft rim light"
}'Ответ200
{
"success": true,
"data": {
"task_id": "g25-3f9c1e…",
"credits_used": 14,
"remaining_credits": 486,
"model": "gpt-image-2.5",
"resolution": "2K"
}
}Значения credits_used в этих примерах приведены для иллюстрации. Фактический расход рассчитывается при отправке и возвращается API.
Запросить задачу
/api/v1/images/{task_id}status
pending- Accepted and waiting to start. Keep polling.
processing- Running. Keep polling.
completed- Finished. Read image_url; output holds the full result.
failed- Ended without a result. error_message says why and credits_refunded shows what was returned.
Poll every 5 to 10 seconds and stop at completed or failed, or register a webhook to be notified instead. Failed tasks are refunded automatically.
Запрос
curl https://www.bananapro.site/api/v1/images/task_abc123 \
-H "Authorization: Bearer sk-your-api-key"Ответ200
{
"success": true,
"data": {
"task_id": "task_abc123",
"model": "gpt-image-2.5",
"status": "completed",
"output": { "images": [{ "url": "https://..." }] },
"primary_url": "https://...",
"image_url": "https://...",
"error_message": null,
"credits_used": 14,
"credits_refunded": 0,
"created_at": "2026-10-04T10:00:00.000Z",
"updated_at": "2026-10-04T10:01:12.000Z",
"completed_at": "2026-10-04T10:01:12.000Z"
},
"request_id": "req_abc123"
}Дождаться результата
TASK_ID=task_abc123
while true; do
TASK=$(curl -s https://www.bananapro.site/api/v1/images/$TASK_ID \
-H "Authorization: Bearer sk-your-api-key")
STATUS=$(echo "$TASK" | jq -r '.data.status')
if [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ]; then
echo "$TASK" | jq
break
fi
sleep 10
doneЦены
| Mode | 1K | 2K | 4K |
|---|---|---|---|
| standard, account with a purchase | 8 | 14 | 20 |
| standard, account without a purchase | 16 | 28 | 40 |
| stable (needs a fixed image_size) | 15 | 20 | 25 |
| economy (needs a purchase) | 5 | 8 | 12 |
Credits per image. Without a purchase, economy returns 403 purchase_required before anything is charged.
Особенности
- Text-to-image and image-to-image (up to 16 reference images)
- 1K, 2K and 4K output with 13 aspect ratios, or auto
- Two looks: flare (default) and sunburst
- Standard mode for every account; economy at a lower price once the account has a purchase; stable for a fixed per-image price