#[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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UsageApiResponse
impl Debug for UsageApiResponse
Source§impl<'de> Deserialize<'de> for UsageApiResponse
impl<'de> Deserialize<'de> for UsageApiResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CachedData> for UsageApiResponse
impl From<CachedData> for UsageApiResponse
Source§fn from(c: CachedData) -> Self
fn from(c: CachedData) -> Self
Source§impl From<UsageApiResponse> for CachedData
impl From<UsageApiResponse> for CachedData
Source§fn from(r: UsageApiResponse) -> Self
fn from(r: UsageApiResponse) -> Self
Source§impl PartialEq for UsageApiResponse
impl PartialEq for UsageApiResponse
Source§fn eq(&self, other: &UsageApiResponse) -> bool
fn eq(&self, other: &UsageApiResponse) -> bool
self and other values to be equal, and is used by ==.