How do I query LLM cost per end user over MCP?
Rius gives you cost per end user over MCP through the list_users tool, sorted by cost, so your client can rank your most expensive customers. Connect the Rius MCP server to your client and ask, for example, “Who were my ten most expensive end users this week?”. For one user’s detail, the client can also call user_activity_summary. Costs are list-price estimates in US dollars.
How it works
Rius prices each model call at ingest and rolls the cost up per end user, using the user.id on the spans. You never send a cost value. Over MCP, your client picks the tools for you:
list_usersreturns the end users your agents served, and the client asks for it withsortset tocost, and the server returns the top users ranked by cost. This is the same register the Users page shows, where each row has traces, failed traces, cost, the agents that served the user and when they were last seen.user_activity_summarycovers one user’s activity when you want more than a ranking.list_agent_tracesandlist_spanstake auser_idargument, so you can go from an expensive user to the runs and calls behind the number.
The cost for a user is their total cost and their average cost per trace. Only finished traces count, so a run that is still going is not in the figure yet.
A trace with no end user on any span lands in the anonymous row, not under a person. A model Rius cannot price leaves its cost empty, not zero, so a user’s total adds up only the calls that were priced. See Track LLM and agent cost for how pricing works.
Set it up
- Tag your end users in your code, so cost has someone to attach to. Set
user.idon every span of a request: in Python withrius.user, in TypeScript withwithUser. Prefer an opaque user id to an email. The Users page explains how Rius reads the end user from a span. - Connect the Rius MCP server to your client. For Claude Code, run:
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. For an agent that runs without a browser, use a read-scoped API key as an Authorization Bearer header instead. An ingest key, the kind the SDK uses, cannot query. The MCP page has the snippets for Codex, Cursor, Claude Desktop and other clients.
3. Ask for the ranking in plain language:
Who were my ten most expensive end users this week?
What did user test-user-1 cost compared with the average?
- Narrow the question if you need to. Name a time window, or name a single user by their exact ID. The Users page works over 15 minutes, 1 hour, 1 day, 7 days (its default) or 30 days.
- Check the answer once against the console. Open Users, sort by Cost, and compare the top rows with what your client reported.
What you get
- A ranking of end users by cost for the window you ask about, with each user’s total cost and average cost per trace.
- The context to judge the number: traces, failed traces and the agents that served each user, so you can tell a heavy user from one who triggers retries.
- A way to drill down. From a costly user, your client can list that user’s traces and the individual model calls behind them using the
user_idargument. - An anonymous row for traffic that carries no end user. If it is large, some code paths run outside a user scope, and their cost is not attributed to anyone.
- Cost figures in US dollars, priced from the model and token counts. They are list-price estimates, so expect your invoice to differ.
The Users page lists the top 50 users for the chosen sort. To reach anyone beyond that, ask for them by their exact user ID.
When something else fits
- If you run one workspace per customer, the workspace total is that customer’s cost, and Usage and cost is the better view than a per-user ranking.
- If you want to be told when cost climbs rather than ask for it, set up a cost alert. Cost is measured per trace there, not per user.