How do I query LLM cost per release over MCP?
Rius gives you cost per release over MCP through the compare_agent_versions tool, which puts cost per trace for two versions of an agent side by side. Tag your runs with a version, connect the Rius MCP server to your client, and ask which release cost more. The agent_versions tool lists the versions that ran, so your client can pick the two to compare.
How it works
Rius prices every LLM call at ingest and rolls the cost up per trace and per agent. If your runs carry a version, Rius also groups those traces by release. Your MCP client reads that grouping with two tools:
agent_versionslists the versions of an agent that ran in a time window.compare_agent_versionscompares two of them. The version comparison covers traces, failed rate, cost per trace, latency and time to first token (p50), and tokens per trace, with the change between the two.
The version comes from RIUS_MAIN_AGENT_VERSION, which marks the agent definition such as a prompt, tools and policy, or from RIUS_SERVICE_VERSION, which marks the build or deploy. When traces carry both, the console Compare view lets you switch between Agent version and Build. The cost figures are list-price estimates in US dollars, so they will differ from your invoice. For how a call is priced, see Track LLM and agent cost.
Set it up
- Tag each release when the agent starts. Set the agent version, and the build version if you want to compare deploys:
RIUS_MAIN_AGENT_VERSION=prompt-v12 # the agent definition: prompt, tools, policy
RIUS_SERVICE_VERSION=2026.09.29-a41f3c # the build or deploy-
Run the agent on each release so both versions have traces. The Agents page shows the versions it found under Versions. If it says the agent reports no version, the variable is not set.
-
Connect the Rius MCP server to your client. In Claude Code:
claude mcp add --transport http rius https://mcp.eu.console.rius-glassflow.com/mcpThe OAuth sign-in opens the first time a session uses the server. If you use the Rius plugin, it already registers the server as rius. For a CI job or other agent without a browser, use a read-scoped API key. The read scope reaches both version tools.
- Ask in plain language:
Compare the last two versions of checkout-agent. Did cost per trace go up?
Which release of planner costs the most per trace?
Your client calls agent_versions to find the releases, then compare_agent_versions for the pair you asked about.
What you get
- Cost per trace for each release, next to failed rate, latency, time to first token (p50) and tokens per trace, with the change between them. You see whether a new prompt or model raised cost the day it shipped.
- A warning when either side has fewer than 20 traces, because a difference on so few runs can be noise. Check it before you trust a cost jump.
- Tokens that include prompt cache, so a release that changes caching shows up in the token figure.
- The same comparison in the console under Versions, Compare and Drift on the agent page, if you want to look at the charts as well.
A call whose model has no price keeps an empty cost, not zero, so a release that uses a model without a price can look cheaper than it is. Check cost by model on the usage page if a figure looks too low.
When something else fits
- If you need cost for the whole workspace or by model rather than by release, ask for
workspace_metrics_overview, or use the usage page in the console. - If you want to be told when cost per trace crosses a limit, set a custom cost alert with
create_alert_ruleinstead of asking each time. - If the agent reports no version, tag it first, because there is nothing to group by until you do.