Image Generation
POST /v1/images/generations
Generate images with the OpenAI-compatible images endpoint. Four models are available: two FLUX models billed per megapixel, and two GPT Image models billed per image at a fixed quality × size price. See Models & Pricing for the full price tables.
Requests are non-streaming: one POST, one JSON response.
Response shape
FLUX models return hosted URLs (JPEG); GPT Image models return base64 (b64_json). The response follows the OpenAI images schema:
The usage block is not meaningful for image generation — images are billed per megapixel or per image, never by tokens. The exact charge for every request is on its receipt.
Parameters
Omitted size and quality (and the literal value "auto") resolve to 1024x1024 and high on GPT Image models; the substitution is recorded in the request’s transformed_fields on its receipt.
stream is not supported on this endpoint. Unknown or unsupported parameters are rejected with a 400 before any charge is reserved.
Billing
Image generation charges are deterministic: the price is fixed by the request itself at admission, before the provider is called, and the receipt settles at exactly that amount.
- FLUX models bill
ceil(width × height / 2²⁰)megapixels per image at the model’s per-megapixel rate — a1024x1024image is 1 MP, a1600x1024image rounds up to 2 MP. - GPT Image models bill the fixed per-image price for the requested
quality×sizecell, multiplied byn.
The route receipt for an image request shows the surface images_generations and the exact prepaid charge; token usage is shown as not applicable.