How much does OpenHands cost per developer, and how do I measure it?
Rius measures OpenHands cost per conversation and per developer by pricing the tokens each model call reports at list API rates, so you read a figure from your own traces. Pass user_id when you create the conversation and the Users page shows each developer’s traces and cost. One Claude Haiku 4.5 run of a small coding task made four model calls with 31,091 input tokens and 966 output tokens, and cost $0.0175. Where a model call reports no token usage, Rius shows no cost for it.
How it works
- One conversation is one trace and one session. The conversation id becomes the Rius session, so a multi-turn conversation groups together.
- Each model call carries its own cost. Rius reads the model and the token counts on the span, including cache reads and writes, and prices them with LiteLLM’s public model-price catalog in US dollars. You never send a cost.
- The cost is a list-price estimate. Rius applies each model’s standard rates. It does not apply batch or priority pricing, long-context tiers or any discount you negotiated, so it can differ from your invoice.
- A developer is the
user_idyou pass. Every span in the conversation carries it, and Rius adds the conversations up under that user. Without it, conversations land in the anonymous row. - No usage means no cost, not zero. If a model is missing from the catalog, or a call reports no tokens, its cost stays empty. Totals add up only the calls that were priced, and the console shows a dash for a total with nothing priced.
Three OpenHands setups report no usage:
- OpenAI Responses API models such as GPT-4.1 and GPT-5 have no token data.
- Streamed calls from the local web app have no tokens or cost. Those traces still show every prompt, answer and tool call.
- OpenHands Cloud cannot be pointed at Rius.
Claude and GPT-4o in SDK scripts come through in full.
Set it up
- Send your OpenHands conversations to Rius with three environment variables. The full steps, including the API key and the web app, are in the OpenHands guide.
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://ingest.eu.console.rius-glassflow.com/v1/traces
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer%20ri_..."- Pass each developer’s id as
user_idwhen your script creates the conversation. Use the same id for the same person every time. This is what splits cost per developer.
conversation = Conversation(
agent=agent,
workspace=".",
user_id="dev@example.com",
observability_metadata={"agent.name": "fib-writer"},
)- Run a conversation, open the trace and click a model call. Its span shows the model, tokens and cost. The trace shows the total only where its model calls reported usage.
- Open the Users page, sort by Cost, and read each developer’s traces, failed traces and cost for the selected window.
- Optionally, add a custom alert on cost per conversation, for example average cost above $0.50 for one agent. See Track LLM and agent cost for how pricing and cost alerts work.
What you get
- Cost per session. Each conversation is one trace. Where its model calls report token usage, you see tokens and cost on each call, and the cost of the whole run in the trace.
- Cost per developer. The Users page lists each developer with their traces, failed traces and cost, and sorting by Cost shows who drives spend.
- Cost per agent and per model. The same traces feed cost over time, broken down by model and agent.
- A clear gap where there is no usage. Calls without usage or a catalog price show an empty cost, so a missing figure is never read as a free call.
- A usage measure on a subscription. If a developer reaches models through a flat subscription, the figure is the token usage priced at API rates, not what that developer pays. The Claude Code usage guide says the same for Claude Pro and Max. Use it to compare developers and spot expensive runs.
This fits the wider Coding agents setup, where Claude Code, Codex (beta), Cursor (beta) and OpenHands send to one workspace.
When something else fits
- If you need the amount you are actually billed, use your model provider’s invoice. Rius shows list-price estimates and does not apply negotiated or batch discounts.
- If your developers use the OpenHands web app, Rius shows no tokens or cost for those conversations because the calls are streamed. SDK scripts report usage for Claude and GPT-4o.
- If you use OpenHands Cloud, Rius cannot receive its traces, so there is no cost figure to read.
Related
Last updated on