> ## 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](/cn/docs/quickstart) 或 [接入方式总览](/cn/docs/access-methods/overview)；需要精确字段名、限流额度、schema 时再回到这里查。

## 接入面一览

<CardGroup cols={2}>
  <Card title="REST——数据" icon="database" href="/cn/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="/cn/api-reference/endpoint/defi/dex/v2/dex-chain-quote-get">
    DEX 聚合端点：报价、路由、模拟、swap、交易状态。
  </Card>

  <Card title="WebSocket" icon="bolt" href="/cn/api-reference/endpoint/websocket/api">
    trades、prices、pools、smart-money flow 的实时订阅通道。
  </Card>

  <Card title="Kafka 主题" icon="tower-broadcast" href="/cn/api-reference/kafka-topics/evm">
    各链的主题目录、Protobuf schema、消费者示例。
  </Card>

  <Card title="CLI 命令" icon="terminal" href="/cn/api-reference/cli-commands/overview">
    `chainstream` CLI 完整参考——每个命令、参数、退出码。
  </Card>

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

## 鉴权

所有 REST 与 WebSocket 请求都需要 API Key、OAuth Token、钱包登录 Bearer 或 [x402 / MPP](/cn/docs/platform/billing-payments/x402-payments) 支付头。完整矩阵见 [鉴权](/cn/api-reference/authentication/authenticate)。

## 约定

* **Base URL**——数据与 DeFi 共用 `https://api.chainstream.io`；具体路径前缀见各端点。
* **限流**——按套餐与按接入面限流；响应头返回剩余额度。完整表见 [平台 / 限流](/cn/docs/platform/billing-payments/plans-and-units)。
* **错误**——所有接入面使用统一的 JSON 错误信封，见 [错误处理](/cn/docs/reference/error-codes)。
* **版本**——非破坏性变更持续灰度；破坏性变更会在 [Changelog](/cn/changelog/index) 公告并提供弃用窗口。

## 下一步

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/cn/docs/quickstart">
    发出第一个经过鉴权的请求。
  </Card>

  <Card title="SDK" icon="box" href="/cn/sdks/overview">
    TypeScript / Python / Go / Rust 类型化封装。
  </Card>
</CardGroup>
