Going to production
- One key per environment and per service, named so you can tell them apart. Revoking one never affects the others.
- Keys only on your server, never in a browser, a mobile app or a repository. Read them from
REMODELED_API_KEYor your secret store. - A credit limit on each key that matches its budget for 30 days. A leaked key can never spend more than that. A limit of 0 makes a read-only key.
- Choose a quality on purpose. Quick costs 2 credits, Standard 5 and Best 12 (pricing). Quick is good for previews, with Best only for the image a customer keeps.
- Watch
GET /public/v1/account:credits.availablefor the account, andkey.creditsLeftfor this key. Alert before either runs out, and handle402 insufficient_creditsand402 key_limit_reachedwith a clear message to your users. - Failed designs are refunded automatically (
creditsCharged: 0). There is nothing to reconcile.
Retries
Section titled “Retries”- Send an
Idempotency-Keywith every design start, made from your own ids (for examplelisting-4471-photo-3). Then a retry, a crash or a double click never pays twice. The SDKs add a random one if you don’t. - Retry
429afterRetry-After, and5xxwith backoff. The SDKs do this (2 retries by default;maxRetries/max_retries). - Don’t retry
4xxother than 429: the request itself needs fixing.error.codesays what is wrong (errors).
Results
Section titled “Results”- Use a webhook for anything that runs without a person waiting. Check the signature, answer within 5 seconds, and skip event ids you have seen.
- Copy images you keep to your own storage.
- Keep your own record of design ids, or put your ids in
metadata, so you can match results to your data.
Limits
Section titled “Limits”- Stay within 120 requests a minute and 20 design starts a minute per key (rate limits). Use several keys for more, or write to us.
- Use
Prefer: waitor webhooks rather than polling in a tight loop.
Support
Section titled “Support”- Log
X-Request-Idfrom every error answer (requestIdin the TypeScript SDK,request_idin Python). Quote it when you write to support and we can find the exact request.