Skip to content

Show expiry and days left for monthly API credits - #129

Merged
pbember merged 1 commit into
mainfrom
api-credit-expiry
Nov 13, 2026
Merged

pbember merged 1 commit into
mainfrom
api-credit-expiry

Conversation

@pbember

@pbember pbember commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

What changes for users

  • A credit set to Renews monthly now shows when it expires: Expires 2026-12-05 UTC · 22 days left. The expiry is the next renewal day.
  • If that date passes before the next fetch, Left shows Expired and the card asks you to fetch billing to count the new cycle.
  • Settings → API connections → Anthropic API explains how to enter plan credits: Max, Ultra and Team plan API credits arrive each billing cycle and expire at the end of it. Enter the monthly amount and the date it arrived, then select Renews monthly.

The snapshot balance gains an optional expiresAt (monthly only, day-aligned, after the capture time). Snapshots stay schema 1. Follows #128; ADR 0049 is amended.

Validation (cjbb, Linux)

  • pnpm typecheck: pass
  • pnpm test: 1035 passed, 10 skipped (new assertions for cycle boundaries, short months, year rollover, expiry parsing and the active and expired card states)
  • pnpm build: pass
  • A static render of the card showed the active and expired states

Not verified

  • A real Anthropic organization with plan credits, and the native macOS app.
  • Whether cost_report includes usage paid by plan credits.

🤖 Generated with Claude Code

A credit set to Renews monthly expires at its next renewal, as Anthropic's
Max, Ultra and Team plan API credits expire at the end of each billing
cycle. The snapshot stores that date; the card shows the expiry and days
left, and shows Expired if the date passes before the next fetch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cb08d8a9-b9e6-4cd9-a224-625c1f732300
Commits

Reviewing files that changed from the base of the PR and between c8f7135 and be59be2.

Files selected for processing: 11

  • CHANGELOG.md
  • docs/API_USAGE_BETA.md
  • docs/KB.md
  • docs/PRIVACY.md
  • docs/adr/0049-api-credit-total-used-left.md
  • src/domain/api-billing.ts
  • src/main/providers/api-billing.ts
  • src/renderer/api-billing-setup.tsx
  • src/renderer/app.tsx
  • tests/api-billing-balance.test.ts
  • tests/api-billing-setup.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pbember
pbember merged commit 2b0ddb7 into main Nov 13, 2026
11 checks passed
@pbember
pbember deleted the api-credit-expiry branch November 13, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant