For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
预约演示登录免费开始
  • 入门
    • 概览
    • 工作原理
    • 快速开始
    • 项目结构
    • Customer showcase
    • 变更日志
  • 配置
    • 概览
    • 站点级设置
    • 页面级设置
  • 编写内容
    • Markdown 基础
    • Markdown 中的富媒体
      • 概览
      • 折叠面板
      • 旁注
      • 按钮
      • 徽章
      • 下载
      • 提示框
      • 卡片
      • 代码块
      • 复制组件
      • 下载组件
      • 端点请求片段
      • 端点响应片段
      • 端点模式代码片段
      • Webhook 负载片段
      • 文件
      • 框架
      • 图标
      • If
      • 缩进
      • 参数字段
      • 提示词组件
      • Runnable endpoint
      • 模式组件
      • 步骤
      • 表格
      • 标签页
      • 工具提示
      • 版本
    • Fern 编辑器
    • 可复用代码片段
  • AI 功能
    • 概览
    • Fern Writer
    • AI 生成的示例
    • Markdown 访问
      • 概览
      • Agent 指令
      • 智能体指令
      • 分析与集成
    • MCP 服务器
    • API 目录发现
  • Public API
    • GETJWT from Fern API key
    • GETAlgolia search credentials
    • GETCurrent user information
  • Fern Writer API
    • GETGet Fern Writer Install Link
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
预约演示登录免费开始
在本页
  • 使用方法
  • 引用特定示例
  • 变体
  • 过滤语言
  • 显示有效载荷
  • 隐藏试用按钮
  • 属性
编写内容组件

端点请求片段

||以 Markdown 格式查看|
此页面是否有帮助?
在仪表板中编辑
上一个

Download

下一个

端点响应代码片段

使用 <EndpointRequestSnippet> 组件来引用 API Reference 中的端点请求。

使用方法

POST
/chat/:domain
1curl -X POST https://fai.buildwithfern.com/chat/domain \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "messages": [
6 {
7 "role": "user",
8 "content": "string"
9 }
10 ]
11}'
试一试
Markdown
1<EndpointRequestSnippet endpoint="POST /chat/{domain}" />

引用特定示例

1

在规范中设置示例名称

openapi.yml
1paths:
2 /pet:
3 put:
4 summary: Update an existing pet
5 operationId: pets_update
6 requestBody:
7 content:
8 application/json:
9 schema:
10 $ref: '#/components/schemas/Pet'
11 examples:
12 ExampleWithMarkley:
13 value:
14 name: Markley
15 id: 44
2

直接引用示例

Markdown
1 <EndpointRequestSnippet
2 endpoint="PUT /pet"
3 example="ExampleWithMarkley"
4 />
引用示例

如果示例包含 summary 或 docs 字段,请将其用作 example 属性的值。如果没有设置 summary,则使用示例名称。

变体

过滤语言

使用 languages 属性来过滤下拉菜单中显示的语言并控制其顺序。

POST
/chat/:domain
1curl -X POST https://fai.buildwithfern.com/chat/domain \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "messages": [
6 {
7 "role": "user",
8 "content": "string"
9 }
10 ]
11}'
试一试
Markdown
1<EndpointRequestSnippet
2 endpoint="POST /chat/{domain}"
3 languages={["curl", "python", "typescript"]}
4/>

显示有效载荷

payload 选项为 POST/PUT/PATCH 请求显示原始 JSON 请求体,或为 GET 请求显示查询参数。

POST
/chat/:domain
1curl -X POST https://fai.buildwithfern.com/chat/domain \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "messages": [
6 {
7 "role": "user",
8 "content": "string"
9 }
10 ]
11}'
试一试
Markdown
1<EndpointRequestSnippet
2 endpoint="POST /chat/{domain}"
3 languages={["curl", "python", "payload"]}
4/>

隐藏试用按钮

EndpointRequestSnippet 组件默认包含一个试用按钮。使用 hideTryItButton 属性来隐藏它。

POST
/chat/:domain
1curl -X POST https://fai.buildwithfern.com/chat/domain \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "messages": [
6 {
7 "role": "user",
8 "content": "string"
9 }
10 ]
11}'
Markdown
1<EndpointRequestSnippet
2 endpoint="POST /chat/{domain}"
3 hideTryItButton={true}
4/>

属性

endpoint
stringRequired

要显示的端点,格式为 METHOD /path(例如:POST /chat/{domain})。如果您的 API 使用命名空间,请在前面加上命名空间和 ::(例如:payments::POST /chat/{domain})。

example
string

要显示的特定示例的名称。如果示例包含 summary 或 docs 字段,请使用该值。

highlight
number | number[]

代码片段中要高亮的行号。接受单个数字、数字数组或范围(例如:{[1-3, 5]})。

languages
string[]

指定下拉菜单中显示哪些语言以及显示顺序。支持的值包括 curl、python、typescript、javascript、go、ruby、java、kotlin、csharp、php、swift、rust 和 payload。未指定时,显示所有可用语言。

hideTryItButton
boolean

当设置为 true 时,从片段中隐藏试用按钮。