Skip to main content
POST
当应用、SDK 或代理需要 Anthropic Messages 请求与响应格式时,请使用此端点。 发送包含 modelmessagesmax_tokens 的标准 Messages 请求体。Capriole AI 会在转发给上游前,把 latest alias 解析为所选上游 Claude 模型;继续转发 systemtoolsthinkingstream 等兼容字段;并原样返回上游 JSON 或 SSE 流。 POST /v1/messages 接受 claude-latestclaude-fable-5claude-opus-5claude-opus-4-8claude-opus-4-7claude-opus-4-6claude-sonnet-4-6。使用 claude-latest 可以在不修改配置的情况下选择 Fable 5。 POST /v1/messages/count_tokens 接受相同的 Claude 模型 ID,用于执行 Anthropic 兼容的 Token 计数检查。它会返回所选上游的 Token 计数响应或错误。 简单的 Capriole 原生文本生成使用 POST /v1/chat。需要 Anthropic Messages 传输格式时,请使用 POST /v1/messages

授权

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 Anthropic Messages model identifier or Claude latest alias

可用选项:
claude-latest,
claude-fable-5,
claude-opus-5,
claude-opus-4-8,
claude-opus-4-7,
claude-opus-4-6,
claude-sonnet-4-6
messages
object[]
必填

Anthropic-compatible conversation messages.

max_tokens
integer
必填

Maximum number of output tokens.

system

Optional Anthropic-compatible system prompt.

tools
object[]

Anthropic-compatible tool definitions.

thinking
object

Anthropic-compatible thinking options.

stream
boolean
默认值:false

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

响应

Anthropic Messages-compatible JSON response or SSE stream

Anthropic Messages-compatible response body.

最后修改于 2026年8月18日