Providers
Claude Custom
配置自定义 Claude 兼容服务
Claude Custom
Claude Custom 允许你配置 Anthropic 官方 API 或其他 Claude 兼容服务。
适用场景
- 使用 Anthropic 官方 API
- 使用 AWS Bedrock Claude
- 使用其他 Claude 兼容服务
API Key 配置
获取 API Key
Anthropic 官方:
- 访问 Anthropic Console
- 进入 API Keys 页面
- 创建新的 API Key
AWS Bedrock:
- 访问 AWS Console
- 配置 Bedrock 访问权限
- 获取 AWS 凭证
在 ProxyCast 中配置
- 进入 凭证池 页面
- 点击 添加凭证
- 选择 Claude Custom
- 填写配置信息:
| 字段 | 说明 |
|---|---|
| 名称 | 凭证标识名称 |
| API Key | Anthropic API Key |
| Base URL | API 端点(可选) |
Base URL 设置
默认端点
不填写 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 |
API 版本
版本配置
Anthropic API 需要指定版本:
claude-custom:
api_version: "2023-06-01"
请求头
Claude API 使用特定的请求头:
x-api-key: your-api-key
anthropic-version: 2023-06-01
AWS Bedrock 配置
使用 AWS 凭证
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 角色
推荐使用 IAM 角色而非 Access Key:
- 配置 IAM 角色
- 授予 Bedrock 访问权限
- ProxyCast 自动使用角色凭证
高级配置
自定义请求头
claude-custom:
headers:
X-Custom-Header: "value"
超时设置
claude-custom:
timeout:
connect: 10s
request: 180s # Claude 响应可能较慢
故障排除
API Key 无效
- 确认 API Key 正确
- 检查 Key 是否过期
- 确认账户状态正常
模型访问被拒
- 确认账户有该模型的访问权限
- 某些模型需要申请访问
- 检查使用限制
速率限制
| 错误 | 解决方案 |
|---|---|
| 429 Too Many Requests | 降低请求频率 |
| rate_limit_error | 等待后重试 |
Bedrock 问题
- 确认 AWS 凭证正确
- 检查 IAM 权限
- 确认区域支持 Claude