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
The two will coexist indefinitely — the webapp routes serve a real audience. But for any new programmatic integration, start on
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.
- The REST API uses
cursornotoffset. Walk pages by passing thepagination.cursorfrom the previous response. - The REST API uses
data: [...]consistently; webapp usesmarkets: [...]. - The REST API response is leaner (no
yesPrice/noPriceconvenience fields — those are derivable fromoutcomes[].probability). - The REST API requires the
markets:readscope.
GET /api/markets/{id} → GET /v1/markets/{id}
Single market detail. Same caveats as above. The REST API 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 api.kash.bot endpoint is the canonical implementation — the webapp’s quote endpoint was the prototype; the public REST API’s is the production-grade version with stricter precision (decimal-string bigints), explicit units block, and proper kill-switch behaviour during RPC degradation.
amounton the REST API 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.- The REST API requires the
markets:quotescope (separate frommarkets:readso you can throttle quote traffic independently). - The REST API returns all bigint fields as decimal strings (
tokensOut: "237340124711760000000"instead of a JS number that loses precision). - The REST API 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.)
- The REST API requires the
portfolio:readscope.
POST /api/account/api-keys → (not on api.kash.bot; webapp is the issuer)
Self-serve API key issuance lives only in the webapp. The public REST 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 the public REST API
These have no webapp equivalent —api.kash.bot/v1 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 onapi.kash.bot — 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 theapi.kash.bot one. The public REST API version is now the source of truth. If the two diverge in output (rare; we monitor for divergence), the api.kash.bot 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 api.kash.bot/v1.
Need help migrating?
Email support
dev@kash.bot — happy to walk through specific migrations.
Discord
#developers channel — fastest for “is this the right endpoint for X?”