API reference/Image generation

Image Generation API

GPT Image 2.6 supports generation, editing, and async jobs with per-image billing and no resolution or quality tiers. The current channel chooses size and quality automatically and does not guarantee requested values.

On this pageexpand_more

Quick exampleslink

GPT Image 2.6 supports generation, editing, and async jobs with per-image billing and no resolution or quality tiers. The current channel chooses size and quality automatically and does not guarantee requested values.

cURL
curl https://api.wokey.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6",
    "prompt": "A quiet lake at sunrise"
  }'

Returns data[0].b64_json. Image edits use the image file field (repeat it for multiple reference images); async mode returns a job ID.

Async optionlink

For slower generations, add the request headerPrefer: respond-async· Job ID → poll status → download image

Request parameterslink

modelRequired
Currently gpt-image-2.6 is supported; legacy aliases gpt-image-2.5 and gpt-image-2 are also accepted.
promptRequired
Non-empty image prompt.
sizeOptional
Accepted for compatibility only: auto or WIDTHxHEIGHT (128-4096 per side). These are input validation limits, not guaranteed output dimensions. Omit this parameter for new integrations.
qualityOptional
Accepted for compatibility only: auto, low, medium, or high (default auto). The requested quality level is not guaranteed. Omit this parameter for new integrations.
imageRequired for edits
Only for /v1/images/edits. 1-8 reference images in PNG, JPEG, or WebP, at most 10MB each and 40MB in total. In multipart requests repeat the image (or image[]) file field; images keep their upload order. In JSON send a base64 or data URL string, or an array of them for multiple images. mask is not currently supported.
nOptional
Only 1 is currently supported. Omitted requests are treated as 1. Send separate requests for multiple results.
streamOptional
Set true for the official OpenAI image streaming protocol over SSE: progressive previews arrive as image_generation.partial_image events and the final image as image_generation.completed. Billing matches the non-streaming path; preview frames are free.
partial_imagesOptional
Number of progressive preview frames when streaming, integer 0-3 (default 0: only the final event).

Response parameter: data[0].b64_json contains the generated image base64.

Per-image billinglink

GPT Image 2.6 costs $0.01 per image, without resolution or quality tiers. Requested size and quality do not change the price or guarantee matching output.

ModelPrice
gpt-image-2.6$0.01 / image
  • Describe landscape, portrait, or your preferred aspect ratio in the prompt. This does not guarantee exact dimensions or native 4K; check the actual returned image.

FAQlink

Do size or high quality guarantee the output?
No. The current channel may override these compatibility parameters. Size and quality are chosen automatically; a resolution requested in the prompt is also not guaranteed.
Can I send several reference images at once, such as a scene frame plus a character reference?
Yes. /v1/images/edits accepts up to 8 images per request, and the model sees all of them together. Images carry no role labels, only their order, so say in the prompt what each one is for, for example "Image 1 is the scene frame: keep its composition, lighting, and camera angle. Place the character from image 2 into the scene, keeping their face, hairstyle, and outfit." Each request returns one image, and the number of inputs does not change the price.
What is the "Studio 网页生图" key in my key list? Can I delete it?
After you use Image Studio, the platform manages a hidden API key named "Studio 网页生图" for you (early users may see "网页生图"). Every Studio turn bills through it on the exact same accounting and rate-limit path as API calls, which is why request records attribute those calls to that key name. Its secret is never sent to the browser. Deleting or pausing it is harmless — the next Studio turn recreates it automatically.
How is Image Studio billed?
GPT Image 2.6 costs $0.01 per image, just like the API, without resolution or quality tiers. Other image models follow their own published pricing.
Where are Studio images stored?
Only in your current browser. The platform does not store generated images, so switching browsers or clearing site data loses the history — download anything you want to keep.