# Claudex: Claude-ChatGPT code bridge

> Run Claude Code using your ChatGPT subscription instead of Anthropic billing.

- **What it does:** Lets you use Claude Code while paying through your ChatGPT subscription instead of a separate Anthropic account. It runs a small program on your computer that translates between the two.
- **Agents:** Claude Code and Codex (through orbit-connect), Claude and ChatGPT (through the Orbit connector)
- **Install:** `npx -y --loglevel=error orbit-connect@0.3.33 install skl_a7d646d8a0aefdfe4ebefc74`
- **Creator:** @dainikautomates on Instagram
- **Reach:** Creators' posts about it have 2,466 views
- **Safety:** Checked by Orbit: use with care. Unofficial proxy reroutes traffic to unofficial ChatGPT endpoint
- **Last updated:** 2026-11-14
- **Page:** https://orbitinbox.app/s/claudex-claude-chatgpt-code-bridge

## Skill

---
name: claudex-claude-codex-bridge
description: Use when pointing Claude Code at a ChatGPT Plus/Pro Codex backend: install and run the Claudex local translation proxy.
---

# Claudex: Claude Code → ChatGPT Codex bridge

## What this does
Claudex is a local proxy that accepts Claude Code's Anthropic-style requests, converts them into the Codex Responses API format, forwards them to `chatgpt.com/backend-api/codex/responses`, and converts the responses back into Anthropic-compatible output.

## When to use
- You already have ChatGPT Plus/Pro with Codex access and want Claude Code's CLI / IDE workflow.
- You do not want to pay separately for Anthropic API usage just to use Claude Code.

## How to run it
1. Install: `npm install -g @caixiaoshun/claudex`
   From source: `git clone https://github.com/caixiaoshun/claudex.git && cd claudex && npm install && npm run build`
2. Bypass Claude Code onboarding once (Claude Code requires onboarding to be marked complete):
   ```bash
   node --eval "
   const fs = require('fs');
   const path = require('path');
   const file = path.join(require('os').homedir(), '.claude.json');
   let config = {};
   try { config = JSON.parse(fs.readFileSync(file, 'utf-8')); } catch {}
   config.hasCompletedOnboarding = true;
   fs.writeFileSync(file, JSON.stringify(config, null, 2));
   console.log('Onboarding bypassed');
   "
   ```
3. Start it: `claudex`. On first run it opens the browser for ChatGPT OAuth login, then starts the proxy on port 4000 by default.
4. Point Claude Code at the local proxy.
   macOS / Linux: `export ANTHROPIC_BASE_URL=http://localhost:4000` and `export ANTHROPIC_API_KEY={any-non-empty-dummy-value}`
   Windows PowerShell: `$env:ANTHROPIC_BASE_URL = "http://localhost:4000"`
   Windows CMD: `set ANTHROPIC_BASE_URL=http://localhost:4000`
5. Use Claude Code normally: `claude "Help me refactor this function"` — all traffic now flows through Claudex.
6. Reuse credentials instead of the OAuth flow: `claudex --reuse-codex` (reads `~/.codex/auth.json`, `~/.opencode/session.json`, `~/.opencode/auth/codex.json`); list them with `claudex --list-sources`.
7. Choose model and reasoning:
   - Startup: `claudex --model gpt-5.4-mini --reasoning high`
   - Env: `CODEX_MODEL=gpt-5.4-mini CODEX_REASONING=high claudex`
   - Runtime: `curl -X POST http://localhost:4000/claudex/config -H "Content-Type: application/json" -d '{"model": "gpt-5.4-mini", "reasoning": "high"}'`
   - From Claude Code: `/model claudex:gpt-5.4-mini:high` (reasoning suffix optional)
   - Levels: `low` (fastest) · `medium` (balanced) · `high` (maximum depth); default `medium`.
8. Verify: `claudex --reuse-codex --debug`, then `curl http://localhost:4000/health`, and exercise a real flow such as `Run "pwd" and tell me the result.`

## Endpoints
`POST /v1/messages` · `POST /v1/messages/count_tokens` · `GET /claudex/models` · `POST /claudex/models/refresh` · `POST /claudex/config` · `GET /health`

## Output
Return the exact commands run, the model/reasoning mapping printed at startup, and confirmation that the Claude Code session completed with no upstream `Codex API error: 400`.

Credit: Based on public content by dainikautomates, packaged by Orbit.

Shared by @dainikautomates, credited on Orbit.