端点
Chat completions
通过 Capriole AI 模型创建 OpenAI 兼容的 Chat Completions。
POST
当应用、SDK 或网关需要 OpenAI Chat Completions 请求与响应格式时,请使用此端点。
发送包含
model 和 messages 的标准 Chat Completions 请求体。Capriole AI 会在转发给上游前,把 latest alias 解析为所选提供商的模型 ID;继续转发 messages、tools、tool_choice、response_format 和 stream 等兼容字段;并原样返回上游 JSON 或 SSE 流。对于流式请求,Capriole AI 会在转发前设置 stream_options.include_usage=true,以便记录用量。
POST /v1/chat/completions 接受 openai-latest、claude-latest、google-latest,以及 GET /v1/models 返回的公开具体模型 ID。使用 latest alias 可以让 Capriole AI 为对应提供商选择当前推荐的旗舰模型。
Latest alias 只是请求输入的快捷方式。用量按解析后的具体模型记录,响应体则保留所选兼容端点原有的模型命名方式。
Capriole 原生文本生成使用 POST /v1/chat。需要 OpenAI 兼容的传输格式时,请使用 POST /v1/chat/completions。授权
Use an API key created in the Capriole AI page. Send it as Authorization: Bearer sk-....
请求体
application/json
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 OpenAI-compatible conversation messages.
OpenAI-compatible tool definitions.
OpenAI-compatible tool choice.
OpenAI-compatible response format.
Stream the response as OpenAI-compatible server-sent events.
OpenAI-compatible stream options. For streaming requests, Capriole AI sets include_usage=true before upstream dispatch for usage accounting.
最后修改于 2026年8月18日