This is the setup guide for the Anthropic menu bar plugin from the article: Keep track of your AI providers credit balance in macOS menu bar.

What it does

The plugin displays your current Anthropic prepaid credits balance in the macOS menu bar as a compact label like Anthropic: $12.34.

It refreshes every minute (the filename ends with .1m.sh) and adds a dropdown action: Refresh now.

Prerequisites

  • macOS with bash, curl, and python3 available.
  • xbar installed.
  • An Anthropic account with prepaid credits enabled.
  • Your Anthropic organization id and dashboard sessionKey cookie value.

Install

  1. Install xbar from https://xbarapp.com/.
  2. Open xbar and use Preferences → Open Plugin Folder.
  3. Copy anthropic_balance.1m.sh into your xbar plugins folder.
  4. Make it executable:
    chmod +x anthropic_balance.1m.sh
    
  5. Refresh xbar (or restart the app).

Configure org id and session key

Edit anthropic_balance.1m.sh and set:

  • ENDPOINT_URL by replacing <org-id> with your organization id.
  • SESSION_KEY to your Anthropic dashboard sessionKey.

How to get them (from the plugin README):

  1. Log in to Anthropic Console.
  2. Open DevTools and go to Network.
  3. Find a request to /api/organizations/<org-id>/prepaid/credits.
  4. Copy the organization id from the request URL.
  5. Copy sessionKey from request cookies.

Notes

  • Endpoint used: https://platform.claude.com/api/organizations/<org-id>/prepaid/credits.
  • The plugin reads amount (in cents) and formats it as dollars.
  • If your sessionKey expires, the menu bar title turns into Anthropic: -- (red) and the dropdown shows an error.