Skip to Content
KashRock Docs

Authentication

Send your KashRock API key, keep it safe, and connect sockets from clients that cannot set headers.

Send your key

Every request carries your key in one header. Both forms work:

curl "https://kashrock.up.railway.app/v7/meta" -H "x-api-key: $KASHROCK_API_KEY"
curl "https://kashrock.up.railway.app/v7/meta" -H "Authorization: Bearer $KASHROCK_API_KEY"

A missing or wrong key answers 401:

{"error":{"code":"invalid_key","message":"The API key is unknown or deactivated.","status":401}}

Keep it safe

  • Call KashRock from server code only (an API route, a backend, a bot). Never ship the key to a browser or mobile app.
  • Read it from an environment variable such as KASHROCK_API_KEY, and keep .env out of git.
  • The full key is shown once, when you create it. Manage keys, revoke a leaked one, and see when each was last used in the console. How many keys you can hold depends on your plan:
PlanPriceCreditsRate limitAPI keysLive dataHistoryWebSocket
Sandbox$0/mo1,500 credits a day10 req/min1No live dataNoneNone
Hobby$29.99/mo1.5M credits a month30 req/min115s delayLast 90 daysNone
Builder$99/mo5M credits a month100 req/min3Real timeFull archive2 connections, 5 matches
Pro$199/mo10M credits a month250 req/min5Real timeFull archive10 connections, 25 matches, whole board
Quant$299/mo or $2,990/yr20M credits a month500 req/min10Real timeFull archive20 connections, 50 matches, whole board

Sockets from browsers

The live WebSocket accepts the same headers. A client that cannot set headers (a browser) first asks for a ticket, then opens the socket with it:

curl -X POST "https://kashrock.up.railway.app/v7/ws-ticket" -H "x-api-key: $KASHROCK_API_KEY"
# then connect to wss://kashrock.up.railway.app/v7/live/ws?ticket=<ticket>

A ticket works once and lasts 60 seconds. Mint it from your server, not the browser. See WebSockets.

Looking around without a key

https://kashrock.up.railway.app/v6/demo/cs2-prop returns one live prop with no key. Every other request needs your own key.

On this page