# Authentication and payment

There are no API keys. The free API needs nothing. The pay-per-call API uses an x402 payment header instead of an account.

## Free lookup API

The `/api/chatgpt` routes need no authentication, no API key and no account. They are limited to 30 requests per minute per IP.

## Pay-per-call API: x402

The `/api/v1` routes use the [x402](https://x402.org) protocol, version 1, with the `exact` scheme. Each live seat map costs one payment. Anyone with a wallet that holds USDC can pay. No account is needed.

| Field | Value |
| --- | --- |
| Price | $2.99, quoted as `2990000` atomic USDC units (USDC has 6 decimals) |
| Network | `base` |
| Asset | USDC, contract `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
| Pay to | The `payTo` value in each `accepts` entry |
| Header | `X-PAYMENT`, a base64-encoded JSON payment payload |
| Rate limit | 20 requests per minute per IP, including unpaid `402` probes |

## Flow

1. **Read the price**. `GET /api/v1` always returns `402` with the payment requirements and no seat data.

   ```bash
   curl -i https://flightseatmap.com/api/v1
   ```

2. **Request without payment**. The seat map request returns `402` with the same requirements in the body. The `PAYMENT-REQUIRED` header carries them as base64 JSON. `date` is optional and defaults to today.

   ```bash
   curl -i "https://flightseatmap.com/api/v1/seatmaps/QF1?date=2026-12-20"
   ```

3. **Pay and retry**. Sign a payment for one `accepts` entry with your wallet or an x402 client library. Send it as the `X-PAYMENT` header on the same request.

   ```bash
   curl -i -H "X-PAYMENT: <base64 payment payload>" \
     "https://flightseatmap.com/api/v1/seatmaps/QF1?date=2026-12-20"
   ```

The response is `200` with the seat map. The `X-PAYMENT-RESPONSE` header holds the base64 settlement receipt with `success`, `transaction`, `network` and `payer`.

### The 402 response

**402 Payment Required**

```json
{
  "x402Version": 1,
  "error": "X-PAYMENT header is required",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "2990000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "<payment address>",
      "resource": "https://flightseatmap.com/api/v1/seatmaps/QF1",
      "description": "One live aircraft seatmap: cabin layout, seat features and availability.",
      "mimeType": "application/json",
      "outputSchema": null,
      "maxTimeoutSeconds": 60,
      "extra": {
        "name": "USDC",
        "version": "2"
      }
    }
  ]
}
```

## When you are charged

The server settles a payment only after it delivers a `200` seat map. A request that returns `400` or `404` is not charged, and the authorization expires unused. A payment the payment facilitator rejects gets `402` with the reason in `error`.

> **Note.** The `402` check runs first. A request with no valid payment gets `402` even when its `date` is invalid.

## MCP server

The [MCP server](https://flightseatmap.com/docs/mcp) uses OAuth 2.1 instead. See [Sign in with OAuth](https://flightseatmap.com/docs/mcp#sign-in-with-oauth).

---

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