Claude Code model router

Claude Code Openrouter

Claude Code agent that routes to external LLMs (Grok, Gemini, GPT-5, etc.) via OpenRouter - just mention the model name

Install

From source
git clone https://github.com/derek-larson14/claude-code-openrouter.git

From the README

OpenRouter Claude Code Agent

Use external LLMs (Kimi, Grok, Gemini, GLM, GPT-5) directly from Claude Code by mentioning them in your prompts.

Setup

New Project

Clone this repo and add your API key:

Get your API key from OpenRouter.ai

Existing Project

Run this from your project directory:

Then add your API key:

Usage

In Claude Code, just mention the model name:

- "Use kimi to write a blog post about AI"
- "Ask grok to explain quantum computing"
- "Have gemini create a marketing presentation and use @marketing/project-plan.md as context"

Add "external-llm" to your prompt if it doesn't trigger automatically.
First Run: Claude Code will ask for approval the first time. Select "Yes, and don't ask again..." to auto-approve future calls.

Available Models

Default models configured in models.conf:
- kimi - Moonshot AI's K2 model (great for creative writing)
- grok - Grok 4 from X.AI
- grok-fast - Grok 4 Fast from X.AI
- glm - GLM-4.6 from Zhipu AI
- gemini - Gemini 2.5 Pro from Google
- gpt-5 - GPT-5 from OpenAI

Adding Your Own Models

Edit models.conf to add any OpenRouter model:

Find model IDs at OpenRouter.ai/models

Output Locations

Default behavior - saves to llm-outputs/:

Custom paths - specify where to save:

Direct CLI Usage

You can also use the script directly from the command line:

CLI Options

- --model - Which model to use (from models.conf)
- --query - Your prompt
- --output - Where to save the response
- --system-prompt - Add instructions
- --context-file - Include file content
- --temperature - Creativity (0-2, default 0.7)
- --max-tokens - Max length (default 4000)

File Locations

- API key: .env or ~/.openrouter.env
- Model config: models.conf
- Generated files: llm-outputs/
- Agent config:…
Read the full README on GitHub

Details

Language
Shell
License
MIT
Last updated
30 November 2025

FAQ

What is Claude Code Openrouter?

Claude Code agent that routes to external LLMs (Grok, Gemini, GPT-5, etc.) via OpenRouter - just mention the model name It is a model router for Claude Code, from derek-larson14/claude-code-openrouter on GitHub.

How do I install Claude Code Openrouter?

Clone derek-larson14/claude-code-openrouter from GitHub and follow the setup steps in its README.

Is Claude Code Openrouter popular?

derek-larson14/claude-code-openrouter has 28 GitHub stars and 3 forks. It was last updated on 30 November 2025.

More model routers & proxies

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