
Openrouter Admin
io.github.oviron由 GitHub 帳號 oviron 發布v0.7.3更新於 Oct 24, 2026
MCP server for OpenRouter management API: credits, key CRUD, activity drill-down, dashboard.
概覽
一個 MCP 伺服器,讓助理檢視並在啟用後管理 OpenRouter 帳戶:額度、推論金鑰、護欄、用量與模型價格。
- 可以做什麼
- 讀取帳戶額度、目前的 Provisioning 金鑰,以及所有推論金鑰的限額與到期時間,並提供額度、作用中金鑰與當日依模型消耗的一次性總覽。依日期、金鑰或使用者篩選最近 30 天用量,並依模型、日期、供應商或金鑰彙總,還可依生成 id 查詢單次呼叫。瀏覽模型目錄、單一模型詳情、各供應商端點及其價格與可用率,以及符合 ZDR 的端點。列出護欄及其詳情、金鑰與成員綁定關係,並列出組織成員。啟用寫入工具後,可建立、更新和刪除推論金鑰與護欄,並批次綁定或解除綁定護欄到金鑰和成員。
- 適用情境
- 適合在聊天用戶端中查看 OpenRouter 花費、找出哪些金鑰或模型消耗了額度、比較模型價格與端點,或管理金鑰和消費護欄,而不必開啟網頁主控台。
- 執行需求
- 透過 npx 或全域 npm 安裝以 stdio 在本機執行,需要 Node.js。需要 OpenRouter Provisioning API 金鑰,放在環境變數 OPENROUTER_PROVISIONING_KEY 中;此金鑰不同於推論金鑰。寫入工具還需將 OPENROUTER_ADMIN_ALLOW_WRITE 設為 1。需要透過網路以 HTTPS 存取 OpenRouter API。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Openrouter Admin,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
openrouter-admin-mcp
[npm version] [npm downloads] [CI] [MCP Registry] [Node] [License: MIT]
MCP server for the OpenRouter management API — programmatic control of credits, inference keys, guardrails, organization members, and usage analytics from inside Claude Code, Claude Desktop, Cursor, or any MCP-compatible client.
Read-only by default. Destructive write operations are gated behind an opt-in env flag.
This is not an inference proxy. It uses an OpenRouter Provisioning API key, which can manage your account but cannot make completion calls.
Why
OpenRouter's UI is solid for one-off tweaks, but checking spend across keys, drilling into per-model/per-day usage, configuring account-wide guardrails, or rotating limits requires a lot of clicking. This server exposes those operations as MCP tools — Claude can answer "what burned my credits this week?", "create a temporary key with a $0.30 daily cap", or "bind the new prod key to our daily-$50 guardrail" in a single turn.
Features
26 tools wrapping the OpenRouter management API:
or_overview— one-shot dashboard: credits + active keys (with reset/expiration) + today's UTC burn by model.- Inference key CRUD including
limit_reset(daily/weekly/monthly) andexpires_at. - Guardrails CRUD — account-wide spending limits with provider/model allowlists, ZDR enforcement. Bulk-assign to keys or org members.
- Activity drill-down — aggregate
by_model,by_day,by_provider, orby_key. Token-level breakdown (prompt / completion / reasoning) per row. - Generation lookup — fetch any single inference call by
gen-…id (cost, tokens, latency, finish reason). - Model & endpoint discovery — current pricing per 1M tokens, per-provider uptime, ZDR-compliant endpoints.
Plumbing: HTTP retry on 429/5xx with Retry-After support, in-session GET cache, write invalidation. Returns raw fields — interpretation is left to the agent.
Install
One-click
[Install in VS Code] [Install in Cursor]
Replace the placeholder
sk-or-v1-...with your real key after install.
Manual
Run via npx (no install needed) or install globally:
Configuration
Create a Provisioning key at https://openrouter.ai/settings/provisioning, then add the server to your MCP client config.
Claude Code (~/.claude.json) or Claude Desktop (claude_desktop_config.json):
Restart your client to load the server. By default this gives read-only access — to enable key creation, mutation, and deletion, see Enabling write tools below.
Enabling write tools
Destructive operations (or_key_create, or_key_update, or_key_delete) are disabled by default to prevent accidental key mutation through prompt-injected tool calls. Add OPENROUTER_ADMIN_ALLOW_WRITE to your env block to enable them:
The server logs which mode it started in:
Read tools (or_overview, or_credits, or_current_key, or_keys_list, or_key_get, or_activity) are always available regardless of this flag.
Tools
Read (always available)
Write (opt-in via OPENROUTER_ADMIN_ALLOW_WRITE=1)
Example — create a daily-capped temporary key
Example — diagnose a cost spike
Example — bind a key to an account-wide guardrail
Design
The server returns raw API fields. It does not flag what's "near limit", what's an "anomaly", or what the agent should do — that's the agent's job. Composite tools (or_overview, or_guardrails_assignments) merge multiple endpoints into one workflow response, but they don't interpret. Rationale: production MCP servers (Stripe, GitHub, Linear) follow the same pattern.
Data handling
- The Provisioning key is read from the
OPENROUTER_PROVISIONING_KEYenvironment variable and forwarded only tohttps://openrouter.ai/api/v1/*over HTTPS. - The server is stateless across restarts. An in-session GET cache (60s TTL on
/credits,/key,/keys,/keys/{hash}) is held in memory only and dropped on shutdown. - The key never appears in error messages or tool output (verified by tests).
Development
Project layout:
License
MIT — see LICENSE.
來源:README.md,提交 66e660a
工具
0版本歷史
1- v0.7.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分