跳到主要内容

Claude 协议

使用 Claude Messages 格式连接 PopGo API。

服务地址

用途方法路径
MessagesPOST/v1/messages

最小请求

Base URL 使用根地址,认证放在 x-api-key 请求头中。

curl https://api.popgo.site/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "YOUR_MODEL",
"max_tokens": 64,
"messages": [
{"role": "user", "content": "请回复连接成功"}
]
}'

验证

成功响应包含内容块。认证错误时检查 x-api-key,路径错误时检查客户端是否正确追加 /v1/messages