Use the customer contract rather than upstream examples
The image aliases include gpt-image-2, gpt-image-2.5, gpt-image-2.6 and nano-banana-2.1. They share the customer endpoint but can have different prices and provider mappings. Fields such as response_format, input_image_id or an arbitrary image-editing payload are not accepted on this route, even if a provider offers them elsewhere.
What to do next
- 01
Choose exact supported options
Read GET /models for availability, sizes and qualities. Use a prompt within 4,000 characters, a documented size and quality=medium for the current published rate.
- 02
Approve and submit once
Obtain /quotes for the intended body, check its estimate, then send the image creation request with the same approved inputs and a durable unique identifier.
- 03
Retrieve and inspect the asset
Save the job ID, poll within the key's rate allowance, and download only after completed. Check the image's actual dimensions and visual content before treating it as suitable for use.
A concrete example
Illustrative body: model gpt-image-2, a descriptive scene prompt, size 1K, quality medium, n 1 and an explicitly approved max_credits. This is an integration example, not a newly generated sample or a quality comparison.
Illustrative single-image JSON body
Illustrative integration code. No paid generation was executed for this guide. Review live availability, quotes and your own approval before running creation requests.
{
"model": "gpt-image-2",
"prompt": "A quiet coastal cafe at sunrise, square composition, no text.",
"size": "1K",
"quality": "medium",
"n": 1,
"max_credits": 1
}Before you call it ready
- The model is an available image alias.
- One durable job is retained.
- The private image is validated after download.
When to stop or choose another method
If your client expects base64 in the first response, implement asynchronous handling before enabling the feature. Do not repeatedly create images while waiting for immediate bytes.
