Amux AI

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. An official SDK works unchanged once its base_url points here.

POSThttps://gateway.amux.ai/v1/images/generations

Authorization

header
AuthorizationstringRequired

Bearer <your Amux AI key> Your Amux API key.

Request

application/json
modelstringRequired

Model ID, optionally suffixed with :provider to pin a provider.

promptstringRequired

The prompt.

nintegerDefault 1

How 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_ratiostring

1:1 / 3:2 / 2:3 — this model has no others. 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.

⚠️ Prefer size where you can. This upstream takes exact pixel sizes only, so a ratio is folded into one of them, together with image_size when given. The fold is lossy: a ratio with no exact match is approximated to the nearest available size, and if nothing is close enough the field is dropped — either way with a note in amux.notes. size states the result you want and is passed through unchanged.

image_sizestring

1K. 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 100

Compression level; only meaningful for jpeg / webp.

moderation"auto" | "low"Default "auto"

Moderation strictness. Generation endpoint only.

userstring

End-user identifier for abuse monitoring. Omit the key entirely if you do not need it.

streambooleanDefault false

Return SSE. Requires n of 1 and at least one provider that streams.

partial_imagesintegerDefault 0

How 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

200response

Success. data and usage match OpenAI; amux is our extension.

400response

Invalid request. Also covers "streaming asked for but no provider streams" and "streaming with n above 1" — both say what to change.

402response

Not enough available balance to cover this request's reserve.

Available = balance − expired lots − already reserved.

503response

No 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.

Supported 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.

Prefer size. The Google-style "aspect ratio + resolution tier" spelling (aspect_ratio / image_size) is also accepted, but this upstream takes exact pixel sizes only, so the pair is converted to one of the three sizes above. The conversion is lossy: requesting 2K or 4K falls back to the nearest permitted tier, and a ratio with no match is dropped — either way 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 for 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.

Artifact retention

amux.images carries directly usable addresses and data[].b64_json carries this call's image. Stored artifacts are removed after a retention period. Download anything that must be kept; once removed, the address returns 404.

Streaming

stream: true returns SSE; partial_images (0-3) sets how many low-resolution previews are returned, each costing an additional 100 image output tokens. A fast render may emit fewer previews than requested.

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
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>"
    ]
  }
}