rl_test_…) first: it runs the whole flow, with real uploads, quotes, events and webhooks, against a fake pipeline that costs nothing. Switch to a live key when it works.
1
Get an API key
Sign in at
https://relettr.com, open API keys, and create a key. Copy it now: it is shown only once.2
Create the chapter
Declare each image in reading order (
index 1..N, top to bottom), with its exact content type and size in bytes. The response contains one upload URL per file.3
Upload the images
PUT each file to its URL with exactly the headers returned in uploads[].headers.4
Mark uploads complete
The server checks the images, cuts them into parts and computes the exact quote. The chapter becomes
ready.5
Start
Credits for the quote are held and the chapter joins the GPU queue.
6
Poll, then download
Poll until
succeeded, then fetch the result URLs.1. Create the chapter
Idempotency-Key is required here, so a retried request never creates a second chapter.
2. Upload the images
Upload straight to storage; noAuthorization header is needed on these URLs. They expire after 15 minutes. If they do, call POST /v1/chapters/{id}/upload_urls for new ones. Uploading a file again before step 3 replaces it.
The
Content-Type and size must match what you declared, or storage rejects the upload. Accepted formats: PNG, JPEG, WebP. See the limits.3. Mark uploads complete
ready; the chapter now has an exact quote:
4. Start
Starting holds the quoted credits and queues the chapter.Idempotency-Key is required. Pass max_credits to refuse a quote higher than you expect.
5. Poll
Poll every 30–60 s whilequeued and every 5–10 s while processing. Send the ETag back as If-None-Match to get a cheap 304 when nothing changed. Or skip polling and use webhooks.
needs_review, some zones could not be cleaned safely and exports are locked until you accept or fix them. See Chapter lifecycle.
6. Download the result
Result URLs are valid for 1 hour. Call the endpoint again for fresh ones.output.layout: "original") you get back one image per uploaded image, in the same order and at the same heights. The result also has a zip with every page plus regions.json, any warnings, and glossary_proposals for your series.
Next steps
- Series and glossary: keep names consistent across chapters.
- Webhooks: get notified instead of polling.
- Credits and pricing: how quotes, holds and refunds work.