Every response fromDocumentation Index
Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
Use this file to discover all available pages before exploring further.
api.kash.bot carries an ETag header — a content-derived hash of the response body. Send it back on the next request as If-None-Match and the server short-circuits with 304 Not Modified (and an empty body) when nothing changed.
Why this matters
A304 response:
- Is fast — the server doesn’t reserialize the body or hit the database for the result.
- Is small — empty body, just the headers.
- Counts toward your rate limit for accounting, but the cost is much lower per request.
How to use it
1. Capture the ETag from your first response
2. Send it back on the next request
304, reuse your last response body. When you get 200, replace it (and capture the new ETag).
TypeScript SDK
The SDK does this transparently — pass--ifNoneMatch (or set the per-call header) and it handles the 304 path:
Where ETags help most
| Endpoint | Polling pattern | ETag value |
|---|---|---|
GET /v1/portfolio | Refresh balance every N seconds | High — balance only moves on trades you initiated. |
GET /v1/trades/{id} | Wait for completion | High — trade is mostly idle until status flips. |
GET /v1/markets/{id} | Watch a single market | Medium — moves on every trade against it. |
GET /v1/markets | Refresh a market list | Medium — depends on filter and traffic. |
GET /v1/markets/{id}/quote | Live price ticker | Low — every quote re-runs RPC. Cache client-side instead. |
GET /v1/markets/{id}/predictions | Recent-trades feed | Low — append-only, almost always changes. |
ETag format
We use weak ETags (theW/ prefix). Weak ETags compare equal even if byte-level encoding differs (e.g. JSON whitespace). The server may serve different exact bytes for the same logical state — what matters is whether the resource changed.
Caching with ETags + Cache-Control
The GET /v1/markets/{id}/quote endpoint also sets a small public Cache-Control: public, max-age=10. This lets a CDN or local cache serve the quote for up to 10 seconds without hitting our backend at all. Combine with ETag for the post-cache revalidation path.
For private routes (everything authenticated), responses use Cache-Control: private, no-cache — your CDN won’t serve them to other tenants, but you can still cache client-side using ETags as the freshness key.
What ETags don’t do
- They don’t skip rate limit accounting entirely. A
304still costs one request from your quota, just dramatically less work for the server. (If you need to poll harder, see if a webhook-driven design works for you.) - They don’t survive across keys. ETags are computed per (route, query, key). Don’t share them between keys.
- They don’t apply to write paths.
POSTandPATCHrequests don’t benefit from ETags; use Idempotency-Key instead.
Next
Webhooks
The push-based alternative to polling. Real-time delivery, no quota cost.
Endpoint Reference
The full interactive spec at
/v1/docs.