api.kash.bot requires an API key. The only unauthenticated endpoints are the infra-meta routes: /v1/health, /v1/ready, /v1/openapi.json, /v1/docs.
The X-API-Key header
Pass your key on every request as the X-API-Key header:
Key format
Scopes
A scope is a coarse-grained permission. Every endpoint declares the scope(s) it requires. TherequireScope middleware fails closed with 403 INSUFFICIENT_SCOPE when a key lacks one.
Tiers
Each key has a tier that governs default rate limits and spending caps. See Rate Limits for per-tier quotas.
Reach out to partnerships@kash.bot for
enterprise or mm keys.
IP allowlists
Optional per-key. When set, requests from any IP not in the list fail closed with403 IP_NOT_ALLOWED before the route handler runs.
Format: comma-separated IPv4/IPv6 addresses or CIDR ranges. Set in the webapp UI or via the admin CLI at issuance time.
Key rotation
API keys do not expire automatically. Rotate them when:- A team member with access leaves
- A key may have been logged or committed to a repo
- You’re tightening security posture before a major release
- Issue a new key in the webapp.
- Roll it out to your services.
- Verify the new key is in use (check
/v1/account/usage— request counts on the old key should be zero). - Revoke the old key in the webapp.
Body signing for trades:write (optional, hardened)
For write routes like POST /v1/trades, you can opt into HMAC-signed request bodies as a defence-in-depth layer against captured-request replay and in-flight tampering. Send the signature in X-Kash-Signature using the same Stripe-style header format as our webhook signatures:
- Signing secret = your API key plaintext (the same value you send in
X-API-Key). No separate signing secret is issued — this is not the key’swebhook_secret. - Canonical input is
<unix-ms-timestamp>.<METHOD>.<path>.<raw-body>— the timestamp fromt=, the HTTP method uppercased, the URL pathname without the query string (query params aren’t signed because intermediaries often re-order them), and the exact raw body bytes you send. - Algorithm: HMAC-SHA256, hex-encoded.
- Timestamp tolerance: ±5 minutes. Older or newer timestamps are rejected.
401 REQUEST_SIGNATURE_INVALID. If absent, the route still works (the API key is the canonical authentication). Multiple comma-separated v1= values are accepted (for graceful scheme rotation later). Use body signing when your threat model includes a compromised TLS-terminating proxy or leaky request logs.
Auth failures
All auth failures return RFC 7807
application/problem+json and are written to the per-key audit log. Repeated failures from the same source trigger the per-IP brute-force lockout.
Inspecting auth state
TheGET /v1/account/usage endpoint returns telemetry for the calling key — including 24h auth-failure and rate-limit-rejection counts. Useful for spotting key misuse early.
Next
Rate Limits
Per-tier quotas, the
X-RateLimit-* headers, and 429 handling.Errors
RFC 7807 error format and the full error code catalog.