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

# Errors

> Handle Nylon API errors consistently.

Nylon uses standard HTTP status codes and returns errors as JSON.

```json theme={null}
{
  "error": {
    "code": "unauthorized",
    "message": "A valid Nylon API key is required."
  }
}
```

## Common status codes

| Status | Meaning                                                     |
| ------ | ----------------------------------------------------------- |
| `400`  | The request is malformed or contains invalid parameters.    |
| `401`  | The API key is missing, invalid, or revoked.                |
| `404`  | The requested resource does not exist or is not accessible. |
| `429`  | Too many requests were sent in a short period.              |
| `500`  | Nylon encountered an unexpected error.                      |

## Recommended handling

* Do not retry `400` or `401` responses without changing the request or credentials.
* Retry `429` and temporary `5xx` responses with exponential backoff.
* Log the status and error code, but never log the API key.
* Use the error `message` for diagnostics, not as a stable programmatic identifier.
