本服务为透明代理,不存储任何 API Key,请在请求头中携带对应平台的鉴权信息。
https://fansa91.workers.dev/{平台名}/{接口路径}
示例:https://fansa91.workers.dev/openai/v1/chat/completions
请在 HTTP Header 中携带对应平台的 Key:
Authorization: Bearer <你的 API Key>
部分平台使用不同字段:
x-api-key 头,且需携带 anthropic-version 头Authorization: Token ?key=xxx 中| 平台 | 代号 | 上游地址 | 类型 |
|---|---|---|---|
| 阿里云通义千问 | qwen | dashscope.aliyuncs.com | 国内 |
| 月之暗面 (Moonshot) | moonshot | api.moonshot.cn | 国内 |
| 智谱 AI | zhipu | open.bigmodel.cn | 国内 |
| MiniMax | minimax | api.minimaxi.com | 国内 |
| 百度千帆 (Qianfan) | baidu | qianfan.baidubce.com | 国内 |
| OpenAI | openai | api.openai.com | 海外 |
| Anthropic (Claude) | anthropic | api.anthropic.com | 海外 |
| Google Gemini | google | generativelanguage.googleapis.com | 海外 |
| Perplexity | perplexity | api.perplexity.ai | 海外 |
| xAI (Grok) | xai | api.x.ai | 海外 |
| DeepSeek | deepseek | api.deepseek.com | 海外 |
| Groq | groq | api.groq.com | 海外 |
| Together AI | together | api.together.xyz | 海外 |
| Cohere | cohere | api.cohere.ai | 海外 |
| Mistral AI | mistral | api.mistral.ai | 海外 |
| Replicate | replicate | api.replicate.com | 海外 |
| HuggingFace | huggingface | api-inference.huggingface.co | 海外 |
curl -X POST https://fansa91.workers.dev/openai/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-your-openai-key" -d '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"你好"}]}'
curl -X POST https://fansa91.workers.dev/qwen/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-your-qwen-key" -d '{"model":"qwen-turbo","messages":[{"role":"user","content":"你好"}]}'
curl -X POST https://fansa91.workers.dev/anthropic/v1/messages -H "Content-Type: application/json" -H "x-api-key: sk-ant-your-key" -H "anthropic-version: 2023-06-01" -d '{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"你好"}]}'