Error format
Every error is JSON with the HTTP status that matches the code:
{ "error": "No generations left. Buy a plan to keep generating.", "code": "paywall", "pricingUrl": "https://inkstudioai.com/pricing" }
Some codes add fields, as the table shows.
Error codes
| Code | HTTP | Meaning |
|---|---|---|
unauthorized | 401 | No key, an unknown key, or a revoked key. |
validation | 400 | A field is missing, has the wrong type, or is too long. |
paywall | 402 | No active plan and no free generation left. Adds pricingUrl. |
plan_required | 403 | A credit pack needs an active plan. Adds pricingUrl. |
rate_limited | 429 | Too many requests. Adds retryAfterSeconds and sets the Retry-After header. |
daily_limit | 429 | The account reached its daily API generation limit. Adds retryAfterSeconds. |
moderation | 422 | The content check blocked the prompt. Adds reason and field when known. |
provider | 502 | The image provider failed. No generation is charged. |
timeout | 504 | The image provider took too long. No generation is charged. |
not_found | 404 | The resource does not exist. |
upload | 500 | POST /generations: the image upload failed. No generation is charged. |
unknown | 500 | POST /generations: an unexpected error while the design was made. |
server_error | 500 | An unexpected error. |
authorization_pending, slow_down, access_denied, expired_token | 400 | Device login states. See Authentication. |
Streamed generations use other codes in their error event. See Generate tattoo designs.
Limits
- Each API key: 60 requests per minute.
- Each account: 50 API generations per UTC day. The count starts again at midnight UTC.
- Device login:
POST /auth/device10 requests per minute per IP address,POST /auth/token60 requests per minute per IP address. - Public gallery: 60 requests per minute per IP address.
Retry
- On
429, wait for the number of seconds inretryAfterSecondsor theRetry-Afterheader. - On
502or504, you can send the request again. The failed request did not use a generation. - On
500, you can send the request again once. A failed image or upload gives the generation back. If the error repeats, stop and report it. - Do not send
400,401,402,403, or422requests again without a change.