Quickstart
Make your first render in four steps. Copy each snippet, run it, and move on.
What you need: an mnml.ai account, $10 or more to top up your API wallet (your first top-up adds $5 free), and a terminal with
curl, or any HTTP client.Step 2: Create an API key
Open API keys in the console, create a key and copy it. It is shown only once, so save it as an environment variable now.
export MNML_API_KEY=mk_live_…Step 3: Send a render
Send an image and a prompt. The answer comes straight away with a job
id, and charges $0.2475 for v4.6.curl -X POST https://api.mnml.ai/v2/renders \ -H "Authorization: Bearer $MNML_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "engine": "v4.6-ultra", "mode": "exterior", "image": "https://example.com/massing.png", "prompt": "Timber facade, late afternoon, olive trees" }'{ "success": true, "data": { "id": "10482", "status": "queued", "charged_usd": 0.2475, "credits_charged": 25, "replayed": false, "notes": [], "ids": [ "10482" ] }}Step 4: Get the result
Ask for the job every few seconds. When its
statusissucceeded,outputs[0].urlis your render: download it, as the link expires after an hour or two.curl https://api.mnml.ai/v2/jobs/10482 \ -H "Authorization: Bearer $MNML_API_KEY"
A job that fails is refunded. Read Jobs and polling for every status.
Or use an SDK
The official SDKs make the same calls, wait for the job for you, retry safely and verify webhooks. Each reads your key from MNML_API_KEY.
| Language | Install | Source |
|---|---|---|
| TypeScript | npm install @mnml-ai/sdk | github.com/mnml-ai/mnml-sdk-typescript |
| Python | pip install mnml-ai | github.com/mnml-ai/mnml-sdk-python |
| PHP | composer require mnml-ai/sdk | github.com/mnml-ai/mnml-sdk-php |
| Go | go get github.com/mnml-ai/mnml-sdk-go | github.com/mnml-ai/mnml-sdk-go |
| C# and .NET | dotnet add package Mnml.Sdk | github.com/mnml-ai/mnml-sdk-dotnet |
import { Mnml } from '@mnml-ai/sdk'; const mnml = new Mnml(); // reads MNML_API_KEY const [job] = await mnml.renders.createAndWait({ mode: 'exterior', image: 'https://example.com/massing.png', // or the file's bytes: await readFile('massing.png') prompt: 'Timber facade, late afternoon light, olive trees',});console.log(job?.status, job?.outputs[0]?.url);More recipes for each language are on the SDKs page.