> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API Overview

> Programmatic access to Kash markets, trades, portfolios, disputes and webhooks at api.kash.bot.

The Kash REST API is the programmatic interface to Kash prediction markets. It is built for developers, automated agents and market makers: anything that talks to Kash without a human in the loop.

> [!NOTE]
>
> **Two surfaces, and when to use which:**
>
> * **`api.kash.bot`** (this API) is for **machines**. Every request carries an API key, which gives you per-key rate limits, telemetry and spending caps. Trading, portfolio, disputes and webhooks live here.
> * **`app.kash.bot/api`** (the [Public Embed API](https://docs.kash.bot/developer-docs/public-embed-api/overview.md)) is for **embedding**: anonymous reads for showing markets in websites and apps. No trading.

> [!TIP]
>
> **Building a bot?** Use the official [`@kashdao/sdk`](https://docs.kash.bot/developer-docs/rest-api/sdks/typescript) TypeScript client (auth, retries, idempotency, typed errors and webhook verification built in) and follow [Build a trading bot](https://docs.kash.bot/developer-docs/rest-api/trading-bot.md). To sign transactions yourself, see the [Protocol SDK](https://docs.kash.bot/developer-docs/protocol-sdk/overview.md).

## What's in v1

> [card] [Markets & quotes](https://docs.kash.bot/developer-docs/rest-api/endpoints/markets.md)
>
> Browse markets, read one market, quote a buy or sell, read recent trades.

> [card] [Trades](https://docs.kash.bot/developer-docs/rest-api/endpoints/trades.md)
>
> Place buy and sell orders, confirm high-value trades, read your trades.

> [card] [Portfolio & redemptions](https://docs.kash.bot/developer-docs/rest-api/endpoints/portfolio-and-redemptions.md)
>
> Your smart account and positions; claim settled positions back to USDC.

> [card] [Market disputes](https://docs.kash.bot/developer-docs/rest-api/endpoints/disputes.md)
>
> Dispute a proposed resolution during its dispute window.

> [card] [Webhooks](https://docs.kash.bot/developer-docs/rest-api/webhooks/overview.md)
>
> Signed, retried, replayable trade lifecycle events at your endpoint.

> [card] [Account usage](https://docs.kash.bot/developer-docs/rest-api/endpoints/account-and-traces.md)
>
> Per-key trade volume, latency, webhook success and auth failures.

> [card] [Traces](https://docs.kash.bot/developer-docs/rest-api/endpoints/account-and-traces.md)
>
> The event timeline behind one trade, for debugging.

## Base URLs

```
Production: https://api.kash.bot/v1
Staging:    https://api-staging.kash.bot/v1
```

Production trades on **Solana mainnet**. Staging trades on Solana devnet and is the place to integrate before going live. Production keys start `kash_live_`; staging keys start `kash_test_`.

## API versions

The URL is versioned (`/v1/`). Within v1, you pick a contract date with the `X-Kash-Api-Version` request header. Two dates are supported:

| `X-Kash-Api-Version` | Behaviour |
| - | - |
| `2026-08-19` | **The default when you send no header.** Every market, quote and trade carries `chainRef` (for example `solana:mainnet-beta`), Solana markets are listed and readable, and a trade's `txHash` is returned for every chain. The TypeScript SDK sends this version too. |
| `2026-04-29` | Served only when you pin it. Legacy contract that cannot describe Solana: Solana markets are left out of `GET /v1/markets`, `GET /v1/markets/{id}` and `/quote` answer `400 CHAIN_NOT_SUPPORTED` for one, and a Solana trade's `txHash` is `null`. |

Sending no header is the same as sending `2026-08-19`. Pin a date if you want your integration to stay on one contract. Any other value is refused with `410 API_VERSION_UNSUPPORTED`, whose body lists the `supported` versions.

Responses carry `X-API-Version`, the contract date that served the request: your pinned value, or `2026-08-19` when you sent no header. Webhook deliveries always use `2026-08-19`. When a version is scheduled for removal, responses also carry `Sunset` and `Deprecation` headers (RFC 8594).

## Design principles

* **Stripe-shaped wire protocol.** RFC 7807 errors with a stable `code`, an `Idempotency-Key` header, cursor pagination, a dual-key envelope on single resources (`{ trade, data, _meta }`) and HMAC-signed webhooks.
* **OpenAPI 3.1 is the contract.** The live spec is at [`/v1/openapi.json`](https://api.kash.bot/v1/openapi.json), rendered at [`/v1/docs`](https://api.kash.bot/v1/docs).
* **Always-on auth.** Every data route needs a key. There is no anonymous access to `api.kash.bot`.
* **Decimal strings for big numbers.** USDC amounts are atomic strings with 6 decimals and outcome-token amounts are WAD strings with 18 decimals, so nothing loses precision in JSON.

## Next steps

> [card] [Quickstart](https://docs.kash.bot/developer-docs/rest-api/quickstart.md)
>
> Get a key, quote a market and place your first trade.

> [card] [Authentication](https://docs.kash.bot/developer-docs/rest-api/authentication.md)
>
> `X-API-Key`, scopes, IP allowlists and request signing.

> [card] [Endpoint reference](https://docs.kash.bot/developer-docs/rest-api/endpoint-reference.md)
>
> All 31 routes with scopes and reference pages.

## Need help?

> [card] Developer support
>
> Send technical questions from the info button in the Kash web app → **Feedback**. Quote the `requestId` from any error.

> [card] [Discord](https://discord.com/invite/n9eumqjMPb)
>
> Join the `#developers` channel for real-time help.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.