跳至主要内容

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