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

# Build on SX with AI

> Connect Claude, Cursor, Codex, and other AI coding tools to the SX Bet docs and API.

You can use AI coding assistants to build SX Bet integrations end-to-end — fetching markets, signing orders, subscribing to live odds. We provide a set of tools that give your assistant accurate, up-to-date context about the SX Bet API.

| Tool | What it does | Best for |
| - | - | - |
| **MCP server** | Lets your assistant search and read these docs live during your session | IDE-based workflows (Claude Code, Cursor, VS Code) |
| **llms.txt / llms-full.txt** | Plain-text index or full export of the documentation | Pasting context into ChatGPT, Gemini, or claude.ai conversations |
| **Per-page markdown** | Copy any page as Markdown, or open it directly in ChatGPT or Claude | Quickly grounding an assistant in one specific topic |

## Per-page markdown access

Every page in these docs has a contextual menu in the top-right that lets you:

* **Copy as Markdown** — grab the page content without HTML or navigation chrome
* **View as Markdown** — open the raw `.md` version in a new tab
* **Open in ChatGPT** — start a ChatGPT conversation pre-loaded with the page
* **Open in Claude** — same, for claude.ai

Reach for these when you want to ground an assistant in one specific topic (e.g. EIP-712 signing) without pasting the full docs.

## MCP server

MCP (Model Context Protocol) is a standard that lets AI coding tools connect to external resources. Adding the SX Bet MCP server gives your assistant live access to search and read these docs during your session — so instead of copy-pasting documentation into your prompt, your assistant can look up exactly what it needs on demand.

Install the server once using the config for your tool, then ask questions as you code:

* *"How do I rest a GTC order on SX Bet?"*
* *"What channel do I subscribe to for order book depth on one market?"*
* *"Show me the EIP-712 struct I sign for an order, in field order."*

<AccordionGroup>
  <Accordion title="Claude Desktop">
    1. Go to [**Settings → Connectors**](https://claude.ai/settings/connectors) and select **Add custom connector**.
    2. Enter the name `SX Bet` and URL `https://docs.sx.bet/mcp`, then select **Add**.
    3. When chatting, select the attachments button (the **+** icon) and choose **SX Bet** to give Claude access for that conversation.

    Or add directly to `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "sx-bet": {
          "url": "https://docs.sx.bet/mcp"
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="Claude Code">
    ```bash theme={null}
    claude mcp add --transport http sx-bet https://docs.sx.bet/mcp
    ```
  </Accordion>

  <Accordion title="Cursor">
    Add to `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "sx-bet": {
          "url": "https://docs.sx.bet/mcp"
        }
      }
    }
    ```

    Or open the Command Palette (`Cmd+Shift+P`) and select **MCP: Add Server**.
  </Accordion>

  <Accordion title="VS Code">
    Create `.vscode/mcp.json` in your project root:

    ```json theme={null}
    {
      "servers": {
        "sx-bet": {
          "type": "http",
          "url": "https://docs.sx.bet/mcp"
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="Windsurf">
    Open **Windsurf Settings → MCP Configuration** and add:

    ```json theme={null}
    {
      "mcpServers": {
        "sx-bet": {
          "url": "https://docs.sx.bet/mcp"
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Plain text docs

`llms.txt` and `llms-full.txt` are plain-text exports of this documentation — no HTML, no navigation chrome, just content. Use them when you're working outside your IDE and want to give an LLM SX Bet context directly: paste the contents into a ChatGPT, Gemini, or claude.ai conversation, or fetch and inject them into your own API calls.

| | URL | Use when |
| - | - | - |
| **llms.txt** | [docs.sx.bet/llms.txt](https://docs.sx.bet/llms.txt) | You want a lightweight index of all pages to reference in a prompt |
| **llms-full.txt** | [docs.sx.bet/llms-full.txt](https://docs.sx.bet/llms-full.txt) | You want the complete documentation in a single paste |

For most cases, `llms-full.txt` is the better choice — it gives the LLM everything it needs without requiring follow-up fetches. Open the URL, copy the contents, and paste it at the start of your conversation before asking your question.

## Try this first

Once the MCP server is installed, paste the prompt below into Claude Code, Cursor, or any MCP-aware
assistant. It exercises the full stack — doc lookups, proxy setup, funding, EIP-712 signing,
posting, a realtime subscription and a cancel — at the minimum order size, so it is a safe
end-to-end smoke test.

The prompt states the invariants an assistant cannot infer from a single doc lookup — that a proxy
is mandatory, that nothing may be hardcoded, that odds sit on a ladder — because without them an
assistant confidently writes plausible code against an API shape that does not exist.

```
Rest a single order on SX Bet, end to end. Use https://api.sx.bet, or
https://api.toronto.sx.bet to run it against the testnet:

1. Confirm OBv3 is live: GET /metadata/obv3 (200 = live, 503 = unavailable, 404 = predates OBv3).
2. Load GET /metadata/obv3 for the chain id, EIP-712 domain, active base
   token and escrow address, odds ladder step, and order limits. Never
   hardcode any of them.
3. Authenticate by sending the x-sx-api-key header on every request.
   Spend requests sparingly — a key is capped at 10 per 24 hours.
4. Deploy a proxy wallet if there isn't one: POST /user/deploy-proxy, then
   poll GET /user/pending-deploy-proxy until pending is false, and confirm
   deployed: true on GET /user/proxy.
5. Confirm spendable balance from GET /user/balance-v3, remembering that
   it is availableAmount + pendingAvailableAmount and the pending value is
   a negative hold.
6. Find an active market and read its aggregated book with
   GET /orderbook-v3/snapshot?marketHash=...
7. Build and EIP-712 sign an eight-field Order for the minimum size from
   limits.orderSizeMinimumBaseUnits, at an on-ladder price, then POST it to
   /orders-v3 with timeInForce: "GTC". Compute the order id locally first
   and check it matches the id in the response.
8. Subscribe to account:orders_v3_#{address} so any state change prints in
   real time.
9. After 60 seconds, cancel with DELETE /orders-v3 and confirm the book
   went flat — not merely that the response was a 200.

Use Python with eth-account and the centrifuge-python client. Pull every
endpoint shape, signing pattern and channel name from the SX Bet docs as
you go — don't guess. Keep the script under 200 lines.
```

If your assistant completes this without you intervening, your MCP server is wired up correctly
and you are ready to build something real.


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