The Claude2OpenAI is a python server that has the following features:
- Ability to intercepts the calls from Claude cli in Claude API format.
- Convert those calls to OpenAI format.
- Route the converted calls to an OpenAI compatible server.
- Get the response from the OpenAI compatible server.
- Convert the Open AI response to Claude API format.
- Send the response back to the Claude cli.
In the given config.toml file add only the following 2 values and launch the python server. Start using claude like you normally would and voila, everything just works!
- Open AI Base URL
- Open AI Key
Add any other necessary parameters to the configuration file.
See docs/USAGE.md for setup, configuration, and request/response details.
Modify your ~/.claude/settings.json to the following.
{
"env": {
"ANTHROPIC_API_KEY": "non-empty-string",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:8080/v1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ENABLE_TELEMETRY": "0"
},
"autoUpdatesChannel": "latest",
"api_base_url": "http://127.0.0.1:8080/v1",
"api_key": "any-non-empty-string",
"apiBaseUrl": "http://127.0.0.1:8080/v1",
"apiKey": "any-non-empty-string"
}
Export following environment variables from your .basrc/.zshrc shell as needed.
export DISABLE_TELEMETRY="true"
export DISABLE_COST_WARNINGS="true"
export API_TIMEOUT_MS="600000"
unset CLAUDE_CODE_USE_BEDROCK
Raise an issue in github as needed. Feel free to contribute. Source code released under (Apache license 2.0)[https://choosealicense.com/licenses/apache-2.0/].
(c) 2026 Naresh Mehta
