claude-code-gpt-5-codex

作者 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.

234
Stars
25
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/teremterem/claude-code-gpt-5-codex

快速入门

使用 claude-code-gpt-5-codex 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Claude Code with GPT-5 Codex

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:

      uv run litellm --config config.yaml
      
    2. OR via Docker (make sure to install Docker Desktop first):

      OPTION 3: Run Docker in the foreground:

      ./run-docker.sh
      

      OPTION 4: Run Docker in the background:

      ./deploy-docker.sh
      

      OPTION 5: Run Docker via a direct command:

      docker run -d \
         --name claude-code-gpt-5 \
         -p 4000:4000 \
         --env-file .env \
         --restart unless-stopped \
         ghcr.io/teremterem/claude-code-gpt-5:latest
      

      NOTE: To run with this command in the foreground instead of the background, remove the -d flag.

      To see the logs, run:

      docker logs -f claude-code-gpt-5
      

      To stop and remove the container, run:

      ./kill-docker.sh
      

      NOTE: The Docker options above will pull the latest image from GHCR and will ignore all your local files except .env. For more detailed Docker deployment instructions and more options (like building Docker image from source yourself, using Docker Compose, etc.), see docs/DOCKER_TIPS.md

Using with Claude Code 🎮

  1. Install Claude Code (if you haven't already):

    npm install -g @anthropic-ai/claude-code
    
  2. Connect it to the proxy:

    ANTHROPIC_BASE_URL=http://localhost:4000 claude
    

    If you set LITELLM_MASTER_KEY in your .env file (see .env.template for details), pass it as the Anthropic API key for the CLI:

    ANTHROPIC_API_KEY="<LITELLM_MASTER_KEY>" \
    ANTHROPIC_BASE_URL=http://localhost:4000 \
    claude
    

    NOTE: In this case, if you've previously authenticated, run claude /logout first.

That's it! Your Claude Code client will now use the OpenAI models that this repo recommends by default (unless you explicitly specified different choices in your .env file). 🎯


Model aliases

You can find the full list of available OpenAI models in the OpenAI API documentation. Additionally, this proxy allows you to control the reasoning effort level for each model by appending it to the model name following the pattern -reason-<effort> (or -reasoning-<effort>, if you prefer). Here are some examples:

  • gpt-5.1-codex-mini-reason-none
  • gpt-5.1-codex-mini-reason-medium
  • gpt-5.1-codex-mini-reason-high

If you don't specify the reasoning effort level (i.e. only specify the model name, like gpt-5.1-codex-mini), it will use the default level for the model.

NOTE: Theoretically, you can use arbitrary models from arbitrary providers, but for providers other than OpenAI or Anthropic, you will need to specify the provider as a prefix in the model name, e.g. gemini/gemini-pro, gemini/gemini-pro-reason-disable etc. (as well as set the respective API key for that provider in your .env file).

KNOWN PROBLEM

The Web Search tool currently does not work with this setup. You may see an error like:

API Error (500 {"error":{"message":"Error calling litellm.acompletion for non-Anthropic model: litellm.BadRequestError: OpenAIException - Invalid schema for function 'web_search': 'web_search_20250305' is not valid under any of the given schemas.","type":"None","param":"None","code":"500"}}) · Retrying in 1 seconds… (attempt 1/10)

This is planned to be fixed soon.

NOTE: The Fetch tool (getting web content from specific URLs) is not affected and works normally.

P. S. You are welcome to join our MiniAgents Discord Server 👥

And if you like the project, please give it a Star 💫

Star History Chart

常见问题

What is claude-code-gpt-5-codex?

claude-code-gpt-5-codex is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built 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. It has 234 GitHub stars.

Is claude-code-gpt-5-codex safe to use?

Yes. claude-code-gpt-5-codex passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install claude-code-gpt-5-codex?

Clone the repository with "git clone https://github.com/teremterem/claude-code-gpt-5-codex" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is claude-code-gpt-5-codex written in?

claude-code-gpt-5-codex is primarily written in Python. It is open-source under teremterem on GitHub, so you can review or fork the full source.

Are there alternatives to claude-code-gpt-5-codex?

Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh claude-code-gpt-5-codex against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI 工具ai-skillsantigravity
查看详情

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI 工具
查看详情

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI 工具
查看详情

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI 工具
查看详情

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI 工具
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情