- Text to image.
- Image to image with reference assets.
- OpenAI-compatible image generation.
- OpenAI-compatible image editing.
- Gemini-compatible image workflows.
/v1/images/generations and poll /v1/tasks/{task_id}.
Available models
GPT Image 2.6 — PNG and animated GIF
Use the public model IDgpt-image-2.6 to request a PNG still image or a downloadable animated GIF. Each successful request returns one result and costs 30 credits, for either format. Confirm the model is listed in GET /v1/models before use; examples do not guarantee current availability.
Supported request parameters
output_format:png(default) orgif.quality:autoonly.resolution:1Konly.n:1only.size:auto,1:1,3:2,2:3,1024x1024,1536x1024, or1024x1536.image_urls: at most one reference image. This is the current APIAny.AI limit for this model; omit it for text-only generation.
frame_count or frame_duration_ms. SVG, JPEG, WebP, 2K/4K, masks and output compression are not supported. background only accepts auto for compatibility and can be omitted. Unsupported values, including SVG, return HTTP 400; SVG is not silently replaced with PNG.
These restrictions also apply to compatibility aliases at the top level and inside model_params. Conflicting values return HTTP 400. Prefer the canonical fields shown below; arbitrary model parameters are not guaranteed to be supported.
Create a PNG task
Create a GIF task
Poll and download
The generation endpoint returns HTTP202 with task_id and poll_url. Continue polling while status is pending or processing; stop on completed or failed. Do not submit the same task again while it is processing.
completed, download the file from result.data[0].url. A successful GIF result is an actual animated file, not a video URL or a set of frames. A static or wrong-format result for a GIF request is a failed task and follows the normal failed-task credit refund policy.
/v1/images/generations/sync accepts the same parameters. HTTP 200 returns the file URL at data[0].url; HTTP 202 means the task is still running and must be polled. /v1/images/edits accepts one reference as JSON or multipart upload, with the same PNG/GIF choices and 30-credit price. See the image-generation guide for examples.
Synchronous waiting and editing examples
Nano Banana 2.1
Usequality to select 1K, 2K or 4K (default 1K). Equivalent size fields are img_size, imageSize and resolution; do not send conflicting values. size selects the aspect ratio. Use image_urls to provide reference images for editing. 0.5K and search or thinking controls are not available for this model.
/v1/tasks/{task_id} until the task reaches a terminal state. Prices per output image are 25 credits for 1K, 50 for 2K and 75 for 4K.