Skip to main content
POST
cURL
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.

Common fields

The same field names mean the same thing on every model. aspect_ratio is a W:H ratio such as 16:9; first_image and last_image are the frames a video starts and ends on; image and additional_images are reference images; video or videos is the source video; resolution and duration are tokens from the model’s lists. A model’s page lists which of these it takes and the values it accepts. A setting a model does not have is not an error: it passes through like any unknown field, and the model ignores it. A config copied from the app is accepted as it is.

Authorizations

Authorization
string
header
required

Create a key in API → API Keys: select Create API key, name it in the popup, then select Create key. Copy the one-time key and send it 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,
moss_image,
minimax_h3,
magejutsu,
z_image,
stable_diffusion_xl,
kiwi,
blueberry,
wan_22,
flux2,
chroma,
hidream,
ltx_video,
stable_diffusion_v15,
stable_diffusion_v35_large,
guava,
nano_banana_v2,
sdxl_plus,
cherry,
raspberry,
grok_image,
grok_video,
berry,
gpt_image_2,
anima,
melon,
seed_audio,
eleven_speech,
eleven_music,
plum,
lemon

Body

application/json

A partial config for the architecture.

prompt
string
required

The text prompt. An @handle in it attaches one of your saved characters or references.

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.

aspect_ratio
string

The output aspect ratio as W:H (16:9), on models that have one; each model lists its ratios.

first_image
string

The first frame image, on models that start a video from one. An https URL or a data URL.

last_image
string

The last frame image, on models that end a video on one. An https URL or a data URL.

resolution
string

The output resolution token, on models that offer one; each model lists its tokens.

duration
string

The clip length in seconds as a token, on video and audio models that offer one; each model lists its tokens.

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 26, 2026