> 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.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJhYTA4ZGUzMS1iZjAxLTRhNWEtYWZlMC1lMTIyY2FjMDNhZjUiLCJleHAiOjE3NzgyNTkwNjgsImlhdCI6MTc3ODI1ODc2OH0.bFw01jOQTEp3GJ87E35LEIlM2A9cRPGf-rPOnFZ5z-8
>
> 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.

# AI 功能

> Fern AI 功能帮助用户即时找到答案，自动更新内容，并通过 llms.txt 支持为 AI 工具优化文档。

您的文档站点自带针对 AI 工具的自动优化，以及可供安装的功能，帮助用户找到答案并保持内容的及时更新。

<Anchor id="ai-credits">
  <Tip title="AI 额度">
    AI 功能按使用量计费并消耗额度。每个 [套餐](https://buildwithfern.com/pricing) 都包含每月额度配额：Hobby 套餐获得 250 额度，Pro 套餐获得 1,000 额度，Enterprise 套餐获得自定义额度。

    | 功能             | 额度          |
    | -------------- | ----------- |
    | Ask Fern       | 每条消息消耗 2 额度 |
    | AI 生成示例        | 1 额度        |
    | Fern Writer 会话 | 50 额度       |
  </Tip>
</Anchor>

## 查找答案

无论用户在何处工作，都能即时获取来自您文档的带引用答案。Ask Fern 提供以下形式：嵌入式聊天小部件、用于自定义集成的 [API](/learn/docs/ai-features/ask-fern/api-reference/overview)，以及面向社区的 [Slack 应用](/learn/docs/ai-features/ask-fern/slack-app)。对于使用 Claude Code、Cursor、Windsurf 等 AI 客户端的开发者，Fern 还托管了 MCP 服务器，便于他们直接从开发环境中查询文档。

<CardGroup cols={3}>
  <Card title="Ask Fern 概览" icon="sparkles" href="/learn/docs/ai-features/ask-fern/overview" />

  <Card title="Ask Fern Slack 应用" icon="fa-brands fa-slack" href="/learn/docs/ai-features/ask-fern/slack-app" />

  <Card title="MCP 服务器" icon="plug" href="/learn/docs/ai-features/mcp-server" />
</CardGroup>

## 创建和更新内容

AI 帮助保持您的文档实时更新。Fern Writer 是一个基于 Slack 的技术写作代理，当您标记 `@Fern Writer` 请求更新时，它会创建带有针对性编辑的 pull request。对于 API 参考文档，Fern 会根据您的 OpenAPI 规范自动生成贴近实际的示例，并随规范变更同步更新，将 `"string"` 等占位值替换为可信的数据。

<CardGroup cols={2}>
  <Card title="Fern Writer" icon="pen-line" href="/learn/docs/ai-features/fern-writer" />

  <Card title="AI 生成示例" icon="brackets-curly" href="/learn/docs/ai-features/ai-examples" />
</CardGroup>

## 为 AI 优化

您的站点会针对 AI 工具和搜索引擎进行自动优化。Fern 托管 `llms.txt` 和 `llms-full.txt` 文件，便于 LLM 高效索引您的文档，并向 AI 代理返回 Markdown 而非 HTML。这些功能可减少 token 消耗，帮助代理更快处理您的内容。

<CardGroup cols={2}>
  <Card title="`llms.txt`" icon="file-text" href="/learn/docs/ai-features/llms-txt" />

  <Card title="代理指令" icon="compass" href="/learn/docs/ai-features/agent-directives" />
</CardGroup>