Claude Code model router

Claude Code Proxy

API proxy for Claude CLI — exposes Anthropic Messages API and OpenAI Chat Completions endpoints, powered by your Claude Max subscription

Install

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

From the README

Claude Code Proxy

Use your Claude Max subscription as an API. This proxy wraps the Claude CLI as a subprocess and exposes standard API endpoints that any SDK or tool can talk to.

Two APIs, one proxy:
- Anthropic Messages API — POST /v1/messages
- OpenAI Chat Completions API — POST /v1/chat/completions

Works with the Anthropic SDK, OpenAI SDK, Python clients, Cursor, Continue, aider, LiteLLM, OpenClaw, and anything else that accepts a custom base URL.

Why?

Claude Max gives you generous usage through the CLI, but no API access. This proxy bridges that gap — run it locally and point any SDK at it.

Prerequisites

- Node.js 20+
- Claude CLI installed and authenticated (claude --version should work)
- Claude Max subscription (the CLI must be logged in)

Install

Usage

The proxy starts on http://127.0.0.1:4523 by default.

Connect Your SDK

TypeScript / JavaScript

Python

Other Tools

Any tool with a "custom base URL" or "OpenAI-compatible" setting works:

Use any sonnet, opus, or haiku family name as the model, including versioned variants like claude-sonnet-4-6, claude-opus-4-7, sonnet-4-7, or haiku-5. Model names with a claude-code-cli/ or openai/ prefix are also accepted (the prefix is stripped automatically). Unknown model families return HTTP 400 instead of falling back to the DEFAULT_MODEL.

Streaming

Both APIs support streaming out of the box:

Available Models

Features

- Streaming & non-streaming for both Anthropic and OpenAI formats
- System prompts
- Multi-turn conversations
- Tool use / function calling via MCP bridge
- Structured output (JSON schema)
- Extended thinking (set ENABLE_THINKING=true)
- Effort levels — low, medium, high, max (model-dependent)
- Rate limit propagation from CLI quota
- Auto-cleanup — subprocess killed on client disconnect or…
Read the full README on GitHub

Details

Language
TypeScript
License
MIT
Last updated
3 May 2026

FAQ

What is Claude Code Proxy?

API proxy for Claude CLI — exposes Anthropic Messages API and OpenAI Chat Completions endpoints, powered by your Claude Max subscription It is a model router for Claude Code, from AntonioAEMartins/claude-code-proxy on GitHub.

How do I install Claude Code Proxy?

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

Is Claude Code Proxy popular?

AntonioAEMartins/claude-code-proxy has 29 GitHub stars and 6 forks. It was last updated on 3 May 2026.

More model routers & proxies

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