> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI4ZGUxYzRiYi04OTIzLTRmNTgtOGQzOC0wMGQzMTg3OTkxMWEiLCJleHAiOjE3NzgzMDIyMjYsImlhdCI6MTc3ODMwMTkyNn0.F2J3_LFnL6QN6ETI_clGLmCH0e5hywSWyP1Nrm5nWpE
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# API 参考文档概述

> 了解如何使用 Fern 生成、自定义和增强 API 参考文档。

Fern 从 [OpenAPI 规范](/learn/api-definitions/openapi/overview)、[Fern Definition](/learn/api-definitions/ferndef/overview) 或其他 API 格式生成交互式 API 参考文档。端点、类型模式、代码片段和 [AI 生成的示例](/learn/docs/ai-features/ai-examples) 都会自动填充。用户可以通过 [API Explorer](/learn/docs/api-references/api-explorer) 直接从文档中尝试请求。

## 选择你的 API 类型

<CardGroup cols={3}>
  <Card title="REST" icon="fa-duotone fa-globe" href="/learn/docs/api-references/generate-api-ref">
    OpenAPI 规范或 Fern Definition
  </Card>

  <Card title="gRPC" icon="fa-duotone fa-server" href="/learn/docs/api-references/generate-grpc-ref">
    Protocol Buffer `.proto` 文件
  </Card>

  <Card title="WebSocket" icon="fa-duotone fa-plug" href="/learn/docs/api-references/generate-websocket-ref">
    AsyncAPI 规范或 Fern Definition
  </Card>

  <Card title="Webhook" icon="fa-duotone fa-bell" href="/learn/docs/api-references/generate-webhook-ref">
    OpenAPI 规范或 Fern Definition
  </Card>

  <Card title="OpenRPC" icon="fa-duotone fa-brackets-curly" href="/learn/docs/api-references/generate-openrpc-ref">
    OpenRPC 规范
  </Card>

  <Card title="Library" icon="fa-duotone fa-book" href="/learn/docs/api-references/library-reference">
    Python 或 C++ 源代码
  </Card>
</CardGroup>

## 自定义和增强

<CardGroup cols={3}>
  <Card title="自定义布局" icon="fa-duotone fa-paintbrush" href="/learn/docs/api-references/customize-api-reference-layout">
    重新排序端点、按受众过滤并添加 Markdown 内容
  </Card>

  <Card title="SDK 代码片段" icon="fa-duotone fa-code" href="/learn/docs/api-references/sdk-snippets">
    在端点文档旁显示 SDK 代码示例
  </Card>

  <Card title="HTTP 代码片段" icon="fa-duotone fa-terminal" href="/learn/docs/api-references/http-snippets">
    显示 cURL、Python、JavaScript 和 Go 请求示例
  </Card>
</CardGroup>