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

# Kairos Partner API

> Add prediction-market trading to your wallet or app. Kairos builds each step; your user's wallet signs it. Polymarket, Predict.fun and Hyperliquid through one API.

The Partner API lets your users trade prediction markets from their own wallets. Kairos builds every order, setup step and cancel. The user's wallet signs it, and Kairos submits it to the venue. Your users keep their keys and need no Kairos account. Every endpoint is under `/v3`.

One integration covers **Polymarket**, **Predict.fun** and **Hyperliquid** outcome markets. Polymarket setup needs no gas; Predict.fun asks for one batch of BNB Chain approvals. Reading a wallet's own orders and positions takes one sign-in signature.

> [!NOTE]
>
> The SDK is optional. Every example in this section has **HTTP**, **Python** and **JavaScript** tabs, and the [endpoint reference](#endpoint-reference) is an OpenAPI spec you can generate a client from in any language.

## Start here

**1. Onboard with Kairos**

Get your partner id and base URLs, and plan your launch. [Onboarding and go-live](https://docs.kairos.trade/wallets/onboarding.md).

**2. Place a first order**

Set up a wallet, place an order, read it and cancel it, in about 40 lines. [Quickstart](https://docs.kairos.trade/wallets/quickstart.md).

**3. Onboard your users**

One-time setup per venue, and where each venue's funds go. [Set up and fund a wallet](https://docs.kairos.trade/wallets/setup.md).

**4. Trade**

[Show markets](https://docs.kairos.trade/wallets/markets.md), [place and cancel orders](https://docs.kairos.trade/wallets/trade.md), and [show orders and positions](https://docs.kairos.trade/wallets/portfolio.md).

**5. Route and fund**

Pick the best venue for each order, and get funds where they're needed. [Routing across venues](https://docs.kairos.trade/wallets/routing.md).

**6. Earn**

Charge your own fee on each trade, collected on-chain. [Partner fees](https://docs.kairos.trade/wallets/fees.md) (preview).

## What can you build?

> [card] [Show markets](https://docs.kairos.trade/wallets/markets.md)
>
> Prices, charts, and order books. Read-only, no signing.

> [card] [Let users trade](https://docs.kairos.trade/wallets/trade.md)
>
> Set up a wallet, place orders, cancel them.

> [card] [Show positions](https://docs.kairos.trade/wallets/portfolio.md)
>
> A wallet's open orders and positions.

## How it works

Every action — setup, order, cancel — is the same loop: start it, sign each step the wallet is asked for, send the signature back. Use plain HTTP from any language, the [Python client](https://docs.kairos.trade/wallets/http.md#a-complete-python-client), or the JavaScript [SDK](https://docs.kairos.trade/wallets/sdk.md), which runs the loop for you:

```bash HTTP theme={null}
# 1. Start an order. Kairos answers with the first step to sign.
curl -X POST "$BASE/v3/actions" -H "X-Kairos-Partner-Id: $PARTNER" -H "X-Kairos-Wallet-Api: 2" -H "Content-Type: application/json" \
  -d '{"wallet":"0xUSER","action":{"type":"order","market":"polymarket:0x…","outcome":"Yes","side":"buy","price":"0.52","size":"10"}}'
# {"id":"…","status":"needs_signature","description":"Confirm this Polymarket order",
#  "chainId":"0x89","request":{"method":"eth_signTypedData_v4","params":["0xUSER","{…}"]}}

# 2. The wallet signs `request`. Send the signature back.
curl -X POST "$BASE/v3/actions/$ACTION_ID" -H "X-Kairos-Partner-Id: $PARTNER" -H "X-Kairos-Wallet-Api: 2" -H "Content-Type: application/json" -d '{"signature":"0x…"}'
# The next step, or {"status":"done","result":{"orderId":"…","status":"filled",…}}
```

```python Python theme={null}
from kairos_wallet import run  # the client from /wallets/http

run({"type": "setup"})
run({"type": "order", "market": market, "outcome": "Yes", "side": "buy", "price": "0.52", "size": "10"})
```

```js JavaScript (SDK) theme={null}
import { createKairos } from '@kairos.trade/sdk'

const kairos = createKairos({ wallet: { baseUrl, partnerId, provider: window.ethereum } })
await kairos.wallet.setup(wallet)
await kairos.wallet.order(wallet, { market, outcome: 'Yes', side: 'buy', price: '0.52', size: '10' })
```

The same calls trade Polymarket, Predict.fun and Hyperliquid; the venue comes from the market. Each step is a standard EIP-1193 request (`eth_signTypedData_v4`, `personal_sign`, or `wallet_sendCalls` for approvals), so any EIP-1193 wallet works.

## Go deeper

> [card] [Authentication](https://docs.kairos.trade/wallets/authentication.md)
>
> Partner ids, API keys, the version header and the sign-in token.

> [card] [What the wallet signs](https://docs.kairos.trade/wallets/signing.md)
>
> Every request, per venue, and what to check before showing it.

> [card] [Venue rules](https://docs.kairos.trade/wallets/venues.md)
>
> Chains, collateral and order rules side by side.

> [card] [Plain HTTP clients](https://docs.kairos.trade/wallets/http.md)
>
> The action loop over HTTP, with complete JavaScript and Python clients.

## Endpoint reference

Every `/v3` operation, with its request, response and errors, is in the **Endpoints** group of this tab. It is generated from the OpenAPI spec, which you can [download](https://docs.kairos.trade/openapi/wallet-api.json) to generate a client in any language.

| Endpoints | For |
| - | - |
| `POST /v3/actions`, `GET` and `POST /v3/actions/{id}` | Setup, orders, cancels and sign-in: start an action, then answer each step |
| `GET /v3/wallets/{address}`, `/orders`, `/positions` | Readiness, balances, orders and positions |
| `/v3/fees`, `/v3/fees/settlements` | Partner fees owed, and paying them (preview) |
| `/v3/trade-plans` | Funded trade plans (preview) |
| `/v3/onchain-intents` | Split, merge and redeem (preview) |

## Preview

Coming to production. Trade plans and fees are still being validated; split, merge and redeem run on staging:

> [card] [Fees](https://docs.kairos.trade/wallets/fees.md)
>
> Charge your own fee on top of Kairos's, collected on-chain.

> [card] [Trade plans](https://docs.kairos.trade/wallets/trade-plans.md)
>
> One signed buy with a cost ceiling, funded from another chain.

> [card] [Split, merge, redeem](https://docs.kairos.trade/wallets/onchain.md)
>
> Gasless outcome-token operations on Polymarket.


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