# Errors

Errors use ordinary HTTP status codes and a JSON body that says what went wrong.

## Shape

Every error has a `detail` you can show to a person. Credential and limit errors also carry an `error` code you can branch on.

**400**

```json
{
  "detail": "Unknown filter 'powertrain'. Filters here: country, powertrain_kind, q."
}
```

**429**

```json
{
  "error": "DAILY_BUDGET_EXHAUSTED",
  "detail": "Public site has spent its 1000 credits for 2026-10-02. The budget resets at 2026-10-03T00:00:00Z, in 44129s. It is shared by every key on the account.",
  "credits_used": 1000,
  "credits_per_day": 1000,
  "resets_at": "2026-10-03T00:00:00Z"
}
```

## Status codes

| Status | Code | Means |
|---|---|---|
| 400 | | A filter, operator, sort key, cursor or value is not valid. `detail` names it and lists what is. |
| 401 | `INVALID_CREDENTIAL` | No key, or one that is unknown, revoked, expired or on a disabled account. |
| 404 | | No published record matches that id or slug. |
| 422 | | A parameter has the wrong type, such as `limit=abc` or a limit above 200. |
| 429 | `DAILY_BUDGET_EXHAUSTED` | The account has spent its daily credits. `Retry-After` points at the reset. |
| 429 | `RATE_LIMITED` | More than 100 requests in a minute, counted per account. |

## What an error costs

Nothing. Only a successful answer is charged, so a `400`, a `404` or a `429` leaves your balance where it was. Every answer says what it cost in the `X-Credits-Charged` header.

## Retrying

A `429 RATE_LIMITED` carries a `Retry-After` of a few seconds. A `429 DAILY_BUDGET_EXHAUSTED` carries one measured in hours, because a daily quota is not a rate limit: backing off by seconds would spend the rest of the day discovering that one request at a time. A `400`, `401` or `404` will not change on retry.
