Create image
Generate images over the OpenAI Images-compatible endpoint. The official SDKs work unchanged.
Compared with the text endpoints, two behaviors matter in practice:
- Artifacts are stored in object storage and returned in amux.images. Stored artifacts are cleaned up on a schedule, so download anything you need to keep; afterwards the address returns 404;
- We reserve an estimated amount when the request is accepted, then settle against actual usage and release the difference. If your available balance cannot cover that reserve, the request returns 402 immediately.
Streaming (stream: true) returns SSE with the same events OpenAI uses: zero or more image_generation.partial_image frames (low-resolution previews), then one image_generation.completed carrying the final image and usage. partial_images sets how many previews you want (0-3, default 0 — completed only). If rendering finishes quickly, you may receive fewer previews than requested.
Two limits:
- One image per request (n must be 1). Nothing in the stream events says which image a frame belongs to, so several cannot be told apart;
- Only providers that support image streaming take part in routing. When none does, you get an explicit error instead of a silent fallback to non-streaming.
post/v1/images/generations
Request
- Base URL: https://gateway.amux.ai
- URL: https://gateway.amux.ai/v1/images/generations
- Auth: HTTP bearer
Request body
Example request
{
"model": "openai/gpt-image-2",
"prompt": "A red fox sitting in snow, photorealistic",
"size": "1024x1024"
}Response
Success. data and usage match OpenAI; amux is our extension.
Example response
{
"created": 1786000000
}Changes
No recorded changes to this operation across all 1 revision of this API.