Images
Use the Images API for image generation and editing. The Responses image_generation tool and asynchronous image jobs are not part of this public interface. Start by calling GET /openai/v1/models with your Quotaflow key; catalog membership does not guarantee capacity for every optional image request.
Models and endpoints
| Family | Model IDs | Interfaces |
|---|---|---|
| GPT image | openai/gpt-image-2, openai/gpt-image-2.5-flare, openai/gpt-image-2.5-sunburst, openai/gpt-image-2.6-flare, openai/gpt-image-2.6-sunburst | /openai/v1/images/generations, /openai/v1/images/edits |
| Gemini image | google/gemini-nano-banana-2.1, google/gemini-3-pro-image, google/gemini-3.1-flash-image, google/gemini-3.1-flash-lite-image, google/gemini-3.1-flash-image-preview, google/gemini-2.5-flash-image | Both Images endpoints, native :generateContent / :streamGenerateContent, and /v1beta/interactions |
The full base URL is https://api.quotaflow.ai. Unprefixed compatibility spellings are also accepted for these models. Do not send text reasoning controls such as top-level thinking.
Generate an image
curl https://api.quotaflow.ai/openai/v1/images/generations \
-H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-image-2","prompt":"An editorial illustration of a harbor at sunrise.","size":"1024x1024","quality":"medium","response_format":"b64_json"}'
Read data[].b64_json as Base64 image bytes. Non-streaming GPT image requests can alternatively request response_format: "url"; these temporary links should be downloaded before expiry. Gemini image models support b64_json only. Keep the connection open until the response completes.
GPT image generation and edits
- All listed GPT image models use both generation and edit endpoints. Send edit inputs as multipart
image/image[], or JSONimages[].image_urlcontaining an HTTPS URL or a Base64 data URL. An edit may also carry a mask. Uploaded OpenAIfile_idreferences cannot be read from a customer's separate OpenAI account. - Explicit static-raster
size(GIF frame/SVG rules are documented separately for 2.6): both edges divisible by 16, neither edge above 3840, aspect ratio between 1:3 and 3:1, and 655,360–8,294,400 total pixels. Response-size limits can also restrictnon large images. - Omitted
sizeandqualitystay omitted; explicitautois preserved. Do not rely on a forced1024x1024/mediumdefault. Read the returned size and quality when present. gpt-image-2quality:auto,low,medium,high. GPT Image 2.5/2.6 additionally acceptxhighandmax.- Raster output formats:
png,jpeg,webp. Transparent output requirespngorwebp. Only GPT Image 2.6 addsgif/svg; see its specific parameter guide. naccepts 1–10, subject to response/pixel limits; streaming requiresn: 1. A larger image may require fewer outputs.
curl https://api.quotaflow.ai/openai/v1/images/edits \
-H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
-F model=openai/gpt-image-2 \
-F 'prompt=Keep the composition and change the background to a harbor at sunrise.' \
-F 'image[]=@reference.png' \
-F response_format=b64_json
GPT image streaming
Set stream: true with n: 1. Consume SSE events rather than a JSON data array:
- Generation ends with
image_generation.completed; an edit ends withimage_edit.completed. partial_imagesis an integer from 0 to 3 and requiresstream: true. A generation asking for partial frames requires compatible capacity and may deliver fewer frames than requested. Partial generation events useimage_generation.partial_image.- An edit can accept
partial_imagesbut does not promise partial edit frames; it can send only its completed frame. A stream without partial frames can buffer until the image is ready. - Streamed image bytes are Base64; a
response_format: "url"request does not turn streamed frames into URL results. Handle failures and disconnects without blindly replaying already-delivered work.
curl -N https://api.quotaflow.ai/openai/v1/images/generations \
-H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-image-2","prompt":"An editorial illustration of a harbor at sunrise.","size":"1024x1024","quality":"medium","n":1,"stream":true}'
Gemini image generation and edits
On the OpenAI Images endpoints use model, prompt, optional n (1–4), size, quality, response_format and user, plus image_config for size controls and reference images on edits. Gemini image stream, masks, output_format and background are not supported. A GPT image parameter is not automatically a Gemini image parameter.
sizeaccepts the legacyauto,1024x1024,1024x1536,1536x1024, a supported tier (512,1K,2K,4K) or a pixel size that maps to a published ratio/tier for that model.image_config: {"aspect_ratio":"16:9","image_size":"2K"}selects a model-specific shape. Camel-caseaspectRatio/imageSizeare also accepted inside this object; do not send both spellings of one member. Conflicting size/config values are refused.- A tier without a ratio means 1:1 on OpenAI Images. Do not assume the same omitted-ratio behavior on Gemini-native calls.
- Edits accept 1–14 reference images, up to 20 MB total: PNG, JPEG, WebP, HEIC or HEIF. Use multipart
image/image[]or JSONimages[].image_urlinline Base64 data URLs. Remote URLs,file_idand masks are not supported for Gemini edits.
See the Gemini image guide for the per-model size table and native example. Unsupported parameter shapes return a field-specific error instead of being silently switched to another image model.
Usage and billing
For GPT image models, usage describes the request's billable token counts, based on validated reported usage or supported estimates for the serving path; it is not a promise to expose raw supplier accounting. total_tokens is input_tokens + output_tokens. A model/quality-compatible fallback keeps the requested public model/quality and corresponding customer billing contract; do not infer an internal execution change from supplier statistics.
For Gemini image models, billing can distinguish input, text/thinking output and image output. A validated native usage reading carries those buckets; a supported estimate is used when an authoritative reading is absent. input_tokens / native promptTokenCount are omitted only when input was not measured. Native candidatesTokenCount excludes thoughts, thoughtsTokenCount carries them, and image modality details identify image output. Prices and final charges depend on the exact model and account terms, not merely the request's output cap.
Legacy or unlisted identities
A runtime-recognized model name is not necessarily a published customer model. Grok Imagine has a separate image protocol contract; do not send a Grok text ID or assume GPT/Gemini image parameters work for it. This guide does not advertise its unlisted IDs as universally available. Ask for a model's supported integration before using an ID absent from your authenticated discovery response.