claude-code-gpt-5-codex

by teremterem

Pending

Run Anthropic's Claude Code CLI with OpenAI models such as GPT-5-Codex, GPT-5.1, and others via a local LiteLLM proxy.

186stars
22forks
Python
Added 12/27/2025
CLI Toolsanthropicclaude-codeclaude-code-adapterclaude-code-cliclaude-code-proxygpt-5gpt-5-codexgpt-5-progpt-51gpt-51-codexgpt5gpt51gpt51codexgpt5codexgpt5prolitellmopenai
Installation
# Add to your Claude Code skills
git clone https://github.com/teremterem/claude-code-gpt-5-codex
README.md
<p align="center"> <img alt="Claude Code with GPT-5 Codex" src="https://raw.githubusercontent.com/teremterem/claude-code-gpt-5-codex/main/images/claude-code-gpt-5-codex2.jpeg"> </p>

This 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 Server with LibreChat as 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 optional LibreChat set up, and a README which specifically explains how to build your own AI agents and assistants on top of it.

Quick Start ⚡

Prerequisites

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 🛠️

  1. Clone this repository:

    git clone https://github.com/teremterem/claude-code-gpt-5-codex.git
    cd claude-code-gpt-5-codex
    
  2. Configure Environment Variables:

    Copy the template file to create your .env:

    cp .env.template .env
    

    Edit .env and 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)
    ...
    
  3. Run the proxy:

    1. EITHER via uv (make sure to install uv first):

      OPTION 1: Use a script for uv:

      ./uv-run.sh
      

      OPTION 2: Run via a direct uv command:

      ...