RouterLens
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@RouterLenswhat's my OpenRouter balance and how much did I spend today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenRouter ChatGPT Plugin
Analytics, Cost Optimization & MCP Tools for ChatGPT and Codex.
An open-source OpenRouter plugin that combines OpenRouter's official MCP server with a private analytics bridge for account spend, usage analysis, model comparison, cost anomaly detection, and cost optimization.
Current version: 0.3.0 Alpha
What it does
Account
Remaining OpenRouter credit
Today / yesterday / 7-day / 30-day spend
Usage trends
Models
Live model search through OpenRouter's official MCP
Latest models
Pricing and context windows
Provider endpoints
Side-by-side model comparison
Benchmark/ranking evidence through OpenRouter's official MCP
Analytics
Spend by model
Requests by model
Spend by provider
Spend by API key
Token/cache/reasoning-token analysis
Cost anomaly detection
Cost optimization evidence
Developer
Generation inspection through OpenRouter's official MCP
OpenRouter docs search
API-key metadata and limits
Live Analytics schema discovery
Related MCP server: Langfuse MCP Server
Architecture
ChatGPT / Codex
|
+----------------------+
| |
OpenRouter official MCP RouterLens MCP
| |
Models / Providers Credits / Analytics
Benchmarks / Docs Cost Doctor / Key metadata
Generations / Tests Model comparison
| |
+---------- OpenRouter-+The official MCP handles capabilities OpenRouter already exposes well. RouterLens adds the private account-analysis layer.
Why two MCP servers?
Duplicating OpenRouter's official model and generation tools would create unnecessary maintenance. RouterLens focuses on the missing workflow layer:
account analytics
cost attribution
cost anomalies
cost optimization
API-key usage visibility
normalized model/provider comparisons
RouterLens tools
Tool | Purpose |
| Balance and today/yesterday/7D/30D spend |
| Live Analytics API schema |
| Generic spend/request/token breakdowns |
| Rolling-baseline spend spike detection |
| Evidence-backed optimization opportunities |
| Read-only key metadata, limits, usage |
| Live price/context/provider comparison |
| Configuration diagnostics |
Self-hosting
Requirements:
Node.js 20+
Vercel or another Next.js-compatible host
OpenRouter Management API Key
Environment variables:
OPENROUTER_MANAGEMENT_KEY=
MCP_AUTH_TOKEN=Install and build:
npm install
npm run checkRun locally:
npm run devEndpoints:
MCP:
/api/mcpHealth:
/api/health
Security
Management Keys are read from server environment variables.
Secrets are never returned by MCP tools.
API-key listing only exposes metadata and hashes returned by OpenRouter.
V0.3 contains no key create/update/delete tools.
The self-hosted MCP endpoint is protected by
MCP_AUTH_TOKEN.Account data is queried from OpenRouter on demand and is not persisted by RouterLens.
See SECURITY.md and docs/security.md.
Plugin package
The repository contains the portable ChatGPT/Codex plugin files:
plugin.jsonmcp.json.mcp.json.codex-plugin/plugin.jsonskills/openrouter/SKILL.md
The plugin connects to:
OpenRouter official MCP:
https://mcp.openrouter.ai/mcpRouterLens analytics MCP: your self-hosted endpoint
Roadmap
0.3 Alpha
Read-only analytics
Cost Doctor
Cost anomalies
API-key metadata
Model comparison
Next
Hosted multi-user OAuth flow
Encrypted per-user OpenRouter credentials
Secure key write actions
Presets and routing builder
Guardrails and workspace governance
Optional dashboard and recurring cost reports
License
Apache-2.0.
This is an independent open-source project and is not affiliated with or endorsed by OpenRouter.
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenAI organization usage and cost reporting through an admin API key connected by the user.
Anthropic organization usage and cost reporting through an admin API key connected by the user.
Read-only analytics for Convex apps, queryable via MCP from Claude, Cursor, and other clients.
Analytics for MCP servers. Query your tool calls, first-call success, retries and schema cost.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides tools to manage OpenAI API keys and spending through the OpenAI API. Requires an OpenAI admin API key for secure access to account management features.2MIT
- AlicenseBqualityDmaintenanceEnables querying Langfuse analytics, cost metrics, and usage data across multiple projects. Provides tools for trace analysis, model/service cost breakdowns, and daily usage trends through natural language queries.2465 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered analytics from Stripe, PayPal, and Google Analytics 4 (BigQuery) data sources with built-in guardrails and automated workflows for financial and web performance insights.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude or ChatGPT to query OpenRouter's 300+ models for pricing, context length, capabilities, and rankings through tools such as model-card, compare-models, cheapest-for, cost-estimator, and usage-rankings, using a public, key-less API with 6-hour caching.172 npm1MIT