Make pictures from a prompt, and fetch them when they are ready.
Every request carries a token: `Authorization: Bearer <token>`. You make yours on your settings screen in Arles, it is shown once, and making a second one replaces the first.
Asking for a round answers straight away with the round, not with a picture. Ask about the round again until it says done, then fetch its images. About once a second is right.
You reach your own work and nothing else. Somebody else's round or picture answers 404, never 403.
Sixty requests a minute per token. Every answer carries `X-RateLimit-Limit` and `X-RateLimit-Remaining`, so a loop can pace itself without counting, and a 429 carries `Retry-After`. Your role sets the best quality and the largest number of images one round may ask for, and the service clamps whatever you send to it rather than refusing.
Errors are JSON with a `message`. 401 means the token is missing or no longer good, 404 means it is not there or not yours, 422 means the request was wrong, 429 means too many requests.
The account behind the token, its role, and what a round of yours may ask for.
Ask this first. It tells you the ceilings the service will clamp your round to, so you do not have to guess them.
Every session of yours, most recently used first.
A session is one piece of work and holds the rounds that belong to it. Use this to find the id to send with a round, so related work stays together.
Make a session with a name of your choosing.
Optional. A round sent with no session makes one, and a language model names it from the first prompt.
name
string
optional
Every round in one session of yours, most recent first, a page at a time.
This is how you find work you made earlier without having kept the ids. A page holds twenty five rounds unless you ask for another number, and the answer carries the usual links and meta so you can walk through the rest.
session integerper_page integerAsk for a round. The prompt is the only thing you must send.
A round is queued and answered at once with its id: making an image takes about ten seconds and the image service does one at a time, so nothing here waits for a picture. Ask for the round again to see how it is getting on.
prompt
string
required
quality
string
optional
images
integer
optional
size
string
optional
session
integer
optional
The state of one round and the pictures it has made so far.
Queued, running, done, failed or cancelled. The images arrive one at a time, so this can answer with some of them while the round is still running. While a round is unfinished it also carries `queue_position`, how many rounds are in front of it, and `estimated_wait_seconds`, roughly how long until it has made its last image. Both are null once it is finished. Poll on the wait rather than every second: the estimate is arithmetic at about ten seconds an image and does not know that a service which has been idle spends about two minutes forty loading its weights first.
round integerThe PNG itself.
The bytes, not a link to them. Add /thumbnail for a small one.
image integer