pub struct TokenUsage {
pub input_tokens: u32,
pub output_tokens: u32,
pub cached_input_tokens: Option<u32>,
pub reasoning_tokens: Option<u32>,
pub reported_cost: Option<ProviderReportedCost>,
}Expand description
Provider-reported token counts normalized across model APIs.
Fields§
§input_tokens: u32§output_tokens: u32§cached_input_tokens: Option<u32>Cached input tokens when the provider exposes this dimension.
reasoning_tokens: Option<u32>Reasoning/thinking tokens when the provider exposes this dimension.
reported_cost: Option<ProviderReportedCost>Provider-supplied monetary cost, only when the response includes a currency.
Trait Implementations§
Source§impl Clone for TokenUsage
impl Clone for TokenUsage
Auto Trait Implementations§
impl Freeze for TokenUsage
impl RefUnwindSafe for TokenUsage
impl Send for TokenUsage
impl Sync for TokenUsage
impl Unpin for TokenUsage
impl UnsafeUnpin for TokenUsage
impl UnwindSafe for TokenUsage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more