api.kash.bot requires an API key. Only /v1/health, /v1/ready, /v1/openapi.json and /v1/docs are open.
The X-API-Key header
Send your key on every request as X-API-Key. Send exactly one: a request with two X-API-Key headers is refused.
Key format
Scopes
Each key carries a set of scopes, and each route requires one. A key without the route’s scope gets403 INSUFFICIENT_SCOPE.
A key created without an explicit scope list gets
markets:read, markets:quote and portfolio:read. Choose the scopes you need when you create the key, and no more: a read-only analytics key should never carry trades:write.
Tiers
Each key has a tier, which sets its rate limit and spending caps. See Rate limits for the numbers.Account status
A key belongs to the account that created it in the web app. If that account is suspended or closed, its keys are refused with403 ORGANIZATION_INACTIVE.
IP allowlists
Optional, per key. When a key has an allowlist, a request from any other address is refused with403 IP_NOT_ALLOWED before the route runs. Entries are IPv4 or IPv6 addresses or CIDR ranges:
Request signing (optional)
You can sign requests with an HMAC as a defence against tampering and replay of a captured request. SendX-Kash-Signature (exactly one) in the same format as webhook signatures:
- Secret: your API key plaintext, the value you send in
X-API-Key. - Signed input:
<t>.<METHOD>.<path>.<raw-body>: the timestamp fromt=, the HTTP method in upper case, the URL path without the query string, and the exact body bytes (empty for aGET). - Algorithm: HMAC-SHA256, hex-encoded. Several
v1=values are accepted; one must match. - Tolerance: the timestamp must be within 5 minutes of the server’s clock.
401 REQUEST_SIGNATURE_INVALID. Signing applies to every authenticated route. It is optional unless your key has been set to require signing, in which case an unsigned request is also refused with 401 REQUEST_SIGNATURE_INVALID.
Because the signing secret is the key itself, signing protects body integrity and limits the replay window of a captured request. It does not protect you against a stolen key.
Key rotation
Rotate a key when someone with access leaves, when a key may have been logged or committed, or as routine hygiene:- Create a new key in the Kash web app.
- Roll it out to your services.
- Confirm the old key has gone quiet (
GET /v1/account/usagewith the old key shows no new trades). - Revoke the old key. Revocation takes effect immediately (
401 API_KEY_REVOKED).
401 API_KEY_EXPIRED. API keys have no overlap window. Webhook secrets do: see Secret rotation.
Auth failures
Failed authentication is counted per source address: too many failures in a short window lock that address out for a period, answered with
429 RATE_LIMIT_EXCEEDED and a Retry-After header.
Next
Rate limits
Per-tier quotas, the
X-RateLimit-* headers and 429 handling.Errors
The RFC 7807 error format and the code catalogue.