Expand description
Anthropic plan-usage snapshot data shapes.
Type-only - the fetcher impls live in the forge-gateway backends. These are the wire shapes consumers see.
Serde derived so the workspace can persist the latest snapshot per
account to disk and rehydrate it at next boot - without the cache
the launchpad shows empty bars until the live /api/oauth/usage
probe lands, which Anthropic’s per-IP rate limiter can stall for
30 s+.
Re-exports§
use serde::Deserialize;🔒use serde::Deserialize;🔒use serde::Serialize;🔒use serde::Serialize;🔒
Modules§
- oauth
- Anthropic OAuth usage API response shapes.
- openrouter
- OpenRouter
/api/v1/keyand/api/v1/creditsresponse shapes. - zai
- Z.ai GLM coding plan monitor response shapes.
Structs§
- ApiSpend
- Per-key spend for a pay-per-token account, in USD.
- Extra
Usage - Bonus / overage credits view returned alongside the per-window utilization figures.
- Usage
Snapshot - Snapshot of the user’s Anthropic plan utilization at a point in time. Composed by the forge-gateway backends and rendered by a view.
- Usage
Window - One named usage window inside a snapshot (5-hour, 7-day, etc.).
The window’s identity (5-hour vs 7-day vs 7-day-opus) is implicit
in which
UsageSnapshotfield holds the value - no in-struct label.
Enums§
- Account
Budget - What an account has left, in the terms its backend bills in.
- Usage
Source Kind - Origin of a
UsageSnapshot, and with it which half of the snapshot carries data:OauthandZaiMonitorfill the windows,OpenRouterKeyfillsUsageSnapshot::spend.