claude-code-mods

openai-balance

Your OpenAI API credit above the prompt: an estimated balance with a gauge, today's spend, where the money mostly went, and the last call.

See what's happening Version 0.1.1

openai-balance: about $13.67 of $13.82 left with a green gauge, $0.21 spent today, last call on gpt-5
The estimated balance, today's spend and the last call's model.

Install

claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install openai-balance@claude-code-mods

Restart Claude Code after installing. To try it without installing, clone the repo and run claude --plugin-dir mods/openai-balance.

How to use

Give it an OpenAI organization Admin key (read-only is enough) in /config, then set your balance once from the Billing page:

/openai-balance 25.00

Run /openai-balance with no amount for the full breakdown. Set it again after a top-up.

How it behaves

  • The balance is an estimate: OpenAI has no balance API, so it is the amount you set minus the spend the Costs API reports since then.
  • Green from $5, yellow under $5, red under $2.
  • Shows the model and time of the newest call, and "mostly <model>" when today's money mostly went elsewhere, such as Decisions API calls, which OpenAI's Usage API doesn't list yet.
  • The key comes from /config, else OPENAI_ADMIN_KEY, else the macOS Keychain item openai-admin-key, and stays in memory.
  • Refreshes every 10 minutes and after each turn. A failed refresh keeps the last numbers, marked offline.
  • Narrow terminals drop the gauge first.