Amux

Create image edit

Last updated September 9, 2026

Edit with x-ai/grok-imagine-image-quality using reference images; multipart request, official SDKs work as-is.

Image-to-image with x-ai/grok-imagine-image-quality. The body is multipart/form-data: reference images as files, everything else as ordinary fields.

This model supports neither streaming nor masks.

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

Authorization

header
AuthorizationstringRequired

Bearer <your Amux key> Your Amux API key.

Request

multipart/form-data
modelstringRequired

Amux model ID. Append :provider to pin a specific provider.

promptstringRequired

How the reference images should be changed.

imagearray<string>Required

Reference images, required. Both image and image[] are accepted — official SDKs

usually send the former for a single image and the latter for several.

At most 3, each up to 25 MiB, and at most 48 MB once encoded.

Exceeding either limit returns 400; images are never silently dropped.

nintegerDefault 1

How many images to produce (1–10, default 1). Billed per image; the hold scales with it too.

aspect_ratio"1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2" | "21:9" | "5:2" | "19.5:9" | "9:19.5" | "20:9" | "9:20" | "auto"Default "1:1"

Output aspect ratio, 1:1 by default. Identical to what the upstream model accepts — sixteen values:

1:1 4:3 3:4 3:2 2:3 16:9 9:16 2:1 1:2 21:9 5:2 19.5:9 9:19.5 20:9 9:20 auto

The ratio changes the shape of the output only and does not change the pricing tier — all sixteen were measured at the same price.

A ratio outside this set is dropped and explained in amux.notes.

image_size"1K" | "2K"Default "1K"

Resolution tier. 1K (default) or 2K. 4K is not supported.

It also determines the output format: 1K produces JPEG, 2K produces PNG.

Treat the extension of the returned URL as authoritative.

When omitted, 1K is sent explicitly — the tier is always written into the upstream

request rather than left to the upstream default.

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

Moderation strength. auto (default), low or high.

userstring

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

Response

200response

Edit succeeded. Same shape as the generation endpoint.

400response

Invalid request: too many or too large reference images, URL-form reference images, or a capability this model does not support.

402response

Available balance cannot cover the upper-bound hold.

503response

No available provider, or the in-flight queue is full.

Reference images

The field name may be image or image[] (official SDKs send the former for a single image and the latter for several). Reference images are required.

Three limits; exceeding any of them returns 400 and never silently drops an image:

  1. At most 3 — a hard upstream limit for this model;
  2. 25 MiB per image;
  3. 48 MB total once encoded.

Reference images are billed per image, independently of n: producing two images from one reference image still counts as one reference image.

⚠️ Masks are not supported (mask) — the upstream edit endpoint has no such concept. The field is dropped and explained in amux.notes.

⚠️ Reference images must be uploaded as files; URLs are not supported.

Dimensions and format

Dimensions are expressed with two parameters: aspect_ratio and image_size. This model does not accept size (an exact pixel string); it is dropped and explained in amux.notes.

image_sizePixels at 1:1Output format
1K (default)1024 × 1024JPEG
2K2048 × 2048PNG

Other ratios scale within the same tier; the full list is in the next section. 4K is not supported.

The ratio changes the shape of the output only and does not change the pricing tier; the resolution tier does.

⚠️ The output format follows image_size and cannot be chosen — neither output_format nor output_compression has any effect on this model. Treat the extension of the returned URL as authoritative.

Aspect ratio

Output aspect ratio, 1:1 by default. Identical to what the upstream model accepts — sixteen values:

RatioPixels at 1KRatioPixels at 1K
1:11024 × 10242:11408 × 704
4:31152 × 8641:2704 × 1408
3:4864 × 115221:91568 × 672
3:21248 × 8325:21600 × 640
2:3832 × 124819.5:91248 × 576
16:91280 × 7209:19.5576 × 1248
9:16720 × 128020:91280 × 576
autochosen upstream9:20576 × 1280

The ratio changes the shape of the output only and does not change the pricing tier — all sixteen were measured at the same price.

A ratio outside this set is dropped and explained in amux.notes; we will not guess one for you.

quality is not supported

The upstream model accepts this parameter, but on this model it changes neither the output resolution nor the pricing tier. It is therefore marked unsupported here: it is dropped and explained in amux.notes.

The pricing tier for this model depends on image_size alone.

Output files

Both data[].url and amux.images[].url point at our stored copy, not at an upstream temporary URL.

Stored files are cleaned up — download anything you need to keep, or the URL will return 404.

Unsupported parameters

Passing them is not an error: they are dropped and explained in amux.notes. If the result is not what you expected, check notes first.

ParameterWhy
sizeExact pixel strings are rejected upstream. Use aspect_ratio and image_size
maskThe upstream edit endpoint has no concept of a mask
qualityAccepted upstream, but affects neither the output nor billing
backgroundNot accepted upstream; transparent backgrounds cannot be requested
output_format / output_compressionThe output format follows image_size and cannot be chosen
input_fidelityNot accepted upstream
stream / partial_imagesThis model does not support streaming image generation
seedThe OpenAI Images protocol has no such parameter
styleThe upstream model has this parameter; it is not exposed on Amux yet. ⚠️ It is the only one in this table dropped silently — see below

⚠️ style is the exception: dropping it produces no amux.notes entry. Every other parameter above is marked unsupported in this model's parameter matrix, so there is something to report; style is not a parameter Amux models at all, so it is discarded while the request is parsed. In other words, sending style gives you no feedback whatsoever — write your code as if it did not exist.

Editing works asynchronously too

Send the same parameters to /v1/tasks (also multipart) to run the edit in the background.

Errors

The error body matches OpenAI's shape. See Errors and retries for the type values and retry semantics.

cURL
curl https://gateway.amux.ai/v1/images/edits \
  -H "Authorization: Bearer $AMUX_API_KEY" \
  -F "model=x-ai/grok-imagine-image-quality" \
  -F "prompt=<string>" \
  -F "image=@/path/to/image.png" \
  -F "n=1" \
  -F "aspect_ratio=1:1" \
  -F "image_size=1K" \
  -F "moderation=auto" \
  -F "user=<string>"
{
  "created": 1786000000,
  "data": [
    {
      "url": "<string>"
    }
  ],
  "usage": {
    "output_images": 0,
    "input_images": 0
  },
  "amux": {
    "task_id": "<string>",
    "generation_id": "<string>",
    "provider": "<string>",
    "cost_nano": "<string>",
    "images": [
      {
        "index": 0,
        "url": "<string>"
      }
    ],
    "notes": [
      "<string>"
    ]
  }
}