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

# Errors

> Interpret Goldenfish HTTP errors and decide whether to fix, retry, or escalate a request.

Errors use a consistent JSON envelope:

```json theme={null}
{
  "error": {
    "message": "Rate limit exceeded.",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "param": null
  }
}
```

## Error fields

| Field | Meaning |
| - | - |
| `error.message` | Human-readable explanation for logs and operator feedback. |
| `error.type` | Broad category for program logic. |
| `error.code` | Stable machine-readable reason when available. |
| `error.param` | Request parameter associated with the error, or `null`. |

Use the HTTP status and `error.type` in program logic. Messages can be improved or localized by the service.

## Status codes

| Status | Type | What to do |
| - | - | - |
| `400` | `invalid_request_error` | Fix the JSON, required fields, or choice/catalog rules before retrying. |
| `401` | `authentication_error` | Check whether a bearer key is required, valid, and sent server-side. |
| `404` | Resource-specific | Check the model or catalog ID and the environment you are calling. |
| `429` | `rate_limit_error` | Honor `Retry-After` when present and retry with bounded backoff. |
| `503` | `server_error` or unavailable | Treat the service or model as temporarily unavailable and retry safely. |

## Invalid request examples

Common causes of `400` include:

* Missing `model`, `input`, or `instruction`.
* Sending both `choices` and `catalog`.
* Sending neither `choices` nor `catalog`.
* Providing fewer than two choices, more than 300 choices, or duplicate choices.
* Sending an empty string where the schema requires a non-empty string.

## Authentication errors

Catalog creation, reads, and deletion require a bearer key in the current contract. When a key is missing or invalid, handle `401` as a configuration error rather than retrying the same request.

## Resource not found

`GET /v1/models/{model}` returns `404` when the model is not available. Catalog reads and deletes return `404` when the catalog does not exist or is not available to the authenticated account.

## Debugging a failed request

1. Save the HTTP status and `error.code`.
2. Capture `X-Request-ID` if the response includes it.
3. Record the operation and model without logging secrets.
4. For `400` or `401`, fix the request or configuration.
5. For `429` or `503`, apply the retry policy from [production checklist](/guides/production-checklist).

<Warning>
  Do not log bearer tokens or full user input by default. Request IDs are enough for Aspas Labs support to start tracing a call.
</Warning>


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