ZRouter

io.github.nexusrunv1.11.7更新於 Oct 9, 2026

Manage your ZRouter AI gateway account: usage, logs, model routers, API keys, budgets, and limits.

已驗證Streamable HTTP可網頁執行Cloud & InfrastructureAI & MLSecurity & Monitoring

概覽

AI 產生的概覽

讓助理管理 ZRouter AI 閘道帳號:用量與花費、請求日誌、模型路由器、API 金鑰、預算與速率限制。

功能
這是一個託管型遠端 MCP 伺服器,負責 ZRouter 帳號的管理端功能。它提供 24 個工具,涵蓋帳號資訊與額度流水、用量彙總與逐筆請求記錄、日誌搜尋與錯誤率和延遲統計、模型與虛擬路由器列表和編輯、API 金鑰的建立與刪除,以及預算和速率限制管理。唯讀工具有唯讀標註,刪除與重設被標記為破壞性操作,支援確認的用戶端會先詢問。
適用情境
適合用自然語言查看花費、排查失敗或被限流的請求,或調整路由、金鑰、預算與限制,而不必打開儀表板。它只做帳號管理,不會改變助理使用的模型,也不傳送模型請求。
執行需求
無需安裝:遠端 Streamable HTTP 端點。登入方式為帶 PKCE 與動態用戶端註冊的 OAuth 2.1,或在儀表板 CLI and MCP access 中建立的 bearer MCP 權杖。需要 ZRouter 帳號。不支援 MCP 登入的用戶端需在 Authorization 標頭中攜帶 MCP 權杖。
安裝前請注意
工具可以寫入和刪除:路由器、API 金鑰、預算與速率限制,包括破壞性的刪除與重設。新建 API 金鑰的金鑰只回傳一次,並會出現在助理的對話歷史中。請使用 MCP 權杖而非帳號 API 金鑰,不要把權杖放進共享儲存庫設定,並及時撤銷不再使用的權杖。MCP 權杖 30 天後過期。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 ZRouter,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "zrouter": {
      "type": "http",
      "url": "https://zrouter.si/mcp"
    }
  }
}

README

[ZRouter logo]

ZRouter MCP Server

Manage your ZRouter account from any AI assistant. Check spend, search request logs, create virtual model routers, issue API keys, and set budgets and rate limits in plain language.

text
https://zrouter.si/mcp

ZRouter is the Super Intelligence Router: one OpenAI-compatible API key for chat, images, audio, and video, routed to the right model and provider. This MCP server is the management side of your account. It runs as a hosted remote server, so there is nothing to install.

  • Transport: Streamable HTTP
  • Sign-in: OAuth 2.1 with PKCE and dynamic client registration, or a bearer token
  • Scope: your own account only, with the same rules as the dashboard
  • Tools: 24 (14 read-only, 4 write, 6 marked destructive)

Contents

Quick start

  1. Create a free account at zrouter.si.
  2. Add https://zrouter.si/mcp as a remote MCP server in your client.
  3. Approve access on the ZRouter page that opens.
  4. Ask: "How much did I spend this week, by model?"

Clients that support MCP sign-in only need the URL. There is no token to copy or renew.

Connect a client

Claude (claude.ai and Claude Desktop)

Settings → Connectors → Add custom connector. Paste https://zrouter.si/mcp, then select Connect and approve access.

ChatGPT

Settings → Apps & Connectors → create a connector with the URL https://zrouter.si/mcp and OAuth authentication. Custom connectors may require developer mode, depending on your plan.

Claude Code

bash
claude mcp add --transport http zrouter https://zrouter.si/mcp

Then run /mcp inside Claude Code and choose Authenticate.

Cursor

This repository is also a Cursor plugin (.cursor-plugin/plugin.json). Or add the server to ~/.cursor/mcp.json:

json
{  "mcpServers": {    "zrouter": {      "url": "https://zrouter.si/mcp"    }  }}

VS Code

Add the server to .vscode/mcp.json or your user configuration:

json
{  "servers": {    "zrouter": {      "type": "http",      "url": "https://zrouter.si/mcp"    }  }}

Other clients

Add a remote MCP server with the URL https://zrouter.si/mcp and the Streamable HTTP transport. Choose OAuth sign-in when the client asks.

Client configuration formats change between versions. If a snippet above does not match your client, follow its own MCP documentation and use the same URL.

Use a token instead of sign-in

For scripts and clients without MCP sign-in, use an MCP token.

  1. Open CLI and MCP access in your ZRouter dashboard.
  2. Name the token after your client and select Create MCP token.
  3. Copy it right away. It is shown once and expires after 30 days.

Send it as a bearer token:

bash
claude mcp add --transport http zrouter https://zrouter.si/mcp \  --header "Authorization: Bearer YOUR_MCP_TOKEN"
json
{  "mcpServers": {    "zrouter": {      "url": "https://zrouter.si/mcp",      "headers": { "Authorization": "Bearer YOUR_MCP_TOKEN" }    }  }}

Use an MCP token, not an account API key. API keys only send model requests and cannot manage your account, so a leaked API key cannot create keys or change budgets. Keep MCP tokens out of shared repository configuration, and revoke tokens you no longer use from the same dashboard page.

What you can ask

  • "How much did I spend this week, by model?"
  • "Show the requests that failed with 429 today."
  • "Why did my last request to the support bot fail?"
  • "Create a router called support-bot that splits traffic between two models."
  • "Route easy prompts to a cheap model and hard ones to my strongest model."
  • "Create an API key for staging and cap my spend at $10 a day."
  • "Limit the staging user path to 60 requests a minute."

