Every error is JSON. Most carry a `message`; Save Memory's own validation errors carry `error`.

```json
{ "message": "API key required" }
```

## Status codes

| Code | Meaning | What to do |
|------|---------|------------|
| `200` | Success. `/question` can also return `200` with `result: "no_context"` when nothing relevant was found. | — |
| `201` | Memory saved. | — |
| `400` | `query` or `namespace` missing, or `connection_type` names an unknown type. | Fix the request. |
| `401` | API key missing, or no active subscription. | Send the key; check your plan. |
| `402` | `/question` on a plan without it (Pro only). | Upgrade, or use `/context`. |
| `404` | API key not recognised. | Check the key in [Settings](https://context-link.ai/user/settings). |
| `422` | Save Memory with an empty body, or a `[mode]/` prefix that disagrees with `mode`. | Fix the request. |
| `429` | Rate limit hit, too many failed keys from one IP, or the monthly AI allowance is used up. | Back off; honour `Retry-After` when present. |
| `503` | `/question` couldn't reach the model (`result: "llm_unavailable"`). | Retry. |

## Error bodies

| Message | Status |
|---------|--------|
| `API key required` | 401 |
| `You need to be subscribed to access that page` | 401 |
| `Not found` | 404 |
| `A query is required` | 400 |
| `A namespace is required` (as `error`) | 400 |
| `No content provided` (as `error`) | 422 |
| `The question endpoint is a Pro-plan feature.` | 402 |
| `Monthly question allowance exceeded. Resets at the start of next month.` | 429 |
| `Too many failed authentication attempts. Try again later.` | 429 |

## Rate limits

| Endpoint | Limit |
|----------|-------|
| `GET /context` and `POST /context/save` | 5 requests per 10 seconds per API key (shared) |
| `GET /memories` | 5 requests per 10 seconds per API key |
| `GET /question` | 2 requests per 10 seconds per API key |
| Failed authentication | 30 per minute per IP, then `429` with `Retry-After` |

`/question` also counts toward your monthly AI allowance (2,000 requests on Pro), which resets at the start of each month.
