pub struct AssistantUsage {
pub input_tokens: u32,
pub output_tokens: u32,
pub cache_creation_input_tokens: u32,
pub cache_read_input_tokens: u32,
pub service_tier: Option<String>,
pub cache_creation: Option<CacheCreationDetails>,
pub inference_geo: Option<String>,
pub speed: Option<String>,
pub fallback_credit: Option<Value>,
}Expand description
Usage information for assistant messages
Fields§
§input_tokens: u32Number of input tokens
output_tokens: u32Number of output tokens
cache_creation_input_tokens: u32Tokens used to create cache
cache_read_input_tokens: u32Tokens read from cache
service_tier: Option<String>Service tier used (e.g., “standard”)
cache_creation: Option<CacheCreationDetails>Detailed cache creation breakdown
inference_geo: Option<String>Inference geography (e.g., “not_available”)
speed: Option<String>Speed tier the request ran at ("standard" or "fast"). The API
began sending it on per-message usage around CLI 2.1.301.
fallback_credit: Option<Value>Outcome of a fallback-credit token the request presented; null on
the wire when it presented none (CLI 2.1.285+).
Trait Implementations§
Source§impl Clone for AssistantUsage
impl Clone for AssistantUsage
Source§impl Debug for AssistantUsage
impl Debug for AssistantUsage
Source§impl<'de> Deserialize<'de> for AssistantUsage
impl<'de> Deserialize<'de> for AssistantUsage
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 AssistantUsage
impl RefUnwindSafe for AssistantUsage
impl Send for AssistantUsage
impl Sync for AssistantUsage
impl Unpin for AssistantUsage
impl UnsafeUnpin for AssistantUsage
impl UnwindSafe for AssistantUsage
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