A cloudflare worker to covert cohere api to openai api 中文文档
- Create a new worker in cloudflare
- Copy the code in
worker.js
to the worker - Setting environment variables in the worker
API_AUTH_TOKEN
: your cohere api key
- Deploy the worker
- Use the worker url as the api endpoint
- Band custom domain to the worker if needed (Optional)
I force the worker to use command-r-plus
model, the code is here, you can annotate it if you want to use other models.