Skip to content

Add Neuralwatt balance and subscription quota checkers#184

Merged
mcowger merged 3 commits intomainfrom
claude/issue-169-20260416-1956
Apr 16, 2026
Merged

Add Neuralwatt balance and subscription quota checkers#184
mcowger merged 3 commits intomainfrom
claude/issue-169-20260416-1956

Conversation

@mcowger
Copy link
Copy Markdown
Owner

@mcowger mcowger commented Apr 16, 2026

Implements two quota checkers for the Neuralwatt API (/v1/quota endpoint):

  • neuralwatt: balance checker tracking credit balance (credits_remaining_usd)
  • neuralwatt-subscription: rate-limit checker tracking kWh subscription usage

Both use Bearer token auth against api.neuralwatt.com/v1/quota.
Includes frontend display components, config components, and integration
with all relevant frontend pages and cards.

Closes #169

Generated with Claude Code

Implements two quota checkers for the Neuralwatt API (/v1/quota endpoint):
- neuralwatt: balance checker tracking credit balance (credits_remaining_usd)
- neuralwatt-subscription: rate-limit checker tracking kWh subscription usage

Both checkers use Bearer token auth against api.neuralwatt.com/v1/quota.
Includes frontend display components, config components, and integration
with CompactBalancesCard, CompactQuotasCard, CombinedBalancesCard,
Quotas.tsx, and Providers.tsx.

Closes #169

Co-authored-by: Matt Cowger <mcowger@users.noreply.github.com>
@mcowger
Copy link
Copy Markdown
Owner Author

mcowger commented Apr 16, 2026

@claude I think we need to modify this to a single checker that populates both types so that a user doesn't have to double configure just to get both checker types.

@claude
Copy link
Copy Markdown

claude bot commented Apr 16, 2026

Claude finished @mcowger's task in 6m 8s —— View job


Consolidating Neuralwatt Checkers

  • Read existing checker implementations and understand architecture
  • Merge into a single checker that populates both quota types
  • Update factory registration
  • Update frontend components (config + display)
  • Update frontend pages and cards
  • Remove obsolete files
  • Commit and push changes

What changed

Merged the two separate neuralwatt and neuralwatt-subscription checkers into a single neuralwatt checker. Key changes:

Backendneuralwatt-checker.ts now makes one API call to /v1/quota and returns both windows:

  • subscription window (credit balance in dollars) — always returned when balance data is present
  • monthly window (kWh energy quota) — returned when subscription data is present

The checker has category = 'balance' so it appears in the Account Balances section, and the display component renders both balance and energy usage in one card.

Removed files:

  • neuralwatt-subscription-checker.ts
  • NeuralwattSubscriptionQuotaConfig.tsx
  • NeuralwattSubscriptionQuotaDisplay.tsx

Updated files:

  • quota-checker-factory.ts — removed neuralwatt-subscription registration
  • NeuralwattQuotaDisplay.tsx — now shows both credit balance and kWh energy quota with progress bar
  • CompactQuotasCard.tsx — removed dead neuralwatt-subscription category references
  • Providers.tsx — removed neuralwatt-subscription from checker type list and config rendering
  • Quotas.tsx — removed neuralwatt-subscription from display map and names
  • index.ts — removed subscription component exports

Users now configure just one neuralwatt checker with their API key and get both balance and subscription data from a single API call.

github-actions bot and others added 2 commits April 16, 2026 20:17
Merge the two separate Neuralwatt quota checkers (neuralwatt for
balance and neuralwatt-subscription for kWh usage) into a single
neuralwatt checker. This avoids requiring users to configure the
same API key twice.

The merged checker makes one API call and returns both the credit
balance window (subscription type) and the kWh energy window
(monthly type) when available. The frontend display now shows both
balance and subscription usage in one card.

Co-authored-by: Matt Cowger <mcowger@users.noreply.github.com>
- Add 'neuralwatt' to VALID_QUOTA_CHECKER_TYPES in backend config
- Add 'neuralwatt' to FALLBACK_QUOTA_CHECKER_TYPES in frontend api.ts
- Add 'neuralwatt' to quotaCheckerTypeEnum in Postgres schema
- Add NeuralwattQuotaCheckerOptionsSchema (endpoint only, apiKey auto-inherited)
- Add neuralwatt variant to ProviderQuotaCheckerSchema discriminated union
- Remove apiKey field from NeuralwattQuotaConfig (auto-inherited from provider)
- Fix NeuralwattQuotaDisplay to show both dollar balance and kWh energy quota
  following ApertisCodingPlanQuotaDisplay pattern for the rate-limit part
- Add BALANCE_CHECKERS_WITH_RATE_LIMIT set in Quotas.tsx and Sidebar.tsx
  so neuralwatt appears in both balance and rate-limit sections
- Add neuralwatt case to getTrackedWindowsForChecker in CompactQuotasCard
- Add AGENTS.md documenting the full quota checker integration checklist
  and the hybrid balance+rate-limit checker pattern
@mcowger mcowger merged commit d6414d6 into main Apr 16, 2026
1 check failed
@mcowger mcowger deleted the claude/issue-169-20260416-1956 branch April 16, 2026 20:47
github-actions bot added a commit that referenced this pull request Apr 17, 2026
* Add Neuralwatt balance and subscription quota checkers

Implements two quota checkers for the Neuralwatt API (/v1/quota endpoint):
- neuralwatt: balance checker tracking credit balance (credits_remaining_usd)
- neuralwatt-subscription: rate-limit checker tracking kWh subscription usage

Both checkers use Bearer token auth against api.neuralwatt.com/v1/quota.
Includes frontend display components, config components, and integration
with CompactBalancesCard, CompactQuotasCard, CombinedBalancesCard,
Quotas.tsx, and Providers.tsx.

Closes #169

Co-authored-by: Matt Cowger <mcowger@users.noreply.github.com>

* Consolidate Neuralwatt balance and subscription into single checker

Merge the two separate Neuralwatt quota checkers (neuralwatt for
balance and neuralwatt-subscription for kWh usage) into a single
neuralwatt checker. This avoids requiring users to configure the
same API key twice.

The merged checker makes one API call and returns both the credit
balance window (subscription type) and the kWh energy window
(monthly type) when available. The frontend display now shows both
balance and subscription usage in one card.

Co-authored-by: Matt Cowger <mcowger@users.noreply.github.com>

* feat: neuralwatt quota checker - fix type registrations & display

- Add 'neuralwatt' to VALID_QUOTA_CHECKER_TYPES in backend config
- Add 'neuralwatt' to FALLBACK_QUOTA_CHECKER_TYPES in frontend api.ts
- Add 'neuralwatt' to quotaCheckerTypeEnum in Postgres schema
- Add NeuralwattQuotaCheckerOptionsSchema (endpoint only, apiKey auto-inherited)
- Add neuralwatt variant to ProviderQuotaCheckerSchema discriminated union
- Remove apiKey field from NeuralwattQuotaConfig (auto-inherited from provider)
- Fix NeuralwattQuotaDisplay to show both dollar balance and kWh energy quota
  following ApertisCodingPlanQuotaDisplay pattern for the rate-limit part
- Add BALANCE_CHECKERS_WITH_RATE_LIMIT set in Quotas.tsx and Sidebar.tsx
  so neuralwatt appears in both balance and rate-limit sections
- Add neuralwatt case to getTrackedWindowsForChecker in CompactQuotasCard
- Add AGENTS.md documenting the full quota checker integration checklist
  and the hybrid balance+rate-limit checker pattern

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
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.

Add Neuralwatt balance checker

1 participant