> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fanifyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Handle Fanify Hub Problem Details responses and stable error codes.

Hub routes return [Problem Details](https://www.rfc-editor.org/rfc/rfc9457) objects with the `application/problem+json` media type.

```json theme={null}
{
  "type": "https://fanifyai.com/docs/hub/errors#insufficient_credits",
  "title": "Insufficient credits",
  "status": 402,
  "detail": "Your available balance does not cover this generation.",
  "instance": "/api/v1/hub/generations",
  "code": "insufficient_credits"
}
```

Use `code` in application logic. Use `title` and `detail` for display.

| HTTP | Codes |
| - | - |
| 400 | `invalid_input` |
| 401 | `unauthorized` |
| 402 | `insufficient_credits` |
| 404 | `model_not_found`, `generation_not_found`, `resource_not_found` |
| 409 | `not_cancelable` |
| 410 | `file_expired` |
| 413 | `payload_too_large` |
| 422 | `no_route_available`, `idempotency_conflict` |
| 429 | `rate_limited` |
| 503 | `generation_in_progress`, `webhooks_not_configured` |
| 500 | `internal_error` |

A `429 rate_limited` response includes `Retry-After` in seconds. A `503 generation_in_progress` response always includes `Retry-After: 5`.

## Code details

<h3 id="invalid_input">
  `invalid_input`
</h3>

The request is invalid or contains an unsupported value. Correct it before retrying.

<h3 id="unauthorized">
  `unauthorized`
</h3>

The API key or console session is missing, invalid, or revoked.

<h3 id="insufficient_credits">
  `insufficient_credits`
</h3>

The available balance does not cover the generation estimate.

<h3 id="model_not_found">
  `model_not_found`
</h3>

The requested model does not exist or is unavailable in the Hub catalog.

<h3 id="generation_not_found">
  `generation_not_found`
</h3>

The requested generation does not exist for this account.

<h3 id="resource_not_found">
  `resource_not_found`
</h3>

The requested resource does not exist for this account.

<h3 id="not_cancelable">
  `not_cancelable`
</h3>

Only a generation that is still `queued` can be canceled.

<h3 id="file_expired">
  `file_expired`
</h3>

The file, output, or stored completion has expired or is no longer available.

<h3 id="payload_too_large">
  `payload_too_large`
</h3>

The uploaded file exceeds the configured limit.

<h3 id="no_route_available">
  `no_route_available`
</h3>

No configured route can execute the requested combination of parameters.

<h3 id="idempotency_conflict">
  `idempotency_conflict`
</h3>

The idempotency key was already used with a different request body.

<h3 id="rate_limited">
  `rate_limited`
</h3>

The request or concurrency limit has been reached. Wait for the duration indicated by `Retry-After`.

<h3 id="generation_in_progress">
  `generation_in_progress`
</h3>

A request with the same idempotency key is still running.

<h3 id="webhooks_not_configured">
  `webhooks_not_configured`
</h3>

The webhook service is unavailable.

<h3 id="internal_error">
  `internal_error`
</h3>

An unexpected error occurred. The response does not expose internal details.

## Errors stored with a generation

In V1, a generation's `error` object can contain the stable codes `content_moderated`, `provider_error`, `queue_timeout`, or `interrupted`. A provider can also pass through a code specific to its API.

`missing_resource` is reserved for a future version and is never produced in V1. An unresolved `sha256:` reference currently returns `400 invalid_input` during submission.

<Note>
  Most `/api/v1/hub/chat/completions` errors use an OpenAI-compatible envelope. The `401 unauthorized` authentication failure occurs before chat processing and remains a Problem Details response.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.