> This page is for Datasets.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.immix.xyz/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.immix.xyz/_mcp/server.

# Keys, plans and usage

## Keys

Every request carries a Datasets API key as a bearer token:

```text
Authorization: Bearer immixds_<keyId>_<secret>
```

* **Immix issues your keys.** Ask for one per machine or job: each is then easy to replace, and
  your usage is broken down by key.
* **The whole key is shown once**, when it is issued or rotated. A lost key is rotated: it keeps
  its id, its secret is replaced, and the old secret stops working at once.
* **`<keyId>` is not secret.** It names the key in your usage and when you talk to us. Never
  share the rest.
* **Send the key to the API and nowhere else.** Do not put it in a URL. Do not send it to the
  storage link a download redirects to: that link carries its own signature, and anyone holding
  it can use it until it expires, so do not log or share the link either.

A Datasets key works only here. A trading API key, which begins `immix_`, and a login token are
both refused with `401 UNAUTHENTICATED`, and the message says which one you sent.

## Plans

Your plan is a number of bytes for each calendar month, in UTC, or no limit.

| Request                                                            | Counts                                                   |
| ------------------------------------------------------------------ | -------------------------------------------------------- |
| A data file, `GET /files/{family}/{exchange}/{day}/{symbol}.{ext}` | The file's `bytes`, whole, when the redirect is answered |
| Coverage, a day's manifest, an instruments file, `GET /usage`      | Nothing                                                  |
| Any request that is refused                                        | Nothing                                                  |

A file counts whatever you then do with the link. A download you abort counts, and a second
request for a file you already hold counts again. So keep what you fetch, and before asking for
a file, check whether you already have it with the SHA-256 its manifest gives.

To size a download before you start it, add up `bytes` in `GET /coverage/{exchange}` for the
families and symbols you want: it is what fetching every day of each transfers, and counts.

## Where you stand

Every counted redirect says where the month stands:

| Header                      | Is                                                   |
| --------------------------- | ---------------------------------------------------- |
| `X-Immix-Month-Bytes-Used`  | The bytes counted this month, this file's among them |
| `X-Immix-Month-Bytes-Limit` | Your plan. Absent when it has no limit               |

`GET /usage` gives the same two numbers and the month's bytes and files by key, exchange and
family, for every key of your account.

## At the limit

| Answer                                   | It means                                                        | Do                                                                                                                             |
| ---------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `429 BUDGET_EXHAUSTED`                   | The file would take the month past your plan. It is not counted | Stop until the month turns, or ask us to raise the plan. Its `Retry-After` is the month's end, so do not wait it out in a loop |
| `429 BUDGET_EXHAUSTED`, no `Retry-After` | The file is larger than your whole plan, so no month fits it    | Ask us for a larger plan                                                                                                       |
| `429 RATE_LIMITED`                       | Too many requests from this key in a minute                     | Wait `Retry-After` seconds, then continue                                                                                      |

A client that fetches five files at a time stays under the rate limit.

The [HTTP API guide](/datasets/reference/http-api/guide#when-a-request-is-refused) lists every
refusal with what to do about it.