Skip to main content
POST
Generate
Submit a generation. The body is a partial config for the architecture in the path: it is layered onto the architecture’s default config, so every field you leave out keeps its default. Each model page lists the fields its architecture accepts, with tokens and defaults; the same schema comes back from GET /v1/architectures as input_schema. The response is the request’s current state, with status_url to poll and cancel_url to stop it. Gems are charged when the request is accepted; a request that fails is refunded. See Requests and lifecycle for what happens next. This page documents the endpoint in general. For a specific model, open its page under Models: the playground there is filled in with that model’s fields.

Authorizations

Authorization
string
header
required

An API key from Settings → API, sent as Authorization: Bearer mage_sk_…. Keys are for server-side code only.

Headers

Idempotency-Key
string

A key of your choosing, 1 to 255 characters, scoped to your API key. A retried submit with the same key returns the original request with 200 instead of charging again. The key identifies the first submission made with it; later bodies are not compared. A refusal recorded under the key (its envelope carries request_id) replays the same way, so a new attempt needs a new key.

Required string length: 1 - 255

Path Parameters

architecture
enum<string>
required

The architecture id, from the catalog.

Available options:
mango,
krea_2,
minimax_h3,
z_image,
stable_diffusion_xl,
kiwi,
peach_max,
blueberry,
wan_22,
wan,
flux2,
flux,
chroma,
peach,
qwen_image,
qwen_image_edit_plus,
hidream,
framepack,
ltx_video,
selfie,
stable_diffusion_v15,
stable_diffusion_v35_large,
stable_diffusion_v35_medium,
veo3,
veo3_1,
flux_kontext_dev,
guava,
nano_banana_v2,
sdxl_plus,
cherry,
raspberry,
grok_image,
grok_video,
berry,
gpt_image_2,
anima,
melon,
plum,
lemon

Body

application/json

A partial config for the architecture.

prompt
string
required

The text prompt.

Minimum string length: 1
model_id
string

The model variant; the architecture default when omitted.

seed
integer | null

Integer seed for reproducible output; omit or send null for a random seed.

Response

The request was accepted; poll status_url for the result. A retried submit whose Idempotency-Key was used before answers 200 with the same shape, the original request, and charges nothing.

request_id
string<uuid>
required

The request id, also the id in status_url and cancel_url.

status
enum<string>
required

queued and in_progress are live; completed, failed, and cancelled are final.

Available options:
queued,
in_progress,
completed,
failed,
cancelled
architecture
string
required

The architecture the request generates with.

model_id
string | null
required

The model variant, when the architecture has variants.

created_at
string<date-time>
required

When the request was accepted.

updated_at
string<date-time>
required

When the request last changed.

billing
object
required
result
object | null
required

The output once status is completed, else null.

error
object | null
required

Why the request failed once status is failed, else null.

status_url
string<uri>
required

Poll this URL for the request.

cancel_url
string<uri>
required

POST to this URL to stop the request.

Last modified on September 17, 2026