一键切换
各平台支持的切换前后配置对照。
切换一个平台只需改两个值:base URL 与凭据。请求体、流式与错误格式全部保持 供应商原样。
规则
把供应商那一整段 base URL 换成本网关对应平台的前缀,请求路径保持官方文档的写法不变。
不要多加或少写版本段
OpenAI 的 base 已含 /v1,所以要调的是 /chat/completions;自己再加一个 /v1 会拼成
/v1/v1/…。Claude 的 base 不含版本段,因此它的路径确实以 /v1/messages 开头。
OpenAI
- 上游 base
- https://api.openai.com/v1
- 网关 base
- https://sluiceline.com/openai
- 鉴权凭据
- Authorization: Bearer <safe-key>
DeepSeek
- 上游 base
- https://api.deepseek.com
- 网关 base
- https://sluiceline.com/deepseek
- 鉴权凭据
- Authorization: Bearer <safe-key>
Claude
- 上游 base
- https://api.anthropic.com
- 网关 base
- https://sluiceline.com/anthropic
- 鉴权凭据
- x-api-key: <safe-key> · anthropic-version: 2023-06-01
fal.ai
- 上游 base
- https://fal.run
- 网关 base
- https://sluiceline.com/fal
- 上游 base(/falqueue)
- https://queue.fal.run
- 网关 base
- https://sluiceline.com/falqueue
- 鉴权凭据
- Authorization: Key <safe-key>
ByteDance
- 上游 base
- https://ark.ap-southeast.bytepluses.com/api/v3
- 网关 base
- https://sluiceline.com/seedance
- 鉴权凭据
- Authorization: Bearer <safe-key>
各平台注意事项
| 平台 | 说明 |
|---|---|
| OpenAI | 把 SDK 的 base_url 指向网关。/chat/completions、/images/generations 等路径由 SDK 自行拼接 |
| DeepSeek | 与 OpenAI 兼容:继续使用 OpenAI SDK,只改 base_url 与密钥 |
| Claude | 把 Anthropic SDK 的 base_url 指向网关。它发送 x-api-key,网关替换为你真实的 Claude 密钥 |
| fal.ai | 使用 Key 方案而非 Bearer。同步调用走 /fal 前缀;异步队列有独立前缀 /falqueue |
| ByteDance Seedance | BytePlus ModelArk 上的 Seedance,即国际站方舟(区域 ap-southeast-1)。先创建任务再轮询,路径与方舟一致 |
不变的部分
- 你的 SDK、它的重试逻辑与错误类型。
- 请求体与响应体,逐字节不变。
- 流式(SSE)帧格式,包括 OpenAI 兼容平台的
data: [DONE]。