pub struct ModelPricing {
pub name: &'static str,
pub input_per_mtoken: f64,
pub output_per_mtoken: f64,
pub cache_read_per_mtoken: Option<f64>,
pub cache_create_per_mtoken: Option<f64>,
pub last_verified: &'static str,
}Expand description
USD per 1M tokens. Small struct so adding a new model is one row.
Fields§
§name: &'static str§input_per_mtoken: f64§output_per_mtoken: f64§cache_read_per_mtoken: Option<f64>Set this when the provider charges a separate cache-read rate
(e.g. Anthropic). When None, cache-read tokens are billed at the
input rate.
cache_create_per_mtoken: Option<f64>Set this when the provider charges a separate cache-create rate.
When None, cache-create tokens are billed at the input rate.
last_verified: &'static strLast date a human verified this entry against the provider’s pricing page. Present for audit; not used at runtime.
Trait Implementations§
Source§impl Clone for ModelPricing
impl Clone for ModelPricing
Source§fn clone(&self) -> ModelPricing
fn clone(&self) -> ModelPricing
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 moreSource§impl Debug for ModelPricing
impl Debug for ModelPricing
impl Copy for ModelPricing
Auto Trait Implementations§
impl Freeze for ModelPricing
impl RefUnwindSafe for ModelPricing
impl Send for ModelPricing
impl Sync for ModelPricing
impl Unpin for ModelPricing
impl UnsafeUnpin for ModelPricing
impl UnwindSafe for ModelPricing
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<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