Amux

Create task

Last updated September 12, 2026

Submit an async task for openai/gpt-image-2.5-flare. One endpoint for both generation and editing — send a reference image and it edits.

Submit openai/gpt-image-2.5-flare work to /v1/tasks: an id is returned immediately and the work proceeds in the background.

This endpoint does not split generation from editing — omit image and it generates, send one and it edits. The parameters are identical in both cases, hence the single page.

The parameter table below is the multipart/form-data shape, which is the superset. Without reference images the same fields can be sent as JSON.

POSThttps://gateway.amux.ai/v1/tasks

Authorization

header
AuthorizationstringRequired

Bearer <your Amux key> Your Amux API key.

Request

multipart/form-data
modelstringRequired

A catalog model ID.

promptstringRequired

What you want. With a reference image it describes the edit.

imagearray<string>

Reference images. At most 16, 25MB each.

Both image and image[] are accepted. OpenAI SDKs typically send

the first for a single image and the second for several.

maskstring

A mask; transparent areas mark what to change. Three hard rules:

1. It must be a PNG with an alpha channel (add one if starting

from grayscale);

2. Same dimensions as the image, and under 4MB — the mask has its

own, much tighter limit than a reference image (we cap those at 25MB);

3. With several reference images it applies only to the first.

This field is only meaningful alongside a reference image. On its

own, it is ignored and noted in amux.notes.

nintegerDefault 1

How many images. Maximum 10.

sizestringDefault "1024x1024"

1024x1024 / 1536x1024 / 1024x1536 / 2048x2048 / 2048x1152 / 3840x2160 / 2160x3840 / auto (default), or any legal pixel string — same constraints as the generation endpoint.

aspect_ratiostring

1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 16:9 / 9:16. 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 / 2K / 4K. Used together with aspect_ratio; same rules.

quality"low" | "medium" | "high" | "xhigh" | "max" | "auto"Default "auto"

Quality tier. xhigh and max are new in 2.5 and sit above high.

background"transparent" | "opaque" | "auto"Default "auto"

transparent / opaque / auto. Transparency needs png or webp.

output_format"png" | "jpeg" | "webp"Default "png"

png, jpeg or webp.

output_compressionstring

Compression level; jpeg / webp only, defaults to 100.

userstring

End-user identifier for abuse monitoring.

webhook_urlstring

Where to POST the result once the task is terminal. https only, and never a private network.

moderation"auto" | "low"

Moderation level. Only applies without reference images — the upstream

edits endpoint has no such field, so with a reference image it is dropped

and reported in notes.

Response

200response

Already terminal (Prefer: wait caught it), or this is a replay

of the same idempotency key.

Kept apart from 202 deliberately: 202 means "I took this on", and

neither of these took on anything new.

202response

Accepted, and the reserve is held. Use the id to fetch the result.

400response

Invalid request. Also covers stream: true and partial_images above 0 —

this endpoint is asynchronous; for synchronous streaming use

/v1/images/generations.

402response

Available balance does not cover the upper-bound reserve.

503response

Too many tasks in flight; retry later (the response carries Retry-After).

Retrieving the result

MethodWhen it applies
PollGET /v1/tasks/{id}Simplest; poll every 2-5 seconds
Callbacksend webhook_urlWhen holding a connection is undesirable
Wait in placesend Prefer: wait=60When a synchronous result is wanted without polling

Task lifecycle, callback signing and verification, idempotency — these are the same for every model; see Create task.

When this endpoint is preferable

quality: max is slow: measured end to end, approximately 50 seconds at 3840x2160 and 55 seconds at 2048x2048. On the synchronous path, a timeout at any point in the chain (reverse proxy, gateway, client default) leaves the caller without an image after the charge has been incurred, which at max is material.

How this differs from the vendor-compatible endpoints

/v1/images/*/v1/tasks
Generation / editingtwo endpointsone, split by reference image
Deliverysynchronous (streamable)async + callback + optional wait
Compatibilityofficial OpenAI SDKs work unchangedAmux-specific shape

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/tasks \
  -H "Authorization: Bearer $AMUX_API_KEY" \
  -F "model=openai/gpt-image-2.5-flare" \
  -F "prompt=Make the fox wear a red scarf" \
  -F "image=@/path/to/image.png" \
  -F "size=1024x1024" \
  -F "webhook_url=https://hooks.example.com/amux"
{
  "id": "task_01M1CG35C16CJ790D00BV1RBVM",
  "status": "queued",
  "model": "openai/gpt-image-2.5-flare",
  "created_at": "<string>",
  "output": {
    "images": [
      {
        "index": 0,
        "url": "<string>"
      }
    ]
  },
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0
  },
  "cost": "0.2108",
  "error": {
    "message": "<string>",
    "code": "<string>"
  }
}