openclaw - 💡(How to fix) Fix [Feature]: token usage widged in chat UI [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62167Fetched 2026-04-08 03:08:10
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Display token usage/remaining quota prominently in the OpenClaw Control UI chat interface.

Users would like:

A persistent token counter widget at the top of the chat Per-message token usage shown below each assistant response Providers to support: OpenRouter (credits API), LLMAPI (unlimited), Ollama (local).

Root Cause

Display token usage/remaining quota prominently in the OpenClaw Control UI chat interface.

Users would like:

A persistent token counter widget at the top of the chat Per-message token usage shown below each assistant response Providers to support: OpenRouter (credits API), LLMAPI (unlimited), Ollama (local).

RAW_BUFFERClick to expand / collapse

Summary

Display token usage/remaining quota prominently in the OpenClaw Control UI chat interface.

Users would like:

A persistent token counter widget at the top of the chat Per-message token usage shown below each assistant response Providers to support: OpenRouter (credits API), LLMAPI (unlimited), Ollama (local).

Problem to solve

  • Users cannot see token usage/remaining quota in real-time during chat
  • Token usage is only visible via /status command, which requires manual execution
  • Users with limited API credits may run out mid-conversation without warning
  • No easy way to compare costs across different providers/models

Proposed solution

Add a token usage widget to the OpenClaw Control UI chat interface:

  1. Header widget - A collapsible panel at the top of chat showing:

    • Tokens used in current session
    • Tokens remaining (for providers with quota APIs)
    • Estimated cost
  2. Per-message display - Show tokens consumed under each assistant response

  3. Provider support:

    • OpenRouter: Fetch from credits API
    • LLMAPI: Show as "unlimited" (free tier)
    • Ollama: Show as "local/unlimited"
  4. Optional: Low-credit alert via heartbeat when quota falls below threshold

Alternatives considered

No response

Impact

Affected users:

  • All OpenClaw users who rely on paid API providers (OpenRouter, Anthropic, OpenAI, etc.)
  • Users with limited/free tier quotas who need to monitor usage carefully
  • Multi-provider setups where cost comparison matters

Severity:

  • Moderate to High - Blocks informed decision-making about model selection
  • Users cannot proactively switch to cheaper/free models before hitting limits

Frequency:

  • Always - Every conversation consumes tokens but visibility requires manual /status check
  • Pain occurs every session for users tracking costs/quotas

Consequences:

  • Unexpected "insufficient credits" errors mid-conversation
  • Extra manual work: users must check external dashboards (OpenRouter credits page, etc.)
  • Cannot make real-time cost/benefit decisions (e.g., "should I switch to a cheaper model now?")
  • Potential workflow disruption when paid models suddenly stop working

Evidence/examples

No response

Additional information

No response

extent analysis

TL;DR

Implement a token usage widget in the OpenClaw Control UI chat interface to display real-time token usage and remaining quota.

Guidance

  • To address the issue, consider adding a header widget that shows tokens used, tokens remaining, and estimated cost for each provider.
  • Implement per-message token usage display under each assistant response to provide detailed usage information.
  • Develop provider-specific implementations to fetch token usage data, such as using the OpenRouter credits API or displaying "unlimited" for LLMAPI.
  • Consider adding a low-credit alert feature via heartbeat when the quota falls below a certain threshold to notify users of potential issues.

Example

// Example of a token usage widget
Token Usage:
- Tokens used: 100
- Tokens remaining: 900
- Estimated cost: $1.00

Notes

The implementation details may vary depending on the specific requirements and technical constraints of the OpenClaw Control UI chat interface. Additionally, the solution should be tested with different providers to ensure compatibility and accuracy.

Recommendation

Apply a workaround by implementing the proposed token usage widget to provide users with real-time token usage and remaining quota information, allowing them to make informed decisions about model selection and avoid unexpected "insufficient credits" errors.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING