pub struct Usage {
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_read_tokens: Option<u64>,
pub cache_write_tokens: Option<u64>,
pub cache_write_1h_tokens: Option<u64>,
}Fields§
§input_tokens: u64§output_tokens: u64§cache_read_tokens: Option<u64>Input tokens served from a provider-side prompt cache.
cache_write_tokens: Option<u64>Input tokens written into a provider-side prompt cache. Billed at a premium over an ordinary input token, so a harness that cannot see this under-reports cost on exactly the calls that populate the cache.
cache_write_1h_tokens: Option<u64>The subset of cache_write_tokens written at a longer-lived TTL, when
the provider reports the split. Absent means “all at the default TTL”.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Usage
impl<'de> Deserialize<'de> for Usage
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Usage
impl RefUnwindSafe for Usage
impl Send for Usage
impl Sync for Usage
impl Unpin for Usage
impl UnsafeUnpin for Usage
impl UnwindSafe for Usage
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