API keys
Send your key as a bearer token on every request:rl_live_… (real work, real credits) or rl_test_… (test mode). Each key ends in a short checksum, so a mistyped key is rejected straight away with 401 api_key_invalid.
Who can create keys. Anyone signed in to Relettr who has credits can create API keys, on the site under API keys. Keys can’t be created through the API. A key is shown once, when you create it; we store only a hash of it.
Welcome credits are for the website. Live API usage needs purchased credits. Test keys are always free.
401 api_key_revoked.
Scopes
Each key has a set of scopes. A request without the right scope gets403 scope_missing.
New keys get
chapters:write, series:write, webhooks:write and billing:read by default. POST /v1/estimate works with any valid key.
Spend limits
You can give each key an optional monthly credit limit on the site, and set one for the whole account. Limits are checked when a chapter starts, against credits charged plus credits held this calendar month (UTC).- At the limit, new starts return
402 spend_limit_reachedwithscope(keyoraccount),limitandused_this_month. - The
api_key.spend_limit_reachedevent fires once. - Chapters already running always finish.
Test mode
Test keys (rl_test_…) let you build and test your integration for free.
- Separate data. Test keys see only test objects and live keys only live objects. Using one with the other’s id returns
404, or403 test_key_live_object/live_key_test_objectwhen it’s clearly a mix-up. Webhook endpoints, events and ledgers are separate too. - Test balance. Each account has 10,000 test credits. Set it with
POST /v1/test_helpers/balance, for example to0to test a402. - Real validation, fake processing. Uploads, image checks, part cutting and quotes work exactly as in live mode, so integration bugs show up. Processing then runs a fake pipeline (no GPU, no translator) that goes
queued → processing → succeededin about 20 seconds. Results are your own images with a “TEST MODE” band, and regions contain placeholder text such as[test] line 3. - Real events. Ledger entries, events and webhook deliveries are real and signed.
- Test data may be cleared at any time.
Test scenarios
Passtest_scenario when creating a chapter with a test key to exercise failure paths. Live keys reject the field with 400.