pub struct TokenRates {
pub input: u64,
pub output: u64,
pub cache_creation: u64,
pub cache_read: u64,
}Expand description
Token rates for a model in micro-cents per token.
Micro-cents are one-millionth of a cent (1/1,000,000 of a cent), or equivalently 1/100,000,000 of a dollar. To convert from Anthropic’s published pricing (dollars per million tokens) to micro-cents per token, multiply by 100:
$3/MTok × (100,000,000 micro-cents/$) ÷ 1,000,000 tokens = 300 micro-cents/tokenFields§
§input: u64Cost per input token in micro-cents.
output: u64Cost per output token in micro-cents.
cache_creation: u64Cost per cache creation token in micro-cents.
cache_read: u64Cost per cache read token in micro-cents.
Trait Implementations§
Source§impl Clone for TokenRates
impl Clone for TokenRates
Source§fn clone(&self) -> TokenRates
fn clone(&self) -> TokenRates
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TokenRates
Source§impl Debug for TokenRates
impl Debug for TokenRates
impl Eq for TokenRates
Source§impl PartialEq for TokenRates
impl PartialEq for TokenRates
Source§fn eq(&self, other: &TokenRates) -> bool
fn eq(&self, other: &TokenRates) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TokenRates
Auto Trait Implementations§
impl Freeze for TokenRates
impl RefUnwindSafe for TokenRates
impl Send for TokenRates
impl Sync for TokenRates
impl Unpin for TokenRates
impl UnsafeUnpin for TokenRates
impl UnwindSafe for TokenRates
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.