Using OpenAI with Claude Code | Codex Integration and Model Switching

Most people searching "openai claude code" want to know one of the following: Is Claude Code made by OpenAI? Can you run OpenAI models inside Claude Code? Can OpenAI's Codex and Claude Code be integrated? To answer directly: Claude Code is made by Anthropic, not OpenAI. However, as of 2026, ways to combine the two have grown rapidly — both through official and unofficial channels. This article breaks down that reality into three routes.
There are three routes for combining them. ① Delegate reviews and tasks from Claude Code to Codex using OpenAI's official Codex Plugin for Claude Code. ② Run Claude Code itself on OpenAI models using claude-code-proxy or similar. ③ Call Claude from OpenAI SDK code using Claude API's OpenAI SDK compatibility layer.
This article helps you identify which pattern you are looking for, and explains each route with setup commands and environment variables drawn from primary sources.
目次 (12)
- First, a Clarification: Claude Code is Anthropic, a Separate Company from OpenAI
- The 3 Patterns Behind "openai claude code"
- ① OpenAI's Official Codex Plugin for Claude Code
- Prerequisites
- Installation Steps
- Added Commands
- ② Running Claude Code on OpenAI Models (claude-code-proxy)
- ③ Calling Claude via the OpenAI SDK Compatibility Layer
- Bonus: For Those Who Want to Compare Codex CLI and Claude Code
- Which Route Should You Choose?
- Caveats: Unofficial Tools Come With Behavioral Differences and Maintenance Risk
- Summary
First, a Clarification: Claude Code is Anthropic, a Separate Company from OpenAI
Claude Code is a terminal-resident coding CLI provided by Anthropic. It is a separate company from OpenAI, which makes ChatGPT, GPT, and Codex — different developers, different models. This point is covered in other articles such as the Claude 3.7 Sonnet overview and the Claude vs OpenAI API comparison — as a brand, the two are clearly distinct.
So why does the combined search "openai claude code" even exist? Because there is real demand to bridge Claude Code and OpenAI. Developers who want to use Claude Code as their primary environment while also leveraging OpenAI's models or review capabilities now have ways to do exactly that.
The 3 Patterns Behind "openai claude code"
Search intent generally falls into one of three categories. Identifying which one applies to you will save you a lot of confusion.
| Pattern | What you want to do | Primary approach |
|---|---|---|
| ① Call Codex | Delegate reviews or tasks from Claude Code to OpenAI's Codex | OpenAI's official Codex Plugin for Claude Code |
| ② Swap the model | Run Claude Code itself on GPT or other OpenAI models | claude-code-proxy / AI gateway |
| ③ Reuse the SDK | Call Claude from OpenAI SDK code | Claude API's OpenAI SDK compatibility layer |
The following sections cover each route based on primary sources.
① OpenAI's Official Codex Plugin for Claude Code
One of the most talked-about developments of 2026 was the "Codex Plugin for Claude Code" released by OpenAI itself. This plugin lets you assign code reviews and tasks to OpenAI's Codex without leaving Claude Code. The repository is published at openai/codex-plugin-cc. The OpenAI Developer Community announcement also emphasizes that it integrates into your existing workflow without needing to spin up a separate Codex environment (Introducing Codex Plugin for Claude Code).
Prerequisites
Before installation, make sure you have the following:
- A ChatGPT subscription or an OpenAI API key
- Node.js 18.18 or later
- Codex CLI installed locally (if not yet installed:
npm install -g @openai/codex) - A working Claude Code environment
Installation Steps
Run the following commands inside Claude Code, in order:
- Add the marketplace:
/plugin marketplace add openai/codex-plugin-cc - Install the plugin:
/plugin install codex@openai-codex - Reload plugins:
/reload-plugins - Initial setup:
/codex:setup
Added Commands
After installation, Codex functionality becomes available as slash commands inside Claude Code:
/codex:review— A standard, read-only code review/codex:adversarial-review— A challenging review that questions implementation choices/codex:rescue— Delegates work to Codex via a sub-agent/codex:status— Shows running and recent jobs/codex:result— Displays the final output of a completed job/codex:cancel— Stops a background running task
You can have Codex review uncommitted changes or diffs between branches, hand off bug investigation and fixes, or continue a previous Codex task — all without leaving Claude Code. The result is a dual-wielding workflow where Claude leads and Codex provides a second opinion at key moments.
② Running Claude Code on OpenAI Models (claude-code-proxy)
For developers who like Claude Code's interface but want to use GPT or o1 as the underlying model, the proxy approach delivers exactly that. The most prominent solution is 1rgs/claude-code-proxy, which translates Anthropic-format API requests from Claude Code into OpenAI format using LiteLLM, then converts the responses back into Anthropic format.
The key configuration is through environment variables:
ANTHROPIC_BASE_URL— Set tohttp://localhost:8082when using the proxyOPENAI_API_KEY— Required to access the OpenAI backendPREFERRED_PROVIDER— Choose fromopenai(default),google, oranthropicBIG_MODEL— Where to route Claude Sonnet-equivalent requests (default:gpt-4o)SMALL_MODEL— Where to route Claude Haiku-equivalent requests (default:gpt-4o-mini)
Start the server using the repository's recommended command: uv run uvicorn server:app --host 0.0.0.0 --port 8082 --reload, or use the Docker image ghcr.io/1rgs/claude-code-proxy:latest. Supported models include o1, o1-mini, o1-pro, gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.5-preview, and others — routed automatically via the openai/ prefix. Note that this is based on models declared by the claude-code-proxy repository and may lag behind the latest OpenAI lineup, so check the repository's README for the most current model support before use.
A similar approach involves routing Claude Code to any OpenAI model through an AI gateway such as Maxim AI's Bifrost, with just a single environment variable (Use Claude Code with OpenAI Models via an AI Gateway). For a related approach — calling GPT from within Claude Code using claude-code-router or LiteLLM directly — see the article How to Use GPT with Claude Code.
③ Calling Claude via the OpenAI SDK Compatibility Layer
The third route is not about Claude Code itself, but about the Claude API — though it often surfaces in "openai claude code" searches. Anthropic provides a compatibility layer that lets you test the Claude API using the OpenAI SDK as-is, requiring only a change to the base URL and model name to call Claude from existing OpenAI SDK code (OpenAI SDK compatibility – Claude API Docs).
However, as the official documentation itself makes clear, this compatibility layer is primarily intended for comparing and evaluating model capabilities — it is not recommended as a long-term approach for production use. If you need full functionality in production, migrating to the Anthropic native SDK is the right path. For pricing, performance comparisons, and migration guidance, see the Claude vs OpenAI API comparison article.
Bonus: For Those Who Want to Compare Codex CLI and Claude Code
Some people searching "openai claude code" are not looking for integration at all — they want to know which CLI to choose: OpenAI's Codex CLI or Claude Code. In 2026, Codex comprises a cloud-based agent accessible via ChatGPT, a locally running Codex CLI, and IDE extensions — all tied together with GPT-5-class models. Claude Code, on the other hand, is an interactive CLI deeply integrated with terminals and IDEs, with particular strengths in complex single-task reasoning and refactoring (Claude Code vs OpenAI Codex – Northflank, same – Composio). A five-axis comparison covering pricing, supported models, CLI experience, IDE integration, and automation features is available in the Claude Code vs Codex CLI article.
Which Route Should You Choose?
Here is a quick guide by use case:
- Claude as your primary tool, with OpenAI reviews at key points → ① Official Codex Plugin. The easiest to set up, and as an official release, future compatibility is a safe bet.
- Claude Code's UI, but with OpenAI models under the hood → ② claude-code-proxy / gateway. Be aware that the translation layer can introduce behavioral differences in tool calls and some features.
- Leverage existing OpenAI SDK code while also trying Claude → ③ Compatibility layer. Treat it as a validation tool, and use each provider's native SDK for production.
- Not sure which CLI to adopt in the first place → Skip integration — check the comparison article for a five-axis evaluation.
Caveats: Unofficial Tools Come With Behavioral Differences and Maintenance Risk
The Codex Plugin (①) is official from OpenAI, but the proxy (②) and compatibility layer (③) involve a "translation" step, which means behavior may not be identical to native usage. Model-swapping solutions in particular tend to diverge when it comes to tool use, streaming, and context length handling, and they require updates with every major release. If you are incorporating any of these into a production workflow, prioritize official routes, and pair unofficial tools with version pinning and thorough testing.
Summary
"openai claude code" can be an entry point for the misconception that Claude Code is an OpenAI product — but what it actually points to are three routes for bridging Anthropic's Claude Code with OpenAI. ① Delegate Codex reviews via OpenAI's official Codex Plugin. ② Swap the underlying model to OpenAI using claude-code-proxy. ③ Call Claude via the OpenAI SDK compatibility layer. If you want ease of setup and long-term peace of mind, the official Codex Plugin is the best place to start.