REST
Your backend, your scripts, anything that speaks HTTP.
CLI
crl — terminals, CI, and coding agents.MCP
Claude Code, Cursor, any MCP client.
Quickstart
1
Create a key
In the studio, go to Settings → API and create a key with the
write scope. The
key is shown once — copy it now.2
Check it works
3
Generate something
4
Poll until it's done
queued → processing → succeeded, then output[0].url is your image.Result URLs are time-limited. Download the bytes rather than storing the link.
The shape of the thing
Generation is asynchronous, always
Generation is asynchronous, always
A photo takes ~30 seconds and a video several minutes, so no endpoint blocks on a run.
You get a job handle and poll it. The run is durable: it survives your process dying,
and you can rejoin it by id at any time.
The catalog is the source of truth
The catalog is the source of truth
Do not hardcode model ids or parameter names.
GET /v1/models
returns every tool, every model, and the exact inputs and parameters each accepts —
so a model added to the platform is usable from your code with no change on your side.Prices are visible before you pay
Prices are visible before you pay
POST /v1/generations/cost
prices a run without starting it, using the same function the debit uses. A failed or
moderation-blocked run is refunded automatically.Publishing goes through the review gate
Publishing goes through the review gate
A post is created at
pending_review and publishing is a separate, explicit call. If
you want a human to approve, simply never call publish — the post waits in the studio’s
review queue. See Publishing.