Anthropic 兼容接口
Base URL
Section titled “Base URL”https://zhangsan.yun部分客户端会自动拼接 /v1/messages,这时不要重复填写 /v1/messages。
curl 示例
Section titled “curl 示例”curl https://zhangsan.yun/v1/messages \ -H "x-api-key: sk-你的 API 密钥" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5", "max_tokens": 512, "messages": [ {"role": "user", "content": "用三句话解释 API 网关"} ] }'- 如果客户端要求填写 Anthropic Base URL,优先填
https://zhangsan.yun。 - 如果客户端要求填写完整 API 地址,再填
https://zhangsan.yun/v1/messages。 - API Key 使用你的 NewAPI 密钥。