Claude Code model router

claude-code-proxy

Proxy translating Claude Code requests to any OpenAI-compatible API.

2,803 stars 415 forksModel routers & proxies Source

Install

From source
git clone https://github.com/fuergaosi233/claude-code-proxy.git

From the README

Claude Code Proxy

A proxy server that enables Claude Code to work with OpenAI-compatible API providers. Convert Claude API requests to OpenAI API calls, allowing you to use various LLM providers through the Claude Code CLI.

Features

- Full Claude API Compatibility: Complete /v1/messages endpoint support
- Multiple Provider Support: OpenAI, Azure OpenAI, local models (Ollama), and any OpenAI-compatible API
- Smart Model Mapping: Configure BIG and SMALL models via environment variables
- Function Calling: Complete tool use support with proper conversion
- Streaming Responses: Real-time SSE streaming support
- Image Support: Base64 encoded image input
- Custom Headers: Automatic injection of custom HTTP headers for API requests
- Error Handling: Comprehensive error handling and logging

Quick Start

1. Install Dependencies

2. Configure

3. Start Server

4. Use with Claude Code

Configuration

The application automatically loads environment variables from a .env file in the project root using python-dotenv. You can also set environment variables directly in your shell.

Environment Variables

Required:

- OPENAI_API_KEY - Your API key for the target provider

Security:

- ANTHROPIC_API_KEY - Expected Anthropic API key for client validation
  - If set, clients must provide this exact API key to access the proxy
  - If not set, any API key will be accepted

Model Configuration:

- BIG_MODEL - Model for Claude opus requests (default: gpt-4o)
- MIDDLE_MODEL - Model for Claude opus requests (default: gpt-4o)
- SMALL_MODEL - Model for Claude haiku requests (default: gpt-4o-mini)

API Configuration:

- OPENAI_BASE_URL - API base URL (default: https://api.openai.com/v1)

Server Settings:

- HOST - Server host (default: 0.0.0.0)
- PORT - Server port (default: 8082)
- LOG_LEVEL…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
12 March 2026

FAQ

What is claude-code-proxy?

Proxy translating Claude Code requests to any OpenAI-compatible API. It is a model router for Claude Code, from fuergaosi233/claude-code-proxy on GitHub.

How do I install claude-code-proxy?

Clone fuergaosi233/claude-code-proxy from GitHub and follow the setup steps in its README.

Is claude-code-proxy popular?

fuergaosi233/claude-code-proxy has 2,803 GitHub stars and 415 forks, and is included in 2 curated Claude Code lists. It was last updated on 12 March 2026.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.