songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
17.87k stars 4.05k forks source link

希望能支持Anthropic Claude使用Cloudflare AI Gateway #1118

Open InternetBugs opened 6 months ago

InternetBugs commented 6 months ago

例行检查

功能描述 如题,使用Cloudflare AI Gateway调用Claude api 仿照openai api,把https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/anthropic填入代理一栏会报404错误 应用场景 使用cf ai gateway的功能对多个api进行管理

MustAPI commented 6 months ago

curl -X POST https://gateway.ai.cloudflare.com/v1/60a4646caf1c28e91fce1653158957cd/yeqiupm/anthropic/messages \ -H 'x-api-key: XXX' \ -H "anthropic-version: 2023-06-01" \ -H 'Content-Type: application/json' \ -d '{ "model": "claude-3-opus-20240229", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Hello, world"} ] }'