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

> ## Agent Instructions
> Call https://api.feyn.ai only; the hosts behind it are not public.
> Authenticate with a workspace API key in the Authorization header: `Authorization: Bearer fn_...`. Keep keys server-side.
> For chat completions, use the official OpenAI SDK with base_url https://api.feyn.ai/v1 and a model ID from GET /v1/models.
> On 429, wait for the Retry-After header before retrying. Failed requests are not charged.

# Errors

> Status codes, error types, and which ones to retry.

Errors from the API itself have an OpenAI-style body:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "error": { "message": "invalid API key", "type": "auth_error" } }
```

| Status | Type | Meaning | Retry? |
| - | - | - | - |
| `400` | `invalid_request_error` | The request is malformed, or a required field or header is missing | No |
| `401` | `auth_error` | Missing or invalid API key | No |
| `402` | `billing_error` | Billing is not active, or the workspace is out of [credits](https://docs.usefeyn.com/account/credits.md) | After adding credits |
| `403` | `permission_error` | The model is available on a contract only | No |
| `404` | `invalid_request_error` | Unknown model, or a private model your workspace cannot call | No |
| `409` | `invalid_request_error` | A project with that key already exists | No |
| `429` | `rate_limit_error` | Over the [rate limit](https://docs.usefeyn.com/account/rate-limits.md); see `Retry-After` | Yes, after `Retry-After` |
| `502` | `api_error` | No healthy model replica answered | Yes, with backoff |
| `503` | `api_error` | A dependency is briefly unavailable | Yes, with backoff |

## Errors from a model

When Pulpie or MultiMatte rejects the input itself, the status and body come from the model service, with a `detail` string instead of `error`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "detail": "Image exceeds the 5 MB upload limit" }
```

| Status | Meaning |
| - | - |
| `413` | The input is over the size limit. A body over 8 MB is rejected by the API before it reaches the model, without a JSON body |
| `415` | The input type is not supported |
| `422` | The input could not be read: bad base64, an image that won't decode, a PDF without a text layer |
| `503` | The model is loading; retry |

These requests are not charged.


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