过去两年一直在部署智能体的每家公司,现在都在问同一个问题:它们到底花了我们多少钱,哪些又真正值得?OpenRouter 的 Activity 仪表盘和测试版 Analytics API 就能按智能体、按模型、按请求来回答这个问题。
打开 Activity,就能看到支出如何在智能体、应用和团队成员之间分布。找出哪些模型和任务在推高成本,以及缓存又在哪些地方帮你省了钱。创建并保存自定义视图,然后从任意图表逐层下钻到单条请求。
所有这些数据都可以通过测试版 Analytics API 获取。把你的智能体指向 openrouter-analytics 技能,就能深入分析你的用量,在终端里快速得到答案,或者把数据拉进你自己的仪表盘。
先从全局看起
Overview 让你一眼掌握用量情况。顶部有五个指标:总支出、请求数、token 总量、缓存命中率,以及每百万 token 的综合成本,每个指标都配有迷你趋势图,并与上一周期进行对比。同一屏幕上还有:你的头部用户和应用、按模型统计的支出、OpenRouter 积分与 BYOK 支出对比、按模型统计的请求量、提示词与补全 token 拆分,以及提示词缓存情况。


Trends 用同一份数据,但按变化幅度而非体量来排序,有一个面板专门展示哪些在上升、哪些在下降。查看你在模型、用户、API 密钥和应用层面的趋势。用它来发现某个失控的智能体、某个正在起量的新模型,或者某个正在你组织内扩散的工具。


探索任意问题
Overview 和 Trends 上的每一张卡片都能链接到 Explore,在那里你可以自己拼装视图:
- 指标:支出、请求数、token(提示词、补全、推理或缓存)、缓存命中率、每百万 token 综合成本、BYOK 与积分支出对比,或延迟与吞吐量(细分到 P50/P90/P99)
- 分组维度(最多两个):模型、变体、提供商、API 密钥、应用、用户、工作区、来源、国家、数据区域、结束原因、上下文长度、会话、生成批次、自定义用户 ID,或你定义的任意分类维度
- 聚合粒度:按分钟、小时、天、周或月,也可以去掉时间轴,直接看排名表
- 图表类型:柱状图、折线图或散点图
用它来查看每个工作区中哪些应用在驱动使用量、你的智能体在每种任务类型下使用了哪些模型,或者你的服务商延迟随时间的变化趋势。



保存你常用的视图。打开选项菜单,选择“保存当前图表”并为其命名。在组织中,你还可以选择谁能看到它:仅自己,或组织内的所有人。

下载 CSV 或下载 PDF,即可将任意图表的数据直接导入电子表格或报告中。
Guardrails 展示你的提示词注入和敏感信息规则阻止、脱敏或标记了哪些内容,以及哪些规则在发挥作用。用它来监控进入你提示词的敏感数据比例,以及哪些规则和数据类型在拦截这些数据。可按工作区或分类器筛选,以缩小来源范围。

展开卡片即可查看完整明细,包括哪些检测模式组合触发了每次阻止、脱敏和标记。

点击图表,直达日志
聚合数据告诉你某些内容变得昂贵了。下一个问题是哪些请求导致的。
Activity 中的每个图表和排名表都可链接到其背后的日志。点击周二的柱状条、堆叠图表中某个模型的切片,或排名表中的某一行,你就会进入已按这些请求筛选好的日志。

打开日志中的任意一行,即可查看 Generation 详情视图。它显示:
- 成本:上游推理、缓存、网络搜索和文件处理,以及已应用的折扣和缓存节省
- 性能:服务商延迟、吞吐量和首 token 时间
- 路由:哪个服务商处理了该请求、是否回退到另一个服务商,以及结束原因
- 归因:背后的应用、API 密钥和工作区,以及会话 ID、请求 ID 和数据区域
- 上下文:任何 guardrail 事件、分类器标签和原始元数据


Prompt 详情视图渲染完整的消息数组,以及按角色着色的每条消息预估 token 火焰图:system、user、assistant 和 tool。一个成本是你预期三倍的对话,通常会在这里显示为一条宽阔的工具调用带或一个庞大的系统提示词。缓存前缀带有阴影标记,因此你可以看到缓存覆盖到提示词的哪个位置,以及是哪条消息打破了缓存。

每条消息的 token 数量是根据消息大小估算得出的;生成结果本身的总量则是实际记录的用量。提示词和补全的明细仅在请求运行时启用了私有输入/输出日志时才存在,你可以在工作区的可观测性设置中启用该功能。
与 Explore 相同的数据,可通过 API 获取
Explore 中的所有内容也可以通过测试版 Analytics API 获取:让你的智能体运行分析,在终端中快速获得答案,或将数据拉取到你自己的仪表盘中。Analytics 查询需要管理密钥。有两个端点:
- GET /api/v1/analytics/meta 返回当前支持的指标、维度、筛选运算符和粒度。请先调用元数据端点查看可用内容;我们一直在添加新的指标和维度。
- POST /api/v1/analytics/query 运行查询并返回与 Explore 图表所依据的相同聚合数据。
curl -X POST https://openrouter.ai/api/v1/analytics/query \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metrics": ["total_usage", "tokens_total", "cache_hit_rate"],
"dimensions": ["model"],
"granularity": "day",
"time_range": {"start": "2026-07-01T00:00:00Z", "end": "2026-08-01T00:00:00Z"},
"limit": 20
}' 面向智能体
成本控制手册让你的智能体负责支出分析。给你的编程智能体一个管理密钥和 openrouter-analytics 技能,让它对你的 OpenRouter 账户进行成本审查。它会找出那些成本达到你每百万 token 混合费率数倍的模型,追溯到负责的密钥和流水线,并返回排序后的建议。
我们在内部运行了这项操作,发现一个预览模型每月消耗约 6.2K 美元,约为组织混合费率的 25 倍。经过一次下钻查询,其中 98% 的成本追溯到单个批处理流水线密钥,该密钥运行的任务根本不需要前沿模型。修复方法是一行模型替换。请参阅手册中我们使用的查询配方和智能体提示词。
打开 Activity,或者如果你已经知道想回答的问题,可以从 Explore 开始。如果想在终端中操作,可以获取管理密钥并使用测试版 Analytics API。
在 Discord 的 #feedback 频道告诉我们你还想看到什么功能。
Every company that spent the last two years deploying agents is now asking the same question: what are they costing us, and which ones are worth it? OpenRouter’s Activity dashboard and beta Analytics API answer that question per agent, per model, per request.
Open Activity to see how spend breaks down across agents, apps, and team members. Find out which models and tasks drive costs, and where caching cuts your bill. Create and save custom views, then drill from any chart down to the individual requests.
All of the data is available through the beta Analytics API. Point your agent at the openrouter-analytics skill to dig into your usage, get a quick answer in your terminal, or pull the numbers into your own dashboards.
Start with the big picture
Overview is your usage at a glance. Five metrics at the top: total spend, requests, token volume, cache hit rate, and blended cost per million tokens, each with a sparkline and a comparison against the previous period. On the same screen, your top users and apps, spend by model, OpenRouter credits versus BYOK spend, request volume by model, prompt and completion token breakdown, and prompt caching.


