
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@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/claude-code-proxy.json file. For more details, see "Example Configuration" below.
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 proxy start # Start the proxy service
openrouter proxy stop # Stop the proxy service
openrouter proxy restart # Restart the service (required after config changes)
openrouter proxy 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
Make sure you have bun.
bun install
All openrouter commands above via npm dev:
bun run dev proxy start
bun run dev proxy status
bun run dev code
bun run dev proxy stop
bun run build
bun pm pack
# local npm install
cd /path/to/somewhere
npm uninstall @openrouter/cli
npm install /path/to/cli/openrouter-cli-version-number.tgz
node_modules/.bin/openrouter proxy start
node_modules/.bin/openrouter code
# global npm install
npm uninstall -g @openrouter/cli
npm install -g /path/to/cli/openrouter-cli-version-number.tgz
openrouter proxy start
openrouter code
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 78 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.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.