Create image
Last updated September 1, 2026
Generate with gpt-image-1.5 over the OpenAI-compatible endpoint; official SDKs work as-is.
Text-to-image with openai/gpt-image-1.5, over the OpenAI-compatible endpoint.
Point an official SDK's base_url here and it works.
https://gateway.amux.ai/v1/images/generationsAuthorization
headerAuthorizationstringRequiredBearer <your Amux key> Your Amux API key.
Request
application/jsonmodelstringRequiredModel ID, optionally suffixed with :provider to pin a provider.
promptstringRequiredThe prompt.
nintegerDefault 1How many images (1-10, default 1). Billed per image, and the reserve scales with it. Must be 1 when streaming.
size"1024x1024" | "1536x1024" | "1024x1536" | "auto"Only these, or auto (the default):
1024x1024 (1:1) - 1536x1024 (3:2 landscape) - 1024x1536 (3:2 portrait)
⚠️ Only the tiers above. Anything else is rejected upstream.
The Google-style "aspect ratio + resolution tier" spelling
(aspect_ratio / image_size) also works; we convert to one of the
three above, downgrading a 2K/4K request to the nearest legal tier
with a note in amux.notes.
aspect_ratiostring1:1 / 3:2 / 2:3. An alternative spelling of size (the Google-ecosystem form); send one or the other. If both are given, size wins and we say so in amux.notes. Folding a ratio into exact pixels is lossy, and when no tier matches we drop it and note it rather than guessing a size for you.
image_sizestring1K. Used together with aspect_ratio; same rules.
quality"low" | "medium" | "high" | "auto"Default "auto"Render quality. It drives the image token count and therefore the price — the tiers can differ by an order of magnitude.
background"transparent" | "opaque" | "auto"Default "auto"A transparent background needs png or webp; jpeg has no alpha channel.
output_format"png" | "jpeg" | "webp"Default "png"Output format, png by default.
output_compressionintegerDefault 100Compression level; only meaningful for jpeg / webp.
moderation"auto" | "low"Default "auto"Moderation strictness. Generation endpoint only.
userstringEnd-user identifier for abuse monitoring. Omit the key entirely if you do not need it.
streambooleanDefault falseReturn SSE. Requires n of 1 and at least one provider that streams.
partial_imagesintegerDefault 0How many low-resolution previews to send while streaming. 0 (the default) means the completed event only. You may get fewer than you asked for — a fast render goes straight to the completed event.
Response
200responseSuccess. data and usage match OpenAI; amux is our extension.
400responseInvalid request. Also covers "streaming asked for but no provider streams" and "streaming with n above 1" — both say what to change.
402responseNot enough available balance to cover this request's reserve.
Available = balance − expired lots − already reserved.
503responseNo provider available. Two common causes: this model has no image provider
configured, or the size tier you asked for has no price on that provider —
metadata says which.
Only three sizes
1024x1024 (1:1) · 1536x1024 (3:2 landscape) · 1024x1536 (3:2 portrait),
plus auto.
⚠️ It does not take arbitrary pixel strings — that is a gpt-image-2
capability. Sending 2048x2048 or 3840x2160 gets rejected upstream.
The Google-style "aspect ratio + resolution tier" spelling (aspect_ratio /
image_size) also works; we convert it to one of the three above. Asking for 2K or
4K downgrades to the nearest legal tier, with a note in amux.notes.
Cost
size and quality drive the image token count, which is the bulk of the cost.
⚠️ This model also produces text output tokens — its internal reasoning. They
never appear in the response but they are billed at the text output rate.
gpt-image-2 has no such charge.
Artifacts get cleaned up
amux.images carries directly usable addresses and data[].b64_json carries this call's image.
Stored artifacts get cleaned up — download anything you need to keep; afterwards
the address returns 404.
Streaming
stream: true returns SSE; partial_images (0-3) sets how many low-resolution
previews you get, each costing an extra 100 image output tokens. A fast render may
send fewer previews than you asked for.
n must be 1 when streaming.
Errors
The error shape matches OpenAI. See Errors and retries for
the type values and their retry semantics.
curl https://gateway.amux.ai/v1/images/generations \
-H "Authorization: Bearer $AMUX_API_KEY" \
-d '{
"model": "openai/gpt-image-1.5",
"prompt": "A red fox sitting in snow, photorealistic",
"size": "1024x1024"
}'{
"created": 1786000000,
"size": "<string>",
"quality": "<string>",
"background": "<string>",
"output_format": "<string>",
"data": [
{
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0
},
"amux": {
"task_id": "<string>",
"generation_id": "<string>",
"provider": "<string>",
"cost_nano": "<string>",
"images": [
{
"index": 0,
"url": "<string>"
}
],
"notes": [
"<string>"
]
}
}