Trends takes the same data and sorts by movement instead of size, with a panel showing what’s rising and falling. See your trends across models, users, API keys, and apps. Use it to spot a runaway agent, a new model gaining traction, or a tool spreading across your org.


Explore any question
Every card on Overview and Trends links into Explore, where you assemble the view yourself:
- Metric: spend, request count, tokens (prompt, completion, reasoning, or cached), cache hit rate, blended cost per million tokens, BYOK versus credit spend, or latency and throughput down to P50/P90/P99
- Group by (up to two dimensions): model, variant, provider, API key, app, user, workspace, origin, country, data region, finish reason, context length, session, generation, custom user IDs, or any classifier dimension you’ve defined
- Rollup: minute, hour, day, week, or month, or drop the time axis for a ranked table
- Chart type: bar, line, or dot plot
Use it to see which apps are driving usage in each workspace, which models your agents are using for each task type, or how your provider latency is trending over time.



Save your go-to views. Open the options menu, choose Save current chart, and name it. In an organization you also choose who sees it: Only me, or Everyone in my organization.

Download CSV or Download PDF to send any chart’s data straight into a spreadsheet or report.
Guardrails shows what your prompt injection and sensitive-information rules blocked, redacted, or flagged, and which rules are doing the work. Use it to monitor the rate of sensitive data entering your prompts, and which rules and data types are catching it. Filter by workspace or classifier to narrow in on where it’s coming from.

Expand a card to get the full breakdown, including which combinations of detected patterns drove each block, redaction, and flag.

Click a chart, land in the logs
Aggregates show you that something got expensive. The next question is which requests.
Every chart and ranked table in Activity links through to the logs behind it. Click Tuesday’s bar, one model’s slice of a stacked chart, or a row in a ranked table, and you land in your logs filtered to those requests.

Open any row in logs for the Generation detail view. It shows:
- Cost: upstream inference, caching, web search, and file processing, plus the discounts and cache savings applied
- Performance: provider latency, throughput, and time to first token
- Routing: which provider served the request, whether it fell back to another one, and the finish reason
- Attribution: the app, API key, and workspace behind it, plus session and request IDs and data region
- Context: any guardrail events, classifier tags, and the raw metadata


The Prompt detail view renders the full messages array and a flamegraph of estimated tokens per message colored by role: system, user, assistant, and tool. A conversation that costs three times what you expected usually shows it here as a wide band of tool calls or a heavy system prompt. The cached prefix is shaded, so you can see how far into the prompt the cache held and which message broke it.

Per-message token counts are estimates derived from message size; the totals on the generation itself are recorded usage. Prompts and completions detail only exist if private input/output logging was enabled when the request ran, which you can enable in your workspace observability.
Same data as Explore, via API
Everything in Explore is also available through the beta Analytics API: let your agent run the analysis, get a quick answer in your terminal, or pull the numbers into your own dashboards. Analytics queries require a management key. Two endpoints:
GET /api/v1/analytics/metareturns the currently supported metrics, dimensions, filter operators, and granularities. Call the metadata endpoint first to see what’s available; we’re always adding new metrics and dimensions.POST /api/v1/analytics/queryruns the query and returns the same aggregates the Explore charts are drawn from.
curl -X POST https://openrouter.ai/api/v1/analytics/query \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metrics": ["total_usage", "tokens_total", "cache_hit_rate"],
"dimensions": ["model"],
"granularity": "day",
"time_range": {"start": "2026-07-01T00:00:00Z", "end": "2026-08-01T00:00:00Z"},
"limit": 20
}' For agents
The cost control cookbook puts your agent in charge of spend analysis. Give your coding agent a management key and the openrouter-analytics skill and have it run a cost review on your OpenRouter account. It finds the models costing a multiple of your blended rate per million tokens, traces them back to the keys and pipelines responsible, and returns ranked recommendations.
We ran this internally and found a preview model burning ~$6.2K/month at roughly 25x the org’s blended rate. One drill-down query later, 98% of it traced to a single batch-pipeline key running a task that never needed a frontier model. The fix was a one-line model swap. See the query recipes and agent prompts we used in the cookbook.
Open Activity, or start in Explore if you already know the question you want answered. To work from your terminal instead, grab a management key and hit the beta Analytics API.
Tell us what you’d like to see next in #feedback on Discord.