Skip to main content

Module usage

Module usage 

Source
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/key and /api/v1/credits response shapes.
zai
Z.ai GLM coding plan monitor response shapes.

Structs§

ApiSpend
Per-key spend for a pay-per-token account, in USD.
ExtraUsage
Bonus / overage credits view returned alongside the per-window utilization figures.
UsageSnapshot
Snapshot of the user’s Anthropic plan utilization at a point in time. Composed by the forge-gateway backends and rendered by a view.
UsageWindow
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 UsageSnapshot field holds the value - no in-struct label.

Enums§

AccountBudget
What an account has left, in the terms its backend bills in.
UsageSourceKind
Origin of a UsageSnapshot, and with it which half of the snapshot carries data: Oauth and ZaiMonitor fill the windows, OpenRouterKey fills UsageSnapshot::spend.