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

# API Reference

> ChainStream 暴露的所有程式化接入面——REST、WebSocket、Kafka 主題、CLI 命令與 MCP 工具。

本分割槽是端點、工具與通道的權威清單。如果你是第一次用，先看 [Quickstart](/zh-Hant/docs/quickstart) 或 [接入方式總覽](/zh-Hant/docs/access-methods/overview)；需要精確欄位名、限流額度、schema 時再回到這裡查。

## 接入面一覽

<CardGroup cols={2}>
  <Card title="REST——資料" icon="database" href="/zh-Hant/api-reference/endpoint/data/token/v2/token-search-get">
    所有資料端點：tokens、trades、wallets、pools、smart money、search。
    由 OpenAPI 自動生成，每種語言都帶請求/響應示例。
  </Card>

  <Card title="REST——DeFi" icon="right-left" href="/zh-Hant/api-reference/endpoint/defi/dex/v2/dex-chain-quote-get">
    DEX 聚合端點：報價、路由、模擬、swap、交易狀態。
  </Card>

  <Card title="WebSocket" icon="bolt" href="/zh-Hant/api-reference/endpoint/websocket/api">
    trades、prices、pools、smart-money flow 的實時訂閱通道。
  </Card>

  <Card title="Kafka 主題" icon="tower-broadcast" href="/zh-Hant/api-reference/kafka-topics/evm">
    各鏈的主題目錄、Protobuf schema、消費者示例。
  </Card>

  <Card title="CLI 命令" icon="terminal" href="/zh-Hant/api-reference/cli-commands/overview">
    `chainstream` CLI 完整參考——每個命令、引數、退出碼。
  </Card>

  <Card title="MCP 工具" icon="robot" href="/zh-Hant/api-reference/mcp-tools/overview">
    ChainStream MCP Server 暴露給 AI Agent 的所有工具清單。
  </Card>
</CardGroup>

## 鑑權

所有 REST 與 WebSocket 請求都需要 API Key、OAuth Token、錢包登入 Bearer 或 [x402 / MPP](/zh-Hant/docs/platform/billing-payments/x402-payments) 支付頭。完整矩陣見 [鑑權](/zh-Hant/api-reference/authentication/authenticate)。

## 約定

* **Base URL**——資料與 DeFi 共用 `https://api.chainstream.io`；具體路徑字首見各端點。
* **限流**——按套餐與按接入面限流；響應頭返回剩餘額度。完整表見 [平臺 / 限流](/zh-Hant/docs/platform/billing-payments/plans-and-units)。
* **錯誤**——所有接入面使用統一的 JSON 錯誤信封，見 [錯誤處理](/zh-Hant/docs/reference/error-codes)。
* **版本**——非破壞性變更持續灰度；破壞性變更會在 [Changelog](/zh-Hant/changelog/index) 公告並提供棄用視窗。

## 下一步

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/zh-Hant/docs/quickstart">
    發出第一個經過鑑權的請求。
  </Card>

  <Card title="SDK" icon="box" href="/zh-Hant/sdks/overview">
    TypeScript / Python / Go / Rust 型別化封裝。
  </Card>
</CardGroup>
