#[non_exhaustive]pub struct UsageApiResponse {
pub five_hour: Option<UsageBucket>,
pub seven_day: Option<UsageBucket>,
pub seven_day_opus: Option<UsageBucket>,
pub seven_day_sonnet: Option<UsageBucket>,
pub seven_day_oauth_apps: Option<UsageBucket>,
pub extra_usage: Option<ExtraUsage>,
pub unknown_buckets: HashMap<String, Value>,
}Expand description
Shape of the OAuth /api/oauth/usage endpoint response. Every
recognized bucket is Option because the endpoint omits (or emits
null for) buckets that don’t apply to the account’s tier, and
unknown_buckets captures codenamed / unreleased buckets Anthropic
may add without notice (omelette_*, iguana_*, cowork, etc.
observed live 2026-04-18). See docs/research/claude-data-files.md
§Raw data for the reference capture.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.five_hour: Option<UsageBucket>§seven_day: Option<UsageBucket>§seven_day_opus: Option<UsageBucket>§seven_day_sonnet: Option<UsageBucket>§seven_day_oauth_apps: Option<UsageBucket>§extra_usage: Option<ExtraUsage>§unknown_buckets: HashMap<String, Value>Forward-compat catch-all. Any top-level key not matched above lands here as raw JSON so we preserve what the endpoint sent even when we don’t yet know what to do with it.
Implementations§
Source§impl UsageApiResponse
impl UsageApiResponse
Sourcepub fn into_endpoint_usage(self) -> EndpointUsage
pub fn into_endpoint_usage(self) -> EndpointUsage
Convert the wire shape into the internal EndpointUsage.
Unknown buckets are preserved so plugin-facing mirrors can
surface them; the wire UsageApiResponse is not retained.
Trait Implementations§
Source§impl Clone for UsageApiResponse
impl Clone for UsageApiResponse
Source§fn clone(&self) -> UsageApiResponse
fn clone(&self) -> UsageApiResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more