Claude Custom 允许你配置 Anthropic 官方 API 或其他 Claude 兼容服务。
Anthropic 官方:
AWS Bedrock:
| 字段 | 说明 |
|---|---|
| 名称 | 凭证标识名称 |
| API Key | Anthropic API Key |
| Base URL | API 端点(可选) |
不填写 Base URL 时,使用 Anthropic 官方端点:
https://api.anthropic.com
| 服务 | Base URL |
|---|---|
| Anthropic 官方 | https://api.anthropic.com |
| AWS Bedrock | 使用 AWS SDK |
| 代理服务 | 自定义 URL |
providers:
- name: anthropic-official
type: claude-custom
api_key: "sk-ant-..."
# 使用默认 Base URL
- name: claude-proxy
type: claude-custom
api_key: "..."
base_url: "https://my-proxy.example.com"
| 模型 | 说明 |
|---|---|
| claude-sonnet-4-20250514 | Claude Sonnet 4 |
| claude-3-5-sonnet-20241022 | Claude 3.5 Sonnet |
| claude-3-5-haiku-20241022 | Claude 3.5 Haiku |
| claude-3-opus-20240229 | Claude 3 Opus |
Anthropic API 需要指定版本:
claude-custom:
api_version: "2023-06-01"
Claude API 使用特定的请求头:
x-api-key: your-api-key
anthropic-version: 2023-06-01
bedrock-claude:
type: claude-custom
aws_region: "us-east-1"
aws_access_key: "..."
aws_secret_key: "..."
model_id: "anthropic.claude-3-sonnet-20240229-v1:0"
推荐使用 IAM 角色而非 Access Key:
claude-custom:
headers:
X-Custom-Header: "value"
claude-custom:
timeout:
connect: 10s
request: 180s # Claude 响应可能较慢
| 错误 | 解决方案 |
|---|---|
| 429 Too Many Requests | 降低请求频率 |
| rate_limit_error | 等待后重试 |