curl and jq, to show each step of the API. You need a Mage account with a successful payment (any Gem pack or plan; the signup bonus does not cover the API) and access to API → API Keys.
1
Create a key
- Open API → API Keys. In Mage’s navigation, this is API (Beta), below Agent, then the API Keys tab.
- Select Create API key. In the popup, enter a Key name, such as
Production server, then select Create key. - The You’re ready to build popup shows your new key. Select Copy key and save it securely before closing the popup.
mage_sk_ and is shown only once; Mage keeps only a hash of it. The popup also includes an editable quick start and playground. To follow this command-line walkthrough, export the key in your shell:2
Submit a generation
Each model has its own endpoint, The response is the request’s current state. Gems are charged now, and Keep
POST /v1/{architecture}/generate. The body holds the fields you want to set; every other field keeps the model’s default. This call uses Flux 2.status_url is where to look next.request_id; everything else about the request is reached through it.3
Poll until it finishes
Read A completed request carries the output in
status_url every few seconds until status is completed, failed, or cancelled.result.4
Download the output
result.expires_at. Copy what you want to keep to your own storage.Cancel a request
A live request stops when youPOST to its cancel_url. The response is the request’s state afterwards. Gems are not returned for a cancelled request.
Try a video model
The same call reaches every model; only the endpoint and the fields change. This one runs Plum for five seconds at 16:9. Video takes longer than an image, so poll less often.Try an audio model
Seed Audio generates voices, dialogue, music, and sound effects as an MP3 of exactly theduration you ask for, from 5 to 120 seconds. The result’s type is audio, and its url is the MP3.
POST /v1/references and mention its handle in the prompt: "@radio-host reads the forecast".
The same field names mean the same thing on every model: aspect_ratio as W:H, first_image and last_image, resolution, duration. Each model’s reference page lists its fields, the values each one accepts, its defaults, and its price at those defaults. You can also open Playground and select Try this on a model to edit the request, try it in the playground, or copy it as cURL or as code for the TypeScript or Python SDK.
Next steps
TypeScript SDK
Typed configs, a call that waits for the result, and safe retries.
Python SDK
The same, with sync and asyncio clients.
Requests and lifecycle
Statuses, polling, idempotency keys, cancellation, and results.
Models
Every model with its endpoint, fields, and price.
Inputs and uploads
Send images, video, and saved audio clips to a model.
Errors and retries
Every error code, what it means, and what to retry.

