Skip to main content
POST
当应用、SDK 或网关需要 OpenAI Chat Completions 请求与响应格式时,请使用此端点。 发送包含 modelmessages 的标准 Chat Completions 请求体。Capriole AI 会在转发给上游前,把 latest alias 解析为所选提供商的模型 ID;继续转发 messagestoolstool_choiceresponse_formatstream 等兼容字段;并原样返回上游 JSON 或 SSE 流。对于流式请求,Capriole AI 会在转发前设置 stream_options.include_usage=true,以便记录用量。 POST /v1/chat/completions 接受 openai-latestclaude-latestgoogle-latest,以及 GET /v1/models 返回的公开具体模型 ID。使用 latest alias 可以让 Capriole AI 为对应提供商选择当前推荐的旗舰模型。 Latest alias 只是请求输入的快捷方式。用量按解析后的具体模型记录,响应体则保留所选兼容端点原有的模型命名方式。 Capriole 原生文本生成使用 POST /v1/chat。需要 OpenAI 兼容的传输格式时,请使用 POST /v1/chat/completions

授权

Authorization
string
header
必填

Use an API key created in the Capriole AI page. Send it as Authorization: Bearer sk-....

请求体

application/json
model
enum<string>
必填

Public model identifier or latest alias returned by GET /v1/models

可用选项:
openai-latest,
openai/gpt-5.6-terra,
openai/gpt-5.6-luna,
openai/gpt-5.5,
openai/gpt-5.4-mini,
claude-latest,
anthropic/claude-fable-5,
anthropic/claude-opus-5,
anthropic/claude-opus-4-8,
anthropic/claude-opus-4-7,
anthropic/claude-opus-4-6,
anthropic/claude-sonnet-4-6,
google-latest,
google/gemini-3.1-pro-preview,
google/gemini-3.5-flash,
xai/grok-4.5,
zai/glm-5.2,
moonshot/kimi-k3
messages
object[]
必填

OpenAI-compatible conversation messages.

tools
object[]

OpenAI-compatible tool definitions.

tool_choice

OpenAI-compatible tool choice.

response_format
object

OpenAI-compatible response format.

stream
boolean
默认值:false

Stream the response as OpenAI-compatible server-sent events.

stream_options
object

OpenAI-compatible stream options. For streaming requests, Capriole AI sets include_usage=true before upstream dispatch for usage accounting.

响应

OpenAI-compatible Chat Completions response or SSE stream. Response model fields follow the selected compatible endpoint and may differ from the input alias.

id
string
必填
object
string
必填
示例:

"chat.completion"

created
integer
必填
model
string
必填
choices
object[]
必填
usage
object
最后修改于 2026年8月18日