> ## Documentation Index
> Fetch the complete documentation index at: https://cs2-data-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Send your key as a Bearer token or in X-API-Key.

Every endpoint except `GET /v1/health` needs a key. Send it either way:

```bash theme={null}
curl -H "Authorization: Bearer $CS2API_KEY" https://api.granuleux.com/v1/maps
curl -H "X-API-Key: $CS2API_KEY"             https://api.granuleux.com/v1/maps
```

If both headers are present, `X-API-Key` is used. Keys look like `cs2_live_<8-char prefix>_<secret>`; the prefix
identifies the key in `GET /v1/usage` and on the dashboard. The API stores only a hash, so a lost key cannot be
shown again: create a new one.

A missing, malformed, revoked or expired key returns `401` with `WWW-Authenticate: Bearer` and a
[problem+json](https://cs2-data-api.mintlify.site/concepts/errors.md) body.

## Keep keys on the server

Keys are for servers and notebooks. Never put one in a browser bundle, a mobile app or a public repository. A front end
should call your own backend, which holds the key and calls this API.

## Rotate and revoke

Manage keys from the dashboard at [www.granuleux.com](https://www.granuleux.com/login).

* **Rotate** issues a new key on the same tier. The old key keeps working for a grace period, so you can deploy the new
  one without downtime, then stops.
* **Revoke** disables a key immediately.

Rate limits and the daily unit budget are counted per key. See [Rate limits](https://cs2-data-api.mintlify.site/concepts/rate-limits.md).

## Download links

The parquet download URLs returned by `GET /v1/games/{game}/files` are signed and need no key. They expire after
15 minutes. See [Files](https://cs2-data-api.mintlify.site/data/files.md).


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