# Introduction (/introduction)

Predict is a prediction market on BNB Chain. Its order book runs off-chain, and every trade settles on-chain through Predict's exchange contracts. You can read market data, trade from your own wallet, and follow both as they change.

## The APIs [#the-apis]

| Interface | What it is for |
| :--- | :--- |
| [REST API](/api) | Market data, your account and positions, and placing and removing orders. |
| [WebSocket API](/websocket) | Live order books, market status changes, and events for your own orders. |
| SDKs | Signing orders, setting approvals, and managing positions on-chain. Available for TypeScript and Python. |

Report anything that does not work as described in our [Discord server](https://discord.gg/predictdotfun).

## Environments [#environments]

| | BNB Mainnet | BNB Testnet |
| :--- | :--- | :--- |
| REST API | `https://api.predict.fun` | `https://api-testnet.predict.fun` |
| WebSocket API | `wss://ws.predict.fun/ws` | Not available yet |
| Chain ID | `56` | `97` |
| API key | Required | Not needed |

Every REST path starts with `/v1`, for example `https://api.predict.fun/v1/markets`. On mainnet, send your API key in the `x-api-key` header of every REST request. The WebSocket connection takes it as the same header or as an `apiKey` query parameter (see the [WebSocket overview](/websocket)). Testnet works without a key, so you can try the REST API there before you have one.

Predict's servers run in AWS `ap-northeast-1` (Tokyo). Deploy close to that region for the lowest latency.

## Get an API key [#get-an-api-key]

Create an API key in the [developer console](https://developers.predict.fun). Each key has rate limits, which you can see in the console. See [Rate limits](/resources/rate-limits) for the defaults and how to read them from responses.

## Install an SDK [#install-an-sdk]

<Tabs items={["TypeScript", "Python"]} groupId="language" persist>

<Tab value="TypeScript">

```bash
npm install @predictdotfun/sdk ethers
```

The SDK uses [ethers v6](https://docs.ethers.org/v6/) for signing. Source: [github.com/PredictDotFun/sdk](https://github.com/PredictDotFun/sdk).

</Tab>

<Tab value="Python">

```bash
pip install predict-sdk
```

Source: [github.com/PredictDotFun/sdk-python](https://github.com/PredictDotFun/sdk-python).

</Tab>

</Tabs>

## Where to start [#where-to-start]

<Cards>
  <Card title="Markets and categories" href="/concepts/markets">
    How markets, outcomes and categories fit together.
  </Card>
  <Card title="Prices and order book" href="/concepts/order-book">
    How prices work, and how the Yes and No sides share one book.
  </Card>
  <Card title="Authentication" href="/trading/authentication">
    Get a JWT for your wallet, as an EOA or a Predict account.
  </Card>
  <Card title="Place orders" href="/trading/place-orders">
    Build, sign and submit limit and market orders.
  </Card>
</Cards>

## Docs for AI tools [#docs-for-ai-tools]

These docs are available in forms that coding assistants and language models can read:

- [`/llms.txt`](/llms.txt) lists every page with a one-line summary.
- [`/llms-full.txt`](/llms-full.txt) holds the full text of every page in one file. It's over 1 MB, more than most AI tools can read at once, so prefer `/llms.txt` and the pages you need.
- Every page has a Markdown copy at its URL plus `.md`, for example [`/introduction.md`](/introduction.md). The buttons at the top of each page copy it or open it in an AI tool.
- **Ask AI**, at the bottom right of every page, answers questions from these docs.

Our SDKs and docs are also on Context7, which you can use through its MCP server or its website:

- [Predict TypeScript SDK](https://context7.com/predictdotfun/sdk?tab=chat)
- [Predict Python SDK](https://context7.com/predictdotfun/sdk-python?tab=chat)
- [Predict REST API](https://context7.com/llmstxt/dev_predict_fun_llms_txt?tab=chat)
