> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qelso.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Send your API key in the X-API-Key header, and see what it can read with GET /v2/usage.

Send your API key in the `X-API-Key` header on every request. `GET /v2/health` is the only endpoint that needs no key.

```bash theme={null}
curl -s https://api.qelso.io/v2/venues -H "X-API-Key: $QELSO_API_KEY"
```

Existing API keys work here. A missing, invalid, revoked or expired key gets a `401` with the code `unauthorized`.

> [!WARNING]
>
> Treat your key like a password. Keep it in an environment variable or a secret store, never in code you share or in a web page. If a key leaks, revoke it in the [console](https://app.qelso.io/keys) and create a new one; a revoked key stops working within about a minute.

The API doesn't answer calls from web pages, so the JavaScript examples in the API reference run on a server, such as Node.js 18 or later. **Try it**, on the same pages, sends your request and key through Mintlify, which hosts these docs. Your browser keeps the key between pages and shows it in the sample request, and you can rotate a key you've used there in the [console](https://app.qelso.io/keys).

## What your key can read

Your plan decides which data your key can read. Every Qelso plan, Free included, covers every venue we serve, Polymarket and Kalshi. Kalshi needs a one-time declaration first, a box you tick in the [console](https://app.qelso.io/keys) to accept the Kalshi terms and confirm you're eligible. `GET /v2/usage` shows what your key can read, with your rate limit and your monthly quotas.

What a key on the free plan gets once its organisation has made the Kalshi declaration (the organisation's ID and name left out). It reads both venues' reference data, and minute data from `10m` up: prices, candles and statistics over the last 30 days, books over the last 7. Its data requests have a monthly quota:

```json theme={null}
{
  "data": {
    "organization": {"id": "…", "name": "…"},
    "plan": {"name": "free", "title": "Free"},
    "rate_limit": {"units_per_minute": 10, "remaining": 9, "resets_at": "2026-12-01T17:31:00.000Z"},
    "entitlements": [
      {"venue": "kalshi", "entitlement": "reference", "enabled": true, "reason": null, "max_history_days": null, "min_resolution": null, "datasets": ["events", "lifecycle", "markets", "series"]},
      {"venue": "kalshi", "entitlement": "minute", "enabled": true, "reason": null, "max_history_days": 30, "min_resolution": "10m", "datasets": ["bars_1m", "stats_1m", "trades"]},
      {"venue": "kalshi", "entitlement": "minute", "enabled": true, "reason": null, "max_history_days": 7, "min_resolution": "10m", "datasets": ["book_snapshots"]},
      {"venue": "kalshi", "entitlement": "subminute", "enabled": false, "reason": "not_in_plan", "max_history_days": null, "min_resolution": null, "datasets": null},
      {"venue": "kalshi", "entitlement": "ticks", "enabled": false, "reason": "not_in_plan", "max_history_days": null, "min_resolution": null, "datasets": null},
      {"venue": "polymarket", "entitlement": "reference", "enabled": true, "reason": null, "max_history_days": null, "min_resolution": null, "datasets": ["events", "lifecycle", "markets", "series"]},
      {"venue": "polymarket", "entitlement": "minute", "enabled": true, "reason": null, "max_history_days": 30, "min_resolution": "10m", "datasets": ["bars_1m", "stats_1m", "trades"]},
      {"venue": "polymarket", "entitlement": "minute", "enabled": true, "reason": null, "max_history_days": 7, "min_resolution": "10m", "datasets": ["book_snapshots"]},
      {"venue": "polymarket", "entitlement": "subminute", "enabled": false, "reason": "not_in_plan", "max_history_days": null, "min_resolution": null, "datasets": null},
      {"venue": "polymarket", "entitlement": "ticks", "enabled": false, "reason": "not_in_plan", "max_history_days": null, "min_resolution": null, "datasets": null}
    ],
    "quotas": [
      {"venue": null, "entitlement": "all", "unit": "requests", "limit": 5000, "used": 12, "period_start": "2026-12-01T00:00:00.000Z", "period_end": "2027-01-01T00:00:00.000Z"}
    ]
  }
}
```

Until the declaration is made, each Kalshi entry is disabled, with the reason `not_in_plan`.

Each entry covers one venue and one kind of access:

| Entitlement | Covers |
| - | - |
| `reference` | Series, events, markets and lifecycle |
| `minute` | Prices, candles, statistics and books at `1m` and coarser |
| `subminute` | Prices and candles at `1s` and `100ms`; books at a millisecond or below `1m` |
| `ticks` | Trades, and with Ultra, best bid and ask changes and book changes |

When an entry is disabled, `reason` says why: `not_in_plan`, `eligibility_required`, `suspended` or `not_yet_available`. `datasets` lists the datasets an entry covers, `max_history_days` is how far back `start` may go, and `min_resolution` is the finest resolution you may ask for.

A request outside your access gets a `403` whose code names the limit: `forbidden_venue`, `forbidden_dataset`, `plan_history_limit`, `plan_resolution_not_allowed` or `suspended`. See [Errors](https://docs.qelso.io/concepts/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.