How do I get a Mage API key?
Open API → API Keys, click Create API key, name it, and click Create key. Copy it immediately before closing the dialog: keys start with mage_sk_ and are shown only once.
Include your key on every request as Authorization: Bearer mage_sk_.... Buy any Gem pack or membership first to activate API access (free sign-up Gems work in the web app only).
Making your first request
Send a POST request to a model’s generate endpoint under https://api.mage.space/v1 with your prompt and parameters. The API returns a request ID and status/cancel URLs right away. Poll until complete, then download the output. Follow the API quickstart or test models live in the Playground.
Key limits and security
- Create up to 10 active keys per account (use one per app or environment so you can revoke independently; revoked keys don’t count toward the limit).
- Keep keys server-side: never ship a key in browser or client code, source control, logs, or URLs.
- Leaked or lost a key? For security, Mage can’t display an existing key again. Revoke it immediately and create a new one.
Common questions
Why does my API key return `402 payment_required`?
API access unlocks after your first completed payment (any Gem pack or membership). Keys you created beforehand start working right after payment.
How many API generations can run at the same time?
Up to 20 concurrent generations per account. Additional requests return 429 without charging Gems.
Share feedback
Was this article helpful?
Thanks for the feedback.