# Errors and rate limits

Both HTTP APIs return JSON error bodies with an `error` string. Limits are per client IP.

## Pay-per-call API errors

| Status | When | Body |
| --- | --- | --- |
| `400` | The `date` parameter is not a valid date. Nothing is charged. | `{"error": "date must be YYYY-MM-DD", "flightNumber": "QF1", "flightDate": "bad"}` |
| `402` | No `X-PAYMENT` header, the header is not valid base64 JSON, or the facilitator rejects the payment. | `{"x402Version": 1, "error": "...", "accepts": [...]}` |
| `404` | No live seat map is available for this flight and date, the airline is not covered, or the airline does not publish a seat map. Nothing is charged. | `{"error": "No live seat data is available for this flight.", "flightNumber": "QF1", "flightDate": null}` |
| `404` | The pay-per-call API is not enabled on the server. | `{"error": "Not found"}` |
| `429` | Rate limit reached. | Rate limit body, below |

## Free lookup API errors

| Status | When | Body |
| --- | --- | --- |
| `400` | The flight number cannot be parsed. | `{"error": "Invalid flight number format. Use format like AA123 or BA456."}` |
| `400` | `flight_date` is not a valid date. | `{"error": "Invalid date format. Use YYYY-MM-DD."}` |
| `404` | The flight is not found. | `{"error": "Flight ZZ999 not found."}` |
| `404` | The airline is not found. | `{"error": "Airline with IATA code 'ZZ' not found."}` |
| `429` | Rate limit reached. | Rate limit body, below |

## Rate limits

Limits are per client IP address.

| Scope | Limit |
| --- | --- |
| `/api/v1` (pay-per-call API) | 20 requests per minute |
| `/api/chatgpt` (free lookup API) | 30 requests per minute |
| All site requests, except static assets and MCP requests | 200 requests per 5 minutes |

The `/api/v1` limit counts every request, including unpaid `402` probes.

### The 429 response

Over the limit, the server returns `429 Too Many Requests` with a `Retry-After` header in seconds and a JSON body:

```json
{
  "error": "Rate limit exceeded",
  "retry_after": 8,
  "message": "Too many requests. Please wait 8 seconds."
}
```

Wait for the number of seconds in `Retry-After`, then retry.

## MCP server errors

The MCP server returns tool errors inside the MCP protocol. At the HTTP layer:

| Status | When |
| --- | --- |
| `401` | No valid OAuth bearer token. The `WWW-Authenticate` header points to the protected resource metadata. |
| `403` | The token lacks the scope the tool needs (`insufficient_scope`). |
| `413` | The request body is larger than 4 MB. |
| `429` | A rate limit or the account's daily tool call cap was reached. Check `Retry-After`. |

The MCP limits are in [MCP server](https://flightseatmap.com/docs/mcp#rate-limits).

---

Source: https://flightseatmap.com/docs/api/errors
