claude-code-proxy  by raine

Local proxy routes Claude Code to multiple LLM providers

Created 3 months ago
392 stars

Top 73.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a local proxy server enabling Claude Code users to leverage existing subscriptions for OpenAI (Codex/ChatGPT Plus), Kimi, Grok, or Cursor. It translates Claude Code's Anthropic-compatible requests into formats for these alternative LLM providers, offering flexibility in model choice and potential cost savings. The target audience is Claude Code users seeking to utilize preferred LLM backends through a familiar interface.

How It Works

The proxy intercepts Claude Code requests and translates them into specific API calls for supported providers (OpenAI, Kimi, Grok, Cursor), managing authentication, token refresh, and response translation back to Anthropic's SSE format. It handles system prompts, tool usage, and reasoning translation, allowing seamless switching of LLM backends without altering the primary coding assistant setup.

Quick Start & Requirements

Installation is via Homebrew, an install script, or prebuilt binaries. Users authenticate each provider (e.g., claude-code-proxy codex auth login) to store credentials. The proxy starts with claude-code-proxy serve (defaulting to 127.0.0.1:18765) and can be configured via environment variables or config.json. Prerequisites include Claude Code and an active LLM service subscription.

Highlighted Details

  • Integrates with OpenAI (Codex/ChatGPT Plus), Kimi, Grok, and Cursor.
  • Features a terminal UI (serve --monitor) for session and request monitoring.
  • Supports headless authentication via device-code OAuth.
  • Translates reasoning effort and tool usage across provider APIs.
  • Manages context window sizes and provides hints for larger windows.

Maintenance & Community

Maintained by raine. No community channels, roadmap links, or additional contributor information are detailed in the provided README.

Licensing & Compatibility

The license type is not specified. Compatibility with commercial use is not explicitly detailed, though the README notes potential account risks with Kimi/Cursor unofficial clients.

Limitations & Caveats

Using Kimi/Cursor via this unofficial client may carry account risks; OpenAI's policy is welcoming but not guaranteed long-term. Rate limits are shared across upstream accounts. Image inputs in tool results may be limited or omitted by Codex/Kimi. Codex reasoning blocks are not forwarded. Session title generation incurs token costs. Cursor requires specific agent bundles and lacks full workspace/tool callback implementation. The project does not offer integrated profile management for mid-session backend switching. The absence of a stated license is a significant adoption blocker.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
43
Issues (30d)
14
Star History
232 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.