This is a simple Cloudflare Worker that transform Cohere API to OpenAI API, easily deployable to Cloudflare Workers.
- Transform Cohere API to OpenAI API
- Model listing endpoint (GET /models)
- Chat completion endpoint (POST /chat/completions)
- Detect
-internet
in model to use Internet connector - Tool Calling feature
To enable the use of the Internet connector in any chatbot client, we support models with -internet
in their name. While this is an unofficial feature, it helps reduce additional costs associated with using the Internet connector.
To utilize the Internet connector, simply append -internet
to the model name. For example, command-r-plus
would become command-r-plus-internet
.
- Clone this repository:
git clone https://github.com/ckt1031/cohere2openai-cf-worker.git --depth=1
- Run
npm install
to install dependencies - Run
npm run deploy
to deploy to Cloudflare Workers
This project is licensed under the MIT License.