OpenRouter 工作台 Local

v0.6.0-alpha.3
io.github.cyuanxv/openrouter-analytics-mcp Checked 4 hours ago Published 1 month ago

Local OpenRouter cost analytics, reports, experiments and routing presets over MCP stdio.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_account_summary Get OpenRouter account summary

Get OpenRouter remaining credit plus today, yesterday, 7-day and 30-day spend. Use for balance or recent account-spend questions. Requires the configured Management Key.

ParameterTypeDescription
include_spend_windowsboolean
timezonestring

get_analytics_meta Get OpenRouter Analytics schema

Get the live OpenRouter Analytics schema and optional ready-to-run query recipes for spend, API keys, providers and token analysis. Recipes never execute automatically.

ParameterTypeDescription
include_query_recipesboolean

query_usage Query OpenRouter usage analytics

Query OpenRouter spend, requests, tokens, cache, model, provider, API key, workspace, app, agent or time trends. Supports common time presets and advanced Analytics API fields.

ParameterTypeDescription
dimensionsarray
filtersarray
granularitystring
group_limitinteger
limitinteger
metricsarray
order_byobject
presetstring
time_rangeobject
timezonestring

analyze_cost_anomalies Detect OpenRouter cost anomalies

Detect spend spikes over completed UTC or Asia/Shanghai days against a consecutive-day baseline. Shanghai verifies sparse hours against independent UTC day cost and request controls, excludes unresolved days, and limits analysis plus baseline to 31 days. Other timezones are unsupported.

ParameterTypeDescription
absolute_threshold_usdnumber
baseline_daysinteger
daysintegerDefaults to 30 for UTC, 7 for Asia/Shanghai. Shanghai days plus baseline_days must be at most 31.
ratio_thresholdnumber
reconcile_sparse_daysbooleanVerify sparse Shanghai hours against independent complete UTC day totals. Set false for strict explicit-bucket auditing.
timezonestring

analyze_cost_optimization Analyze OpenRouter cost optimization opportunities

Analyze top OpenRouter cost contributors using live usage, token/cache metrics and optional current catalog/provider prices. Return observed signals, actionable verification steps and data-quality gaps. Savings are not invented or automatically estimated.

ParameterTypeDescription
include_provider_evidenceboolean
presetstring
timezonestring
top_modelsinteger

list_api_keys List OpenRouter API keys

List API key metadata, limits and usage counters. Plaintext secrets are never returned.

ParameterTypeDescription
include_disabledboolean
offsetinteger
workspace_idstring

compare_models Compare OpenRouter models

Compare OpenRouter model IDs using live catalog prices, context and optional provider evidence. If the user supplies a text-token workload, calculate an explicitly hypothetical cost scenario without running a generation. Missing prices or known context/modality violations prevent an estimate. Use official tools for quality evidence.

ParameterTypeDescription
model_ids *array
include_endpointsboolean
workloadobject

routerlens_status Check OpenRouter 工作台 configuration

Check whether the private OpenRouter 工作台 analytics bridge is configured. Does not expose credentials.

list_call_records list_call_records

List bounded OpenRouter request metadata by generation ID. Dates are start inclusive/end exclusive; defaults to yesterday. No prompt content, no inferred zero, no invented pagination.

ParameterTypeDescription
api_key_idstring
end_date
finish_reasonstring
limitinteger
modelstring
providerstring
start_datestring
timezonestring

get_call_detail get_call_detail

Read allowlisted metadata for one existing generation. Returns cost, tokens, timing and finish reason; never prompt/reply text. Credential-specific access may be unavailable.

ParameterTypeDescription
generation_id *string

investigate_spend investigate_spend

Compare a completed day with another completed day; attribute changes to model/provider. API-key labels are returned per hour and must not be treated as unique IDs.

ParameterTypeDescription
compare_date
datestring
timezonestring

explain_cost_anomaly explain_cost_anomaly

Explain a completed day against the preceding complete-day mean using reconciled model and app contributions plus request/input/output changes. Read-only metadata, no proven causal claims.

ParameterTypeDescription
baseline_daysinteger
datestring
timezonestring

generate_cost_report generate_cost_report

Generate and save an idempotent weekly report or daily alert from completed periods. Returns message text for approved Telegram delivery. Saving does not send; claim and record delivery separately.

ParameterTypeDescription
end_datestring
kindstring
timezonestring

list_cost_reports list_cost_reports

List saved reports and delivery states. No query or notification is executed.

ParameterTypeDescription
limitinteger

get_cost_report get_cost_report

Read a saved report including its completeness and delivery evidence.

ParameterTypeDescription
report_id *string

claim_report_delivery claim_report_delivery

Atomically claim a pending report before its approved Telegram send. Send only if claimed=true and should_notify=true. A stuck/unknown send must not be retried automatically.

ParameterTypeDescription
report_id *string

record_report_delivery record_report_delivery

Record an actual Telegram send receipt or uncertain failure for a claimed report. Does not send; never mark sent without a real receipt.

ParameterTypeDescription
report_id *string
state *string
message_id

create_cost_experiment create_cost_experiment

Save a bounded experiment plan. Runs no model and changes no routing. Record results only after separately authorized trials or existing request review.

ParameterTypeDescription
baseline_model *string
budget_usd *number
candidate_models *array
experiment_id *string
quality_criteria *string
minimum_casesinteger

record_experiment_result record_experiment_result

Save metadata and owner-reviewed quality for a matched case. A generation ID reads actual cost/model; without it, supplied costs are explicitly manual evidence. Does not run inference.

ParameterTypeDescription
case_id *
experiment_id *string
quality_pass *boolean
success *boolean
variant *string
cost_usdnumber
generation_id
latency_msnumber

get_cost_experiment get_cost_experiment

Compare matched cases by owner-reviewed quality, actual/manual costs and latency. Includes unmatched cases and budget status; never performs a production switch.

ParameterTypeDescription
experiment_id *string

list_cost_experiments list_cost_experiments

List saved experiment plans.

save_model_preset save_model_preset

Save a versioned personal routing preset; expected_revision=0 creates. No provider writes or inference. To restore, read an old revision and save it against the current revision.

ParameterTypeDescription
config *object
expected_revision *integer
preset_id *string

list_model_presets list_model_presets

List the latest saved personal presets, including disabled presets.

get_model_preset get_model_preset

Read a preset or historical revision and revision history.

ParameterTypeDescription
preset_id *string
revisioninteger

preview_model_routing preview_model_routing

Validate a configuration against current public model metadata and return an OpenRouter request fragment. Never executes the request or changes routing.

ParameterTypeDescription
config *object

export_model_preset export_model_preset

Validate and export an exact saved revision. No messages, credentials, inference or production routing changes.

ParameterTypeDescription
preset_id *string
revision *integer

get_routing_providers get_routing_providers

Read current provider slugs and parameter support for a selected model.

ParameterTypeDescription
model_id *string

search_routing_models search_routing_models

Search current public model IDs to configure a preset.

ParameterTypeDescription
query *string
limitinteger