ClaudeCodeMod

All shelves / Mods / Usage

openrouter-balance

By hamzafer

openrouter-balance is a Claude Code usage mod by hamzafer.

Draws your OpenRouter credit above the prompt: the balance with a gauge, today's spend, and the model the money mostly went to.

Draws

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install openrouter-balance@claude-code-mods
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.1.2
License
MIT
Repo stars
381
Last change
2026-10-15

What it can reach

  • Draws in the session
  • Reaches the network or an outside service

Claude Code 2.1.287 or later. The author says to restart after installing. Needs an OpenRouter key, from /config, else OPENROUTER_MANAGEMENT_KEY, else OPENROUTER_API_KEY, else the macOS Keychain item openrouter-key, and kept in memory only. With a management key, which cannot make model calls, the balance is real: OpenRouter reports the credits bought and used, and spend by model shows too. A regular API key shows the account balance when OpenRouter answers for it, and else its own spend today and this month and what its limit leaves; when the key's limit would run out before the account's credit, the line shows the key limit. The line is green from $5, yellow under $5, and red under $2. /openrouter-balance shows the balance, today, yesterday, the last 30 days, and spend, requests, and tokens by model, or, with a regular key, today, this week, this month, all time, its limit, and its budget. It refreshes every 5 minutes and after each turn, and a failed refresh keeps the last numbers, marked offline.

The marketplace, claude-code-mods, holds the mods in hamzafer's repo, openai-balance among them. This one installs on its own, or from the checklist that npx claude-code-mods@latest opens. Its own plugin.json names Jakub Krysmalski as its author. Watching what API calls cost is why this page files it under usage. openai-balance, in the same marketplace, draws your OpenAI API credit as an estimated balance, because OpenAI has no balance API. This one reads the real balance from OpenRouter. Today is the UTC day. OpenRouter reports spend by model for completed days only, so with a management key today is the usage now minus where it stood when the mod first saw the day, and a day first seen after 00:15 UTC reads since and the time instead.

Demo

openrouter-balance: OpenRouter credit with a gauge and today's spend above the Claude Code prompt
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • turn.completeWhen a turn ends
  • command.runWhen you run its slash command/openrouter-balance
  • ui.renderDraws into the sessionAbovePrompt

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /openrouter-balanceOpenRouter credit, spend today and spend by model

Files

The author's source, 3 files. They load when you open them.

Facts

Author
hamzafer
Category
Usage
Marketplace
claude-code-mods
Repo
hamzafer/claude-code-mods
Folder
mods/openrouter-balance
Version
0.1.2
License
MIT
Repo stars
381
Last change
2026-10-15
Language
TypeScript
Files
7

Other mods in Usage

winnowGhalebDweikatReplaces parts of a large Read, Bash, or Grep result a judge calls unneeded with a stub, a summary, and a key that brings the text back, then toasts.compact-adviserkunchenguidDraws a hint above the prompt to run /compact when Jev calls the session a finished checkpoint, and can run /compact itself if you opt in.fast-jev-compactiontamaratranShows a toast when /compact keeps the messages Jev still wants and drops the rest, instead of replacing the history with a summary.effortlessHeyCubitDraws a bar above the prompt with the reasoning effort it picked for this prompt, how full the chat is, and how long the prompt cache stays warm.headroom-snipheadroomlabs-aiDraws a band above the prompt showing Headroom cutting each request from its original token count to what was sent, with a /headroom log and a running total.leaksdavekissOpens a pane that ranks the avoidable spend in the last 7 days of transcripts, and draws a strip above the prompt when a leak is happening.context-dietdrkokorevReplaces a huge tool output with a short digest and the path of a file that still holds the full text, and /diet opens a panel of what it saved.agent-profilerYeonwooSungDraws where a session's time goes, model wait against tools and subagents, in a status line and a live pane, and can write the session out as an OTLP trace.claude-carbongwittebolleDraws the CO2 of each answer and a pane with a pixel molecule colored against your past sessions, plus this session's total under the prompt.dividendMint-SecurityDraws a tip above the prompt about the prompt cache, the context, or the plan limits, with a status line and a /dividend pane of the session's figures.caliber-jev-compactioncaliber-ai-orgReplaces /compact: Jev scores each tool call, drops the stale ones, and keeps the rest of the conversation word for word, then toasts what it kept.model-effort-bandYeonwooSungDraws a band above the prompt with the selected model and the effort of the latest main-conversation request.
All 183 in Usage