Fittins AI Logo
API docs menu

Get started

Errors

Errors use HTTP status codes and one JSON shape. code is stable and safe to branch on; message is written for people and may change. param names the field when one field is wrong.

402 Payment Required
{
  "error": {
    "type": "credits_error",
    "code": "insufficient_credits",
    "message": "This photo needs 60 credits and 38 are available. Buy a credit pack or upgrade your plan.",
    "param": null,
    "request_id": "req_6RkP2wQ9mT3xLc8B",
    "doc_url": "https://fittins.ai/docs/api/errors#insufficient_credits"
  }
}
HTTPcodeWhen
400invalid_requestA field is missing or wrong. `param` names it, for example `product_images[0].url`.
400invalid_imageA product photo is not a PNG, JPEG or WebP, is larger than 10 MB, or its URL can't be downloaded within 15 seconds.
401invalid_api_keyThe key is missing, unknown or revoked.
402insufficient_creditsNot enough credits, counting generations still running or queued.
403api_not_in_planThe account's plan doesn't include the API (Pro and up do).
403not_in_planThe tier isn't in the account's plan, for example `ultra` on Pro. `param` names the field.
403storage_fullThe account's storage is full.
404not_foundUnknown endpoint, or an id that isn't in our library or this account.
405method_not_allowedThe endpoint exists but not with this HTTP method.
409idempotency_conflictThe same Idempotency-Key was used with a different request body.
422content_flaggedThe product was flagged as sensitive, such as lingerie or swimwear. Not charged.
422protected_contentThe photo shows a brand logo or a well-known character. Not charged.
429rate_limitedToo many requests with one key. Wait the seconds in `Retry-After`.
429concurrency_limitThe account already has 5 generations running or queued (shared with the website).
502generation_failedThe generation didn't finish because of a temporary problem. Not charged; safe to retry.
500internal_errorA problem on our side. Not charged; we are alerted.

A generation that fails after it was accepted carries the same codes in its error field. A failed or refused generation is never charged.

Questions? Email support@fittins.ai with the X-Request-Id of the request.Next: Limits →