個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Native macOS menu bar app for tracking LLM API spend, tokens, and balances across OpenAI, Anthropic, DeepSeek, Qwen, xAI, and more.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Every LLM API bill in one macOS menu bar panel.
usespender.com · free · open source · MIT
Spender reads your spend straight from OpenAI, Anthropic, DeepSeek, xAI, Kimi,
Qwen and OpenRouter. Keys stay in the macOS Keychain — there is no
Spender account, no backend, and no credential proxy.
It never passes an estimate off as an official figure: every number is labelled
with where it came from, and a metric a provider does not report is left blank
rather than rounded down to zero.檢視完整 README ↗Spender reads your spend straight from OpenAI, Anthropic, DeepSeek, xAI, Kimi, Qwen and OpenRouter. Keys stay in the macOS Keychain — there is no Spender account, no backend, and no credential proxy.
It never passes an estimate off as an official figure: every number is labelled with where it came from, and a metric a provider does not report is left blank rather than rounded down to zero.
Download Spender.dmg — the latest release, for macOS 14 or later. Open it and drag Spender to Applications. The app is signed with a Developer ID and notarized by Apple, so macOS opens it without a warning. Release notes and checksums are on the Releases page.
Spender lives in the menu bar and has no Dock icon. Connect a provider from Options → Connections, and turn on Options → Settings → Launch at Login to keep it there after a restart. Prefer to build it yourself? See Build and run.
Spender lives in the menu bar and shows the running total next to the clock. Click it to open the panel above: the total, a bar showing which providers it is made of, then one card per connection, largest spender first. Everything below is one click deeper.
Connecting a provider. Open Options → Connections, find the provider and paste its key into the field. Some providers need a key that is not their ordinary inference key — an admin or management key with read access to billing — and their card says which one and links to the instructions for creating it. Saved keys go into the macOS Keychain and are never shown again.
30 Days. The same total over a month, with each provider labelled Official
or Estimated so it is clear which figures came from a billing API and which
Spender derived itself. Below it, spend per day, each bar split into the
providers' colours.
A card opened up. DeepSeek publishes no cost history, so Spender derives the figure from saved balance decreases — and says so on the card, next to the balance the provider does report. Each card also links to that provider's own billing, dashboard and status pages.
| Provider | Connection | Metrics in Spender |
|---|---|---|
| OpenAI | Organization Admin API key | Official cost, tokens, and models; remaining balance you enter once (see below) |
| Anthropic | Console Admin API key | Official cost, tokens, and models; remaining balance you enter once (see below) |
| DeepSeek | Standard API key | Official balance; estimated daily spend from saved balance decreases |
| Kimi | Standard API key and matching API host | Official balance |
| Qwen / Alibaba Cloud | Model Studio API key; optional read-only BSS AccessKey credentials | Key validation; official Alibaba Cloud balance and Qwen billing when BSS is configured |
| xAI / Grok | Team-scoped Management API key | Official prepaid balance, usage, and model breakdown |
| OpenRouter | Management API key | Official remaining credits |
OpenAI and Anthropic report what you spent, but their APIs do not return the credit you have left. So on those two cards you enter it once: Add Balance, then type the amount shown on the provider's Billing page. From then on Spender subtracts every new official cost report from it, and the card shows both the remaining balance and what was spent since you entered it.
The result is a calculation, not a figure the provider reported. Top-ups, refunds and credits it cannot see make it drift, so when it no longer matches Billing, use Recalibrate and enter the current amount again. Anthropic costs marked partial are not subtracted (see below). DeepSeek, Kimi, xAI, OpenRouter and Qwen (with BSS credentials) do report their balance, and there it comes straight from the provider.
Spender shows only money that a provider itself reports through a documented API. These providers do not offer that to an ordinary account yet:
| Provider | Why it is missing |
|---|---|
| Gemini | An ordinary API key can call the models but cannot read what the account has spent. |
| Perplexity | The same: the API key works for requests, not for billing. |
| Mistral AI | Reading spend needs an Admin API key. Mistral issues those only to Enterprise accounts, through its account team, and the Admin API is still a preview. |
| OpenCode Zen | OpenCode documents only the endpoints for calling models. There is no public way to read the balance or what was spent. |
| Z.ai | You can pay per call or buy usage bundles, but there is no documented API for reading the balance. |
Some apps work around this by calling a provider's internal, undocumented endpoints. Spender does not: such an endpoint can change or disappear without notice, and a wrong number is worse than no number. If any of these providers publishes a supported way to read spend, it can be added.
A failed or incomplete token report no longer discards a received OpenAI or Anthropic cost report. Missing token totals are omitted, not displayed as zero. OpenAI's complete cost report remains eligible for totals and balance deductions; token-report rate limits still delay retries.
Anthropic remains conservative: when usage scope cannot be checked, or Priority Tier usage is detected, its received costs are retained but marked partial and excluded from automatic balance deductions. The Cost API does not include Priority Tier charges. See Anthropic's documented scope.
DeepSeek's public API returns the current balance but not historical cost buckets. Spender therefore compares consecutive saved balance observations:
Existing daily estimates from older versions are retained, but cannot be redated without their original observation timestamps. These historical estimates are not retroactively corrected.
For authoritative history, use the CSV export on the DeepSeek Usage page.
Use the narrowest read-only administrative credential each provider supports. Do not reuse inference keys outside their intended provider.
Clone the repository:
git clone https://github.com/bestmark1/spender.git
cd spender
Open LLMSpendMonitor.xcodeproj in Xcode.
Select the LLMSpendMonitor scheme and My Mac destination.
Choose your Development Team in Signing & Capabilities.
Press Run.
To build and install a signed Release copy in /Applications/Spender.app:
./scripts/install-local.zsh
The installer builds from the current checkout, replaces only /Applications/Spender.app, verifies its code signature, and launches it. Enable Options → Settings → Launch at Login if desired.
./scripts/release.zsh produces the published DMG: it archives the Release
build, signs it with a Developer ID, has Apple notarize the app and the DMG,
staples both, checks them with Gatekeeper, signs the DMG for Sparkle and adds
it to site/appcast.xml. ./scripts/release.zsh appstore builds the
SpenderAppStore target — the same app without Sparkle, which the App Store
updates itself — for App Store Connect; add --upload to send it. It needs the
maintainer's certificates, stored notarization credentials and the Sparkle
signing key. Publishing the GitHub release and the appcast are separate steps.
The direct download updates itself through Sparkle:
it checks https://usespender.com/appcast.xml once a day and offers the update
in the panel rather than interrupting.
Run the unit test suite from the command line:
xcodebuild test \
-project LLMSpendMonitor.xcodeproj \
-scheme LLMSpendMonitor \
-destination 'platform=macOS' \
CODE_SIGNING_ALLOWED=NO
UI tests require macOS Accessibility permission for the Xcode test runner.
LLMSpendMonitor/
├── App/ app and menu bar lifecycle
├── Domain/ money, metrics, and provider snapshots
├── Features/ dashboard, connections, and customization state
├── Infrastructure/ networking, Keychain, and local persistence
├── Providers/ provider-specific API clients
├── Services/ refresh, aggregation, and notifications
└── UI/ SwiftUI menu bar interface
Provider API notes and contract validation material live in docs/research.