Base URL
Authentication
Every endpoint requires a bearer API key:Content types
Requests are JSON (Content-Type: application/json). Generation responses
stream as server-sent events (text/event-stream); error responses are JSON.
Unknown request fields are ignored.Idempotency
Send an optionalIdempotency-Key header (1–255 characters, any format -
UUIDs work well) to make a request safely retryable:- If a request with the same key completed within the last 24 hours in
your workspace, the retry replays the stored outcome without generating or
billing again: the finished SVG as a single
deltaframe, then thesaved(orsave_error) anddoneframes. Replayed responses carry anIdempotency-Replayed: trueheader. A workspace with zero data retention stores no result: its replay is a single{"type":"done","retention":"none","note":"not_retained"}event, still unbilled, with no image. - If the original request is still in progress, the retry receives a
409- wait, then retry the same key for the stored result. - If the original request failed, the key is released and can be reused.
- A key is bound to the body it was first used with. The same key with a
different
prompt,imagesorparentAssetIdis rejected with422and"code": "idempotency_key_reused", so a reused key can never hand back the wrong image. Use a new key for a new request. - Keyed requests depend on the idempotency store, but the store never takes
the API down. If it cannot take a key, the request is generated like one
without a key and the response carries the header
Idempotency-Unavailable: true: that result is not stored, so retrying it is a new, billed generation. Check the header before retrying.
Rate limits
Requests are limited per API key and per workspace over a sliding 60-second window (the workspace limit spans all keys and dashboard traffic combined). The default per-key limit is 120 requests/minute and the workspace limit 600 requests/minute; contact us if you need more.When a limit is exceeded the API responds with429 and a Retry-After header giving the seconds to wait. A
rejected request does not count against the window, so waiting out
Retry-After is always enough. Successful responses carry no rate-limit
headers.Billing
Each generation debits your workspace’s credit balance at a flat per-image price. The price is reserved before the stream starts: when the balance can’t cover it (or a payment on the workspace is under dispute) the API responds with402 and nothing streams. A generation that ends
in an error frame is refunded, so a failed stream never costs credit. A
generation that produced an SVG is billed even if your connection dropped
before you read it; retry with the same Idempotency-Key to get it back
without paying again. Manage balances and top-ups from the
dashboard billing page.