Summary
llm-providers should expose per-provider credit/balance visibility through its existing observability hooks surface. Currently AEGIS has no real billing data — SENTINEL alerts about negative credits are heuristic guesses with no ground truth.
Motivation
- AEGIS SENTINEL flagged "AI credit balance is negative (-50)" with no actual billing data backing it
- Each provider exposes usage/billing APIs that llm-providers already has credentials for
- This is a natural extension of the existing circuit breaker + observability hooks — not a new concept
Providers & APIs
| Provider |
Endpoint |
Notes |
| Anthropic |
GET /v1/usage |
Token counts by model |
| Groq |
Usage API |
Generous free tier |
| Workers AI |
CF API |
Free tier — usage metrics via CF dashboard API |
| Brave |
Response headers |
Monthly quota in X-RateLimit-Remaining |
Proposed Surface
getProviderBalance(provider?) — returns current credit/quota state per provider
- Wire into existing health/stats reporting so consumers (AEGIS, dashboards) can query balance without custom integrations
- Optionally emit low-balance warnings through the existing hook system
Acceptance Criteria
Summary
llm-providers should expose per-provider credit/balance visibility through its existing observability hooks surface. Currently AEGIS has no real billing data — SENTINEL alerts about negative credits are heuristic guesses with no ground truth.
Motivation
Providers & APIs
GET /v1/usageX-RateLimit-RemainingProposed Surface
getProviderBalance(provider?)— returns current credit/quota state per providerAcceptance Criteria