# Rate limits and metering

> Draft

## Rate limits

Requests pass three rate-limit layers in order, each with a 60-second window. Hitting any of them returns `429 rate_limit_exceeded`:

| Layer | Scope | Limit |
| --- | --- | --- |
| Per IP | One network address, before the key is checked | Announced at launch |
| Per key | Each key | Announced at launch; see `rate_limit` in [`/v1/usage`](https://paperpurr.com/en/docs/usage) |
| Per account | All of an account’s keys plus the website | Announced at launch |

The per-account layer is shared with the website, so more keys won’t make lookups or verification any faster.

| Header | When | Note |
| --- | --- | --- |
| `X-RateLimit-Limit` | Responses after authentication; `429` | The per-key limit on success. On a `429`, the limit of the layer that was hit (absent for the per-IP layer) |
| `Retry-After` | `429` | Seconds to wait before retrying |
| `X-RateLimit-Remaining` | `429` | Requests left in this window: `0` on a `429` |
| `X-RateLimit-Reset` | `429` | Seconds until the window resets |

> **Tip:** If several processes share a key, send requests through one queue at the allowed pace. It’s faster than each one hitting `429` and retrying.

## Metering

| Endpoint | How it’s metered |
| --- | --- |
| Citation lookup | 1 unit per successful lookup, even with no results |
| Reference verification | 1 unit per reference actually checked. `skipped` and `error` are free |
| Usage, `verify_connection` | Free |
| Rewrite | Per input word: each Chinese character counts as one word, everything else by words (when rewriting opens) |
| Job status | Free |
| MCP | Same as the matching REST endpoint, counted together |

Billable requests reserve units before processing. If you don’t have enough, you get `402` and nothing is processed; afterwards you’re charged for the actual units. Upstream failures (`502`) aren’t charged.

> **Warning:** If usage can’t be recorded for a moment, billable calls return `503 busy` without processing or charging. `/v1/usage` and `verify_connection` still work.

## Allowances and pricing

- The API is sold separately from website subscriptions, as word packs. Prices are announced at launch.
- Every subscription plan includes an API trial allowance, counted per account per calendar month in UTC and reset at the start of each month. Amounts are announced at launch.
- Accounts without a paid subscription don’t get a trial allowance.
- MCP works on every plan and shares usage with the REST API.

Next: [Data handling](https://paperpurr.com/en/docs/data.md)
