How do I find which model each call used in OpenHands?
Rius shows the model on the span for each model call in an OpenHands conversation, so you can read it in the trace or filter the Spans tab down to model calls. Each call’s span carries the model name next to its tokens, cost, prompt and answer. The conversation id is the Rius session, so one search lists every call from one conversation.
How it works
OpenHands traces every conversation with OpenTelemetry, and Rius turns one conversation into one trace. Inside it, each agent.step holds the span for each model call, named llm. followed by the model you configured (for example llm.anthropic/claude-haiku-4-5-20251001), with a litellm.completion span beneath it.
- The
litellm.completionspan records the model, input and output tokens, cache reads and writes, cost, and the messages. - Tool calls such as
terminalandfile_editorsit beside the model calls, so you see which model call led to which action. - The conversation id becomes the session, and the agent name comes from
agent.namemetadata, so you can narrow to one agent or one conversation first. - Cost is a list-price estimate in US dollars, not a billed amount.
Set it up
- Set the model in your OpenHands script and name the agent. The model you pass to
LLMis the one that appears on the spans. If tracing is not on yet, follow the OpenHands guide first.
llm = LLM(
model=os.getenv("LLM_MODEL", "anthropic/claude-haiku-4-5-20251001"),
api_key=os.environ["LLM_API_KEY"],
base_url=os.getenv("LLM_BASE_URL"),
)
conversation = Conversation(
agent=agent,
workspace=".",
observability_metadata={"agent.name": "fib-writer"},
)- Open Traces in the console. Click the agent cell (
fib-writerhere) to filter the list to that agent. The time range defaults to 7 days. - Open the conversation. In the waterfall, expand an
agent.stepand select thelitellm.completionspan. Its Model section shows the provider, the requested and response model, tokens and cost. - To see every model call across conversations, open the Spans tab and choose LLM in the All kinds menu. Sort by Cost or Tokens to find the expensive calls.
- To list calls by model, open one model-call span, go to the Raw tab, and use Filter traces by this on the model attribute. The filter becomes a chip, and it matches exact values only, so a different model string needs its own filter. Chips combine with AND, so you can add the agent too.
- To see one conversation’s calls, open the Session link in the trace header, or paste the session id into the Spans search box. Then set All kinds to LLM.
For how filters, chips and saved searches work, see Exploring traces. Use Saved to keep a model filter you come back to.
What you get
- The model for every call in a conversation, in the span name and in the Model section.
- Tokens and cost on each call, so you can see which model drove the spend.
- A filtered list of model calls across all your OpenHands conversations, narrowed by agent, session or model.
- A shareable URL: filters live in the link, so a teammate opens the same filtered list.
- The same view for other coding agents. Claude Code sessions also record the model on each model call. See Coding agents for the full set.
When something else fits
- Web-app conversations (the local Docker app) record every model call with its prompt and answer, but no tokens or cost, because their model calls are streamed. OpenAI Responses API models such as GPT-4.1 and GPT-5 also carry no token data.
- OpenHands Cloud cannot send traces to Rius, so its model calls do not appear.
- If you want totals by model rather than individual calls, the Usage and cost page breaks cost down by model.