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 中的富媒体
    • Fern 编辑器
    • 可复用代码片段
  • AI 功能
    • 概览
    • Fern Writer
    • AI 生成的示例
    • Markdown 访问
      • 概览
      • Agent 指令
      • 智能体指令
      • 分析与集成
    • MCP 服务器
    • API 目录发现
      • 概览
        • 简介
          • POSTPost Chat Completion
  • 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
预约演示登录免费开始
AI 功能Ask FernAPI referenceChat

Post Chat Completion

||以 Markdown 格式查看|
POST
/chat/:domain
POST
/chat/:domain
$curl -X POST https://fai.buildwithfern.com/chat/domain \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "messages": [
> {
> "role": "user",
> "content": "Can you explain the benefits of using renewable energy sources?"
> }
> ]
>}'
1{
2 "turns": [
3 {
4 "role": "user",
5 "content": "Can you explain the benefits of using renewable energy sources?"
6 },
7 {
8 "role": "assistant",
9 "content": "Renewable energy sources, such as solar and wind power, provide sustainable and environmentally friendly alternatives to fossil fuels. They help reduce greenhouse gas emissions, decrease air pollution, and promote energy independence."
10 }
11 ],
12 "citations": [
13 "https://www.epa.gov/greenpower/benefits-green-power",
14 "https://www.irena.org/renewable-energy"
15 ]
16}
此页面是否有帮助?
上一个

介绍

下一个

Create Code Record

身份验证

AuthorizationBearer

Bearer 身份验证,格式为 Bearer <token>,其中 token 是您的身份验证令牌。

路径参数

domainstring必需

请求

This endpoint expects an object.
messageslist of objects必需
The messages to use for the chat completion
modelenum or null可选
The model to use for the chat completion
允许的值:
max_tokensinteger or null可选100-3500默认为 3000

The maximum number of tokens to generate. Note: setting a token count lower than 2000 may result in incomplete responses. You can add a custom system prompt to control the verbosity of the response.

system_promptstring or null可选
The system prompt to use for the chat completion
rewrite_queryboolean or null可选默认为 false
Whether to rewrite the query using query decomposition

响应

Successful Response
turnslist of objects
The conversation turns in the chat completion
citationslist of strings
List of citation strings

错误

422
Unprocessable Entity Error