Open Source · Zero Dependencies · 200+ Models

Any Tool.
Any Model.

Universal proxy that routes your AI coding tools through GPT-4o, Gemini, Llama, DeepSeek, Mistral, and hundreds more. One command. No lock-in.

Terminal
200+Models
0Dependencies
2Providers
MITLicense

Three steps. Zero config.

No configuration files. No complex setup. Just install and point your tools.

1

Install

npx anymodel

Runs instantly. No global install needed.

2

Proxy Starts

Auto-detects your provider. Starts a local proxy on port 9090.

3

Use Any Model

Point your AI tool at the proxy. Full compatibility, any model you want.

Your AI Tool
anymodel :9090
OpenRouter / Ollama

Access the best open and commercial models.

From frontier models to local inference. Switch between them with a single flag.

G

Google Gemini

Cloud

Gemini 2.5 Pro & Flash. Best price-to-performance for coding tasks. Multimodal with massive context window.

google/gemini-2.5-flash
O

OpenAI GPT

Cloud

GPT-4o, o1, o3. Industry-leading reasoning models with broad tool support and reliable output.

openai/gpt-4o
L

Meta Llama

Open Weight

Llama 4 Maverick, Llama 3.3, CodeLlama. Run via OpenRouter or locally with Ollama. Fully open weights.

meta-llama/llama-4-maverick
D

DeepSeek

Open Weight

DeepSeek R1. Reasoning-first architecture rivaling frontier models. Exceptional at code generation and analysis.

deepseek/deepseek-r1
M

Mistral

Cloud

Mixtral, Codestral. European AI models with strong multilingual support and efficient inference.

mistralai/codestral-latest

Local Models

Ollama

Run any GGUF model locally. Zero cloud dependency. Fully private. No API key required.

ollama --model llama3

Production-grade proxy.

Built for reliability. Handles the translation so your tools just work.

Zero Dependencies

Pure Node.js built-ins. No bloat, no supply chain risk, no node_modules.

Auto-Detection

Detects OPENROUTER_API_KEY or running Ollama automatically. No config needed.

Request Translation

Translates API-specific fields, normalizes tool_choice, strips incompatible params.

Smart Retries

3 retry attempts with exponential backoff. Handles 429 and 5xx errors gracefully.

Streaming

Full streaming support. Responses pipe through in real-time with zero buffering.

Health Check

Built-in /health endpoint returns status, version, provider, and uptime as JSON.

Everything you need to know.

Complete reference for installation, providers, configuration, and API.

CLI Reference

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

Environment Variables

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.

Health Endpoint

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"
}

Request Routing

/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.

Real-world usage patterns.

Copy-paste examples for common scenarios.

OpenRouter

Use Gemini Flash for coding

# 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
OpenRouter

Use DeepSeek R1 for reasoning

# 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
Ollama

Run locally with Ollama

# 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.
Config

.env file setup

# 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

One command. Ready in seconds.

Install globally or run with npx. Works on macOS, Linux, and Windows.

$ npx anymodel
or install globally:
$ npm i -g anymodel

Quickstart

1

Get an API key from openrouter.ai/keys (free tier available)

2
export OPENROUTER_API_KEY=sk-or-v1-...
3
npx anymodel --model google/gemini-2.5-flash
4
ANTHROPIC_BASE_URL=http://localhost:9090 your-ai-tool