Install. Add your key. Make something extraordinary.
01
Install the official Python SDK. Python 3.10 or later, with both sync and async clients.
pip install mage-space02
Create an API key and set it in your environment. Keep it on your server. Every request uses your Mage Gems balance.
export MAGE_API_KEY="mage_sk_..."03
One call submits your request, waits for the result, and returns your finished creation. Download anything you want to keep within 30 days.
from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
request = mage.run("mango", {
"prompt": "Editorial portrait in soft daylight, 35mm film look",
"aspect_ratio": "4:5",
"model_id": "mango-v3",
})
print(request["result"]["url"])Uploads, saved characters, retries, and more.