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"
}
}| HTTP | code | When |
|---|---|---|
| 400 | invalid_request | A field is missing or wrong. `param` names it, for example `product_images[0].url`. |
| 400 | invalid_image | A product photo is not a PNG, JPEG or WebP, is larger than 10 MB, or its URL can't be downloaded within 15 seconds. |
| 401 | invalid_api_key | The key is missing, unknown or revoked. |
| 402 | insufficient_credits | Not enough credits, counting generations still running or queued. |
| 403 | api_not_in_plan | The account's plan doesn't include the API (Pro and up do). |
| 403 | not_in_plan | The tier isn't in the account's plan, for example `ultra` on Pro. `param` names the field. |
| 403 | storage_full | The account's storage is full. |
| 404 | not_found | Unknown endpoint, or an id that isn't in our library or this account. |
| 405 | method_not_allowed | The endpoint exists but not with this HTTP method. |
| 409 | idempotency_conflict | The same Idempotency-Key was used with a different request body. |
| 422 | content_flagged | The product was flagged as sensitive, such as lingerie or swimwear. Not charged. |
| 422 | protected_content | The photo shows a brand logo or a well-known character. Not charged. |
| 429 | rate_limited | Too many requests with one key. Wait the seconds in `Retry-After`. |
| 429 | concurrency_limit | The account already has 5 generations running or queued (shared with the website). |
| 502 | generation_failed | The generation didn't finish because of a temporary problem. Not charged; safe to retry. |
| 500 | internal_error | A 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 →