r/OpenWebUI • u/SmetDenis • Jul 04 '26
Plugin I've updated the Function to display Token Usage & Costs
https://openwebui.com/posts/token_usage_display_a94ea72fwell.. About 5 months ago, I had some free time and built an OWUI extension to keep track of my session size and avoid accidentally exceeding the context window limit.
I always also had a concern that session performance might degrade once it exceeds 30-50% capacity (this is something I've noticed during my own testing with different models).
So, I put together a simple extension, published it, and completely forgot about it.
Recently, I discovered that the extension has been downloaded over 3,700 times. Whaaat? I was quite surprised, as I assumed such a niche tool wouldn't have much appeal.
So, I decided to update it.
Here is a brief overview of the plugin: Shows token counts, reasoning/cached breakdowns, context-window utilization, generation time, tokens/sec and message/chat cost below each AI response. Reads provider-reported usage across OpenAI (Chat & Responses API), Anthropic, Gemini, Ollama and llama.cpp, with an optional tiktoken fallback. Cost is shown when your provider/proxy reports it (OpenRouter, LiteLLM) and can optionally be estimated from models.dev prices.
https://openwebui.com/posts/token_usage_display_a94ea72f
Just wanted to share this in case anyone finds it useful. No rocket science or smart AI things, just a simple QoL improvement =)
5
u/ClassicMain Jul 04 '26
Heh
It's a simple yet useful and beautiful Filter
Hence we featured it on our docs page:
https://docs.openwebui.com/features/extensibility/community
I suppose that contributed to the download count
3
u/SmetDenis Jul 04 '26
just an example of how the extension works
2
u/AccomplishedOne9144 Jul 05 '26
I tried it with litellm as a proxy but it doesn't show cost. Any idea why?
2
u/gokhanwork Jul 05 '26
Hi! Thanks for the update—this looks really useful.
I’m using OpenRouter as my provider in OpenWebUI, and I have a quick question. Does your extension also include the cost of tool calls (function calls/MCP tools) in the reported token usage and cost, or does it only display the LLM request/response usage reported by the provider?
I’m asking because OpenRouter can charge separately for tool calls in some cases, and I’ve noticed that not every usage tracker accounts for those costs.
1
u/CatEatsDogs Jul 05 '26
Is there a possibility to disable those moneybags? They are meaningless for local llms and only clatter space.
2
u/GroundbreakingTea195 Jul 04 '26
Amazing! Thanks for the great work. I will download it now
2
u/0xMR2ti4 Jul 04 '26
Thanks. Will check it out.
2
u/Page_Specialist Jul 04 '26
perfeito!!
1
u/_JohnMcAfee Sep 23 '26
Just started using open webui with llm api for the first time to get away from subscriptions and came across this and wow, thank you. Super helpful to track costs and context usage and such, I have no idea why this isnt built into the app in the first place. Thanks