Skip to main content

Developers / Docs

Errors and limits

Error codes, HTTP status codes, rate limits, and the daily generation limit of the API.

Markdown version

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

CodeHTTPMeaning
unauthorized401No key, an unknown key, or a revoked key.
validation400A field is missing, has the wrong type, or is too long.
paywall402No active plan and no free generation left. Adds pricingUrl.
plan_required403A credit pack needs an active plan. Adds pricingUrl.
rate_limited429Too many requests. Adds retryAfterSeconds and sets the Retry-After header.
daily_limit429The account reached its daily API generation limit. Adds retryAfterSeconds.
moderation422The content check blocked the prompt. Adds reason and field when known.
provider502The image provider failed. No generation is charged.
timeout504The image provider took too long. No generation is charged.
not_found404The resource does not exist.
upload500POST /generations: the image upload failed. No generation is charged.
unknown500POST /generations: an unexpected error while the design was made.
server_error500An unexpected error.
authorization_pending, slow_down, access_denied, expired_token400Device 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/device 10 requests per minute per IP address, POST /auth/token 60 requests per minute per IP address.
  • Public gallery: 60 requests per minute per IP address.

Retry

  • On 429, wait for the number of seconds in retryAfterSeconds or the Retry-After header.
  • On 502 or 504, 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, or 422 requests again without a change.