The webapp atDocumentation Index
Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
Use this file to discover all available pages before exploring further.
app.kash.bot exposes a /api/* surface that has been around longer than the REST API. It exists primarily for the webapp itself and for Public Embed API consumers — humans, iframes, anonymous traffic.
If you’re a programmatic consumer (a trading bot, a market maker, a portfolio tool), you should be on api.kash.bot/v1. The webapp endpoints will continue to work for their intended audience, but they’re not the right surface for you.
Why migrate
| Concern | app.kash.bot/api | api.kash.bot/v1 |
|---|---|---|
| Audience | Humans, embedded UIs | Programmatic consumers (bots, agents, MMs) |
| Authentication | Anonymous or Privy session | API key (X-API-Key) |
| Rate limiting | Per-IP | Per-key (much higher quotas, attribution, telemetry) |
| Response shape | UI-shaped (rich; tuned for rendering) | Lean wire shape (decimal strings for big numbers) |
| Trade execution | Not exposed — frontend signs directly | First-class — POST /v1/trades |
| Webhooks | None | trade.confirmation-required, .completed, .failed |
| Idempotency | No | Idempotency-Key + clientRequestId |
| Pagination | Offset (legacy) | Cursor (stable under concurrent writes) |
| Error format | Various | RFC 7807 Problem Details with stable code |
ETags / If-None-Match | No | Yes — every response, free read quota for unchanged data |
| Versioning | None | URL-versioned (/v1/) + X-Kash-Api-Version header |
| Deprecation policy | Best-effort | RFC 8594 Sunset + Deprecation headers, 12-month notice |
api.kash.bot/v1.
Endpoint mapping
The five endpoints with logical overlap:GET /api/markets → GET /v1/markets
Both list markets, cursor-paginated/offset-paginated respectively.
- AWS uses
cursornotoffset. Walk pages by passing thepagination.cursorfrom the previous response. - AWS uses
data: [...]consistently; webapp usesmarkets: [...]. - AWS response is leaner (no
yesPrice/noPriceconvenience fields — those are derivable fromoutcomes[].probability). - AWS requires
markets:readscope.
GET /api/markets/{id} → GET /v1/markets/{id}
Single market detail. Same caveats as above. AWS adds the dual-key data: alias on every single-resource response.
GET /api/markets/{id}/quote → GET /v1/markets/{id}/quote
Both fetch on-chain price quotes. The AWS endpoint is the canonical implementation — the webapp’s quote endpoint was the prototype; the AWS one is the production-grade version with stricter precision (decimal-string bigints), explicit units block, and proper kill-switch behaviour during RPC degradation.
amounton AWS is in atomic units (USDC atomic-6 for buys, token WAD-18 for sells). The webapp accepts decimal USDC. Multiply by1_000_000going from one to the other.- AWS requires
markets:quotescope (separate frommarkets:readso you can throttle quote traffic independently). - AWS returns all bigint fields as decimal strings (
tokensOut: "237340124711760000000"instead of a JS number that loses precision). - AWS includes a
unitsblock ({ usdc: "atomic-6", token: "wad-18" }) so consumers don’t guess.
GET /api/portfolio → GET /v1/portfolio
Portfolio summary.
- Auth: Privy session JWT → API key.
- Response is per-key user, not per-Privy-user. (For most cases these are the same person, but if you have multi-user setups, mind the distinction.)
- AWS requires
portfolio:readscope.
POST /api/account/api-keys → (NOT in AWS; webapp is the issuer)
Self-serve API key issuance lives only in the webapp. The AWS API reads from the same api_keys table but doesn’t issue keys — issuance requires a Privy session (the human).
If you’re automating key provisioning programmatically, use the admin CLI on a machine with admin credentials:
Endpoints unique to AWS
These have no webapp equivalent — the AWS API introduces them:POST /v1/trades— trade execution. The big one. The webapp doesn’t expose this; all trading happens via direct frontend transactions.POST /v1/trades/{id}/confirm— high-value trade confirmation gate.GET /v1/trades,GET /v1/trades/{id}— your trade history.GET /v1/webhooks/events,POST /v1/webhooks/events/{id}/redeliver— webhook inspection and replay.POST /v1/auth/api-keys/me/webhook-secret/rotate— secret rotation.GET /v1/account/usage— per-key telemetry.GET /v1/traces/{id}— distributed trace by correlation id.
Endpoints unique to the webapp
These won’t appear on AWS — they serve UI/embedding workloads:GET /api/markets/trending,GET /api/markets/featured,GET /api/markets/for-you— engagement/personalisation.GET /api/community/leaderboard— global rankings.GET /api/portfolio/analytics,GET /api/portfolio/tx/{hash}— historical breakdowns.- All thread/social/embed endpoints — those are the Public Embed API.
- All ramp/onramp/withdrawal flows — those are user account operations, not programmatic.
Migration checklist
For a typical migration fromapp.kash.bot/api/markets* + app.kash.bot/api/portfolio to api.kash.bot/v1/*:
- Generate an API key in Settings → API Keys with scopes
markets:read,markets:quote,portfolio:read(andtrades:read,trades:writeif you’ll execute trades). - Store the key in your secrets manager / env config. Never commit it.
- Replace
Authorization: Bearer <jwt>headers withX-API-Key: <key>. - Replace
app.kash.bot/apibase URL withapi.kash.bot/v1. - Update pagination from
offset/limittocursor/limit. - Update response field accesses (
response.markets→response.dataorresponse.market→response.data). - Update bigint handling — quote fields are now decimal strings, not JS numbers. Use BigInt or a decimal lib.
- Update quote
amountto atomic units (* 1_000_000for USDC). - Add error handling — branch on RFC 7807
codefield, not status text. - Add
Idempotency-Keyto writes. - Pin to
X-Kash-Api-Version: 2026-04-29(or whatever’s current) and detect upgrades. - (Optional) Set up webhook receiver — replaces polling.
- (Optional) Adopt the TypeScript SDK — collapses most of the above into typed method calls.
A note on the “prototype” quote endpoint
The webapp’s quote endpoint was the prototype for the AWS one. The AWS version is now the source of truth. If the two diverge in output (rare; we monitor for divergence), the AWS response is canonical. We don’t currently plan to formally deprecate the webapp’s quote endpoint — it serves the embed audience well — but new programmatic code should call AWS.Need help migrating?
Email support
[email protected] — happy to walk through specific migrations.
Discord
#developers channel — fastest for “is this the right endpoint for X?”