Install. Add your key. Make something extraordinary.
01
Install the official TypeScript SDK. Node.js 20.19 or later, with typed configs and no runtime dependencies.
npm install @mage-space/sdk02
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.
import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
const request = await mage.run('mango', {
prompt: 'Editorial portrait in soft daylight, 35mm film look',
aspect_ratio: '4:5',
model_id: 'mango-v3',
});
console.log(request.result.url);Uploads, saved characters, retries, and more.