Anthropic API Compatible
Drop-in replacement at POST /v1/messages. Zero client changes required.
Run Claude Code CLI for free — route requests through DeepSeek, Kimi, GLM, Groq, or any OpenAI-compatible provider. No Anthropic subscription needed.
┌─────────────────┐ ┌─────────────┐ ┌──────────────┐ │ Claude Code CLI │────▶│ Gateway │────▶│ Provider │ │ (Anthropic API) │◀────│ :8787 │◀────│ (OpenAI API)│ └─────────────────┘ └─────────────┘ └──────────────┘
Drop-in replacement at POST /v1/messages. Zero client changes required.
Native POST /v1/chat/completions support for OpenAI-compatible clients.
Glob pattern family rules map claude-3-* to your chosen provider model.
Real-time token streaming with Server-Sent Events, fully proxied.
Function calling and tool use fully translated between API formats.
Built-in web UI at /admin to monitor requests and configure routing.
Stateless design with flat-file persistence. No setup, no migrations.
Production deployment with Docker Compose or PM2 process manager.
ANTHROPIC_BASE_URL=http://localhost:8787 in your toolhttps://api.moonshot.cn/v1
moonshot-v1-8k, moonshot-v1-32k
https://open.bigmodel.cn/api/paas/v4
glm-4, glm-4-flash (free tier)
https://api.deepseek.com/v1
deepseek-chat, deepseek-coder
https://openrouter.ai/api/v1
100+ models, unified billing
https://api.mistral.ai/v1
mistral-large, codestral
https://api.fireworks.ai/inference/v1
Fast inference, Llama 3
https://api.cerebras.ai/v1
Ultra-fast Llama 3 inference
https://api.groq.com/openai/v1
Fastest free tier available
http://localhost:1234/v1
Local models, privacy-first
http://localhost:11434/v1
Self-hosted, 100% offline
Works with any OpenAI-compatible API endpoint — self-hosted, vLLM, llama.cpp, and more.
git clone https://github.com/rajakumar865465/Free-Claude-Code-Gateway.git
cd Free-Claude-Code-Gateway && npm install
cp .env.example .env
npm run dev
export ANTHROPIC_BASE_URL=http://localhost:8787
export ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
claude
The gateway starts at http://localhost:8787. Point any Claude-compatible tool at it.
http://localhost:8787) instead of Anthropic's servers. The gateway uses your chosen provider's API key, not Anthropic's.This gateway does not bypass, crack, or circumvent Anthropic's systems. It is a standard API format converter — the same thing any OpenAI-compatible client library does.
You are responsible for complying with the terms of service of both Anthropic and your chosen upstream provider.
If this gateway is useful and you can afford it — please support Anthropic and buy Claude Code. It's the right thing to do.
Not affiliated with or endorsed by Anthropic. Claude® is a trademark of Anthropic, PBC.