
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@openrouter/cli
Advanced tools
A powerful command-line interface for OpenRouter, enabling seamless integration with multiple language models and AI services. Currently featuring Claude Code integration with more capabilities coming soon.
Install the OpenRouter CLI:
npm install -g @openrouter/cli
For Claude Code integration, ensure you have Claude Code installed:
npm install -g @anthropic-ai/claude-code
Create and configure your ~/.openrouter/config.json file. For more details, see the included config.example.json.
The configuration file supports several key sections:
OPENROUTER_API_KEY: Your OpenRouter API key for accessing modelsLOG (optional): Enable/disable logging. Default is trueLOG_LEVEL (optional): Set logging verbosity: "fatal", "error", "warn", "info", "debug", "trace". Default is "debug"~/.openrouter/logs/~/.openrouter/router.logmodels: Configure model routing for different task typesAPI_TIMEOUT_MS: API call timeout in millisecondsThe OpenRouter CLI supports environment variable interpolation for secure credential management. Reference environment variables in your config using $VAR_NAME or ${VAR_NAME} syntax:
{
"OPENROUTER_API_KEY": "$OPENROUTER_API_KEY"
}
Keep sensitive credentials secure by storing them as environment variables rather than in configuration files.
{
"OPENROUTER_API_KEY": "$OPENROUTER_API_KEY",
"LOG": true,
"models": {
"default": "deepseek/deepseek-chat",
"background": "qwen/qwen3-30b-a3b",
"think": "deepseek/deepseek-reasoner",
"longContext": "google/gemini-2.5-pro-preview",
"longContextThreshold": 60000,
"webSearch": "google/gemini-2.5-flash:online"
}
}
Use any OpenRouter model with Claude Code:
openrouter code "your prompt here"
openrouter start # Start the proxy service
openrouter stop # Stop the proxy service
openrouter restart # Restart the service (required after config changes)
openrouter status # Check service status
Configure intelligent model routing based on task requirements:
default: Primary model for general tasksbackground: Cost-efficient model for background operationsthink: Advanced reasoning model for complex problem-solvinglongContext: Model optimized for large context windows (>60K tokens)longContextThreshold: Token threshold for automatic long-context routing (default: 60000)webSearch: Model with web search capabilities (append :online to model name)Switch models on-the-fly within Claude Code:
/model anthropic/claude-sonnet-4
The OpenRouter CLI is actively expanding to support:
Stay tuned for updates as we build out the complete OpenRouter experience.
FAQs
SDK DevTools and utilities for OpenRouter development
The npm package @openrouter/cli receives a total of 180 weekly downloads. As such, @openrouter/cli popularity was classified as not popular.
We found that @openrouter/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.