icebear0828/codex-proxy

OpenAI-compatible proxy for ChatGPT Codex Responses API

What it solves

Codex Desktop is a powerful coding assistant, but it normally only speaks its own protocol and must be used through its own interface. This project solves that by acting as a local middleman: it translates the standard API formats used by many AI clients (OpenAI, Anthropic, Gemini) into the protocol that Codex Desktop understands. That way you can keep using familiar tools like Cursor, Claude Code, Continue, or Pi while tapping into the Codex models, all with just a ChatGPT account.

How it works

You run a small local server (the proxy) on your machine. When your AI client sends a request using, say, the OpenAI chat format, the proxy receives it, converts the request into the Codex Responses API format, forwards it to Codex Desktop (or a third-party API provider if you configure one), then translates the streaming response back into the format your client expects. It handles authentication by letting you log in with your ChatGPT account (using OAuth), manages multiple accounts with automatic rotation and token refresh, and can even route different account plans to appropriate models. It also makes requests look like they come from a real Codex client by emulating browser headers and using a Rust-based TLS library that matches the official client's fingerprint.

Who it's for

Anyone who already has a ChatGPT account and wants to use Codex models inside their preferred coding assistant without switching tools. It's especially useful for developers who want a local, private gateway that supports OpenAI, Anthropic, or Gemini-style APIs. Installation is offered for desktop apps (Windows, Mac, Linux), a lightweight browser/server version, npm, Docker, or from source.

Highlights

  • Supports OpenAI /v1/chat/completions, Anthropic /v1/messages, Gemini, raw Codex /v1/responses, and an optional Ollama-compatible bridge
  • Two-way protocol translation between all these formats and Codex Responses API
  • Includes structured outputs (JSON mode), function calling, and WebSocket streaming
  • Manages multiple ChatGPT accounts with rotation strategies (least-used, round-robin, sticky) and automatic token renewal
  • Automatically detects banned or expired accounts and switches to a fallback API key
  • Emulates realistic client fingerprints with per-account device IDs and configurable header profiles
  • Provides a web dashboard for managing accounts, keys, and models with bilingual UI (Chinese/English)
  • Ships with Docker images and a pre-built desktop app for easy setup

Related

  • Project
  • Project
  • Project
  • Project
  • Project