Universal proxy that routes your AI coding tools through GPT-4o, Gemini, Llama, DeepSeek, Mistral, and hundreds more. One command. No lock-in.
No configuration files. No complex setup. Just install and point your tools.
npx anymodel
Runs instantly. No global install needed.
Auto-detects your provider. Starts a local proxy on port 9090.
Point your AI tool at the proxy. Full compatibility, any model you want.
From frontier models to local inference. Switch between them with a single flag.
Gemini 2.5 Pro & Flash. Best price-to-performance for coding tasks. Multimodal with massive context window.
google/gemini-2.5-flash
GPT-4o, o1, o3. Industry-leading reasoning models with broad tool support and reliable output.
openai/gpt-4o
Llama 4 Maverick, Llama 3.3, CodeLlama. Run via OpenRouter or locally with Ollama. Fully open weights.
meta-llama/llama-4-maverick
DeepSeek R1. Reasoning-first architecture rivaling frontier models. Exceptional at code generation and analysis.
deepseek/deepseek-r1
Mixtral, Codestral. European AI models with strong multilingual support and efficient inference.
mistralai/codestral-latest
Run any GGUF model locally. Zero cloud dependency. Fully private. No API key required.
ollama --model llama3
Built for reliability. Handles the translation so your tools just work.
Pure Node.js built-ins. No bloat, no supply chain risk, no node_modules.
Detects OPENROUTER_API_KEY or running Ollama automatically. No config needed.
Translates API-specific fields, normalizes tool_choice, strips incompatible params.
3 retry attempts with exponential backoff. Handles 429 and 5xx errors gracefully.
Full streaming support. Responses pipe through in real-time with zero buffering.
Built-in /health endpoint returns status, version, provider, and uptime as JSON.
Complete reference for installation, providers, configuration, and API.
anymodel [provider] [options]
Providers:
openrouter Route through OpenRouter
ollama Route through local Ollama
Options:
--model, -m Model ID (e.g., google/gemini-2.5-flash)
--port, -p Proxy port (default: 9090)
--help, -h Show help
OPENROUTER_API_KEY
Your OpenRouter API key
OPENROUTER_MODEL
Default model override
PROXY_PORT
Proxy listen port (default: 9090)
anymodel auto-loads .env from the current directory.
GET /health
Response:
{
"status": "ok",
"version": "1.0.0",
"provider": "openrouter",
"model": "google/gemini-2.5-flash",
"uptime": 3600.5,
"timestamp": "2025-01-15T10:30:00Z"
}
/v1/messages
→ Routed to your chosen provider
/v1/*
→ Passed through to api.anthropic.com
/health
→ Returns proxy status JSON
The proxy sanitizes request bodies: strips betas, metadata, thinking, cache_control, and normalizes tool_choice for cross-provider compatibility.
Copy-paste examples for common scenarios.
# Set your API key
export OPENROUTER_API_KEY=sk-or-v1-...
# Start proxy with Gemini Flash
npx anymodel openrouter --model google/gemini-2.5-flash
# In another terminal, use your AI tool
ANTHROPIC_BASE_URL=http://localhost:9090 your-tool
# DeepSeek R1 — great for complex problems
npx anymodel --model deepseek/deepseek-r1
# Or GPT-4o for general tasks
npx anymodel --model openai/gpt-4o
# Or Llama 4 Maverick for open-weight
npx anymodel --model meta-llama/llama-4-maverick
# Start Ollama
ollama serve
# Pull a model
ollama pull llama3
# Start anymodel with Ollama
npx anymodel ollama --model llama3
# Fully offline. Nothing leaves your machine.
# Create a .env in your project root
cat > .env << 'EOF'
OPENROUTER_API_KEY=sk-or-v1-your-key
OPENROUTER_MODEL=google/gemini-2.5-flash
PROXY_PORT=9090
EOF
# anymodel auto-loads .env
npx anymodel
Install globally or run with npx. Works on macOS, Linux, and Windows.
Get an API key from openrouter.ai/keys (free tier available)
export OPENROUTER_API_KEY=sk-or-v1-...
npx anymodel --model google/gemini-2.5-flash
ANTHROPIC_BASE_URL=http://localhost:9090 your-ai-tool