Connecting this server does not change your assistant's own model provider. To send model requests through ZRouter, set up an API key with one of the integration guides.

Tools

Every tool runs inside the authenticated account. Read-only tools are annotated readOnlyHint. Deletes and resets are annotated destructiveHint, so clients that confirm risky actions ask you first.

Account

ToolWhat it doesType
account_infoThe signed-in account and its credit balanceRead-only
credit_ledgerCredit purchases and chargesRead-only

Usage

ToolWhat it doesType
usage_summaryTotal requests, tokens, and cost for a time windowRead-only
usage_dailyUsage and cost over time, by day, week, or monthRead-only
usage_by_modelUsage and cost grouped by modelRead-only
usage_logPer-request entries with tokens and costRead-only

Usage tools accept days (default 30), start_date and end_date (YYYY-MM-DD), user_path, model, and provider.

Logs

ToolWhat it doesType
logs_searchSearch request logs by status code, error type, or textRead-only
logs_getFull detail of one log entry (log_id from logs_search)Read-only
logs_statsRequest counts, error rates, and latencyRead-only

Models and routers

ToolWhat it doesType
models_listModels this account can useRead-only
virtual_models_listYour routers, the routing strategies, and your model name prefixRead-only
virtual_models_upsertCreate or update a router: up to 32 targets, weights, and a strategy such as round_robin or super_intelligenceWrite
virtual_models_deleteDelete a routerDestructive

A router is a stable model name your app calls. The super_intelligence strategy scores each request by difficulty and sends it to simple_targets, standard_targets, or complex_targets.

API keys

ToolWhat it doesType
api_keys_listList keys. Secrets are never returned.Read-only
api_keys_createCreate a key. The secret is returned once.Write
api_keys_deleteDelete a key. Requests using it stop working immediately.Destructive

Budgets

ToolWhat it doesType
budgets_listBudgets with current spendRead-only
budgets_upsertCreate or update a USD spend limit (hourly, daily, weekly, or monthly)Write
budgets_deleteDelete a budgetDestructive
budgets_resetReset one budget's current spend to zeroDestructive

Rate limits

ToolWhat it doesType
rate_limits_listRate limits with current countersRead-only
rate_limits_upsertCreate or update a request or token limit per minute, hour, or dayWrite
rate_limits_deleteDelete a rate limitDestructive
rate_limits_resetReset one rate limit's countersDestructive

Budgets apply to a user_path or label. Rate limits apply to a user_path, provider, or model. Set per_child to apply a rule separately to each child user path.

Security

  • Your account only. Each tool call goes through the same customer API as the dashboard, with your credential, so authentication, account scoping, and validation are identical.
  • Separate credentials. MCP access uses OAuth tokens or MCP tokens. Account API keys cannot manage the account.
  • Revocable. Disconnect apps under CLI and MCP access → Connected apps, and revoke MCP tokens on the same page.
  • Bounded results. A single tool result is capped at 256 KB so a large log page cannot flood your assistant's context.
  • Secrets in history. A new API key's secret appears in the api_keys_create result, and so in your assistant's conversation history. Treat that history accordingly, or create keys in the dashboard.

Authentication details

For client developers. The server follows the MCP authorization specification.

MCP endpointhttps://zrouter.si/mcp (POST, Streamable HTTP, stateless, JSON responses)
Protected resource metadatahttps://zrouter.si/.well-known/oauth-protected-resource/mcp (RFC 9728)
Authorization server metadatahttps://zrouter.si/.well-known/oauth-authorization-server (RFC 8414)
Authorization endpointhttps://zrouter.si/oauth/authorize
Token endpointhttps://zrouter.si/oauth/token
Dynamic client registrationhttps://zrouter.si/oauth/register (RFC 7591)
Grant typesauthorization_code, refresh_token
PKCERequired, S256
Client authenticationnone (public clients)
Scopeaccount

A request without a valid token gets 401 with:

text
WWW-Authenticate: Bearer resource_metadata="https://zrouter.si/.well-known/oauth-protected-resource/mcp", scope="account"

Quick check with an MCP token:

bash
curl -s https://zrouter.si/mcp \  -H "Authorization: Bearer YOUR_MCP_TOKEN" \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Troubleshooting

ProblemFix
401 with invalid_tokenThe token expired (MCP tokens last 30 days) or was revoked, or an account API key was sent instead of an MCP token. Sign in again or create a new MCP token.
The client cannot sign inMake sure it supports remote MCP with OAuth. Otherwise use an MCP token.
A tool reports a validation errorThe tool returns the same message as the dashboard. Fix the argument it names and retry.
The assistant uses the wrong accountDisconnect the app under Connected apps and sign in again with the right account.

FAQ

Is there anything to install or host? No. ZRouter hosts the server at https://zrouter.si/mcp.

Does it cost anything? No. Account management through MCP is free. Model requests you send with your API keys draw from your prepaid credit as usual.

Can the assistant reach another account? No. Every tool runs inside the account that signed in.

Does connecting MCP change which model my assistant uses? No. It only adds account management tools.

Can I manage the account from a terminal instead? Yes, with the zctl CLI.

Links

License

The contents of this directory are available under the MIT License.

來源:README.md,提交 f02a3b9

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.11.7最新Oct 9, 2026