claude-code-gpt-5-codex
by teremterem
Run Anthropic's Claude Code CLI with OpenAI models such as GPT-5-Codex, GPT-5.1, and others via a local LiteLLM proxy.
# Add to your Claude Code skills
git clone https://github.com/teremterem/claude-code-gpt-5-codexThis repository lets you use Anthropic's Claude Code CLI with OpenAI models such as GPT-5-Codex, GPT-5.1, and others via a local LiteLLM proxy.
⚠️ ATTENTION ⚠️
If you're here to set up
your own LiteLLM ServerwithLibreChatas the web UI (or any other OpenAI / Anthropic API compatible client, for that matter), head over to the litellm-server-boilerplate repository. It contains a "boilerplate" version of this repo with Claude Code CLI stuff stripped away, an optionalLibreChatset up, and aREADMEwhich specifically explains how to buildyour own AI agents and assistantson top of it.
Quick Start ⚡
Prerequisites
- OpenAI API key 🔑
- Anthropic API key 🔑 - optional (if you decide not to remap some Claude models to OpenAI)
- Either uv or Docker Desktop, depending on your preferred setup method
First time using GPT-5 via API?
If you are going to use GPT-5 via API for the first time, OpenAI may require you to verify your identity via Persona. You may encounter an OpenAI error asking you to “verify your organization.” To resolve this, you can go through the verification process here:
Setup 🛠️
-
Clone this repository:
git clone https://github.com/teremterem/claude-code-gpt-5-codex.git cd claude-code-gpt-5-codex -
Configure Environment Variables:
Copy the template file to create your
.env:cp .env.template .envEdit
.envand add your OpenAI API key:OPENAI_API_KEY=your-openai-api-key-here # Optional: only needed if you plan to use Anthropic models # ANTHROPIC_API_KEY=your-anthropic-api-key-here # Optional (see .env.template for details): # LITELLM_MASTER_KEY=your-master-key-here # Optional: specify the remaps explicitly if you need to (the values you see # below are the defaults - see .env.template for more info) # REMAP_CLAUDE_HAIKU_TO=gpt-5.1-codex-mini-reason-none # REMAP_CLAUDE_SONNET_TO=gpt-5-codex-reason-medium # REMAP_CLAUDE_OPUS_TO=gpt-5.1-reason-high # Some more optional settings (see .env.template for details) ... -
Run the proxy:
-
EITHER via
uv(make sure to install uv first):OPTION 1: Use a script for
uv:./uv-run.shOPTION 2: Run via a direct
uvcommand:...
-