pub struct RealUsage {
pub model: String,
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_read_tokens: u64,
pub cache_write_tokens: u64,
pub reasoning_tokens: u64,
}Expand description
One LLM turn’s real, provider-reported usage, normalized to billable buckets.
output_tokens already includes reasoning/thinking tokens (they are billed at
the output rate); reasoning_tokens is retained only for display.
Fields§
§model: String§input_tokens: u64Input tokens billed at the input rate (cache reads/writes excluded).
output_tokens: u64Output tokens billed at the output rate (includes reasoning/thoughts).
cache_read_tokens: u64Input tokens served from the prompt cache (billed at the cache-read rate).
cache_write_tokens: u64Input tokens written to the prompt cache (Anthropic only; 0 elsewhere).
reasoning_tokens: u64Reasoning/thinking subset of output_tokens (display only).
Trait Implementations§
impl StructuralPartialEq for RealUsage
Auto Trait Implementations§
impl Freeze for RealUsage
impl RefUnwindSafe for RealUsage
impl Send for RealUsage
impl Sync for RealUsage
impl Unpin for RealUsage
impl UnsafeUnpin for RealUsage
impl UnwindSafe for RealUsage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more