DEV Community

Hanjun Lin
Hanjun Lin

Posted on

Never Get Blocked by Claude Code Rate Limits Again: Seamlessly Route It to ChatGPT

Ever had your coding momentum ruined by Claude Code’s usage limits? I built an open-source solution: claude-gpt [1.1].

This lightweight local proxy enables you to keep working in Claude Code after hitting limits by routing requests to GPT models via your existing ChatGPT subscription [1.1].


How It Works 🛠️

By leveraging ANTHROPIC_BASE_URL, claude-gpt acts as an intermediary, translating complex Anthropic API calls into OpenAI formats [1.1].

  • Model Switching: Use the /model command (e.g., /model gpt or /model opus) to switch seamlessly without restarting your workspace [1.1].
  • Live Translation: Handles tools, system prompts, and streaming [1.1].
[Claude Code] --► [claude-gpt proxy] --► [GPT / Claude]
Enter fullscreen mode Exit fullscreen mode

⚡ Quick Setup (Windows)

With Node.js (v18+) installed, run the following in PowerShell:

git clone https://github.com/hanjun-lin/claude-gpt.git
cd claude-gpt
.\install.ps1
Enter fullscreen mode Exit fullscreen mode

⚠ Terms of Service & Safe Mode 🛡️

  • ToS Alert: Default usage involves accessing OpenAI’s internal Codex backend, which carries potential account risk [1.1].
  • Official API Option: Set GPT_PROXY_BACKEND=openai and provide your OPENAI_API_KEY to use the official, compliant API [1.1].

Feedback & Contributions 💬

Check out the code, contribute, or open an issue on GitHub.

👉 Check out the GitHub Repo here [1.1]

Top comments (0)