curl and jq. You need a Mage account with Gems on it and the API tab in your settings.
1
Create a key
Open Settings → API, create a key, and copy it. The key starts with
mage_sk_ and is shown once; Mage keeps only a hash of it. Export it 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.Next steps
Requests and lifecycle
Statuses, polling, idempotency keys, cancellation, and results.
Models
Every model with its endpoint, fields, and price.
Inputs and uploads
Send images and video by URL, data URL, or upload.
Errors and retries
Every error code, what it means, and what to retry.

