pub struct ModelPricing {
pub input_per_million: f64,
pub output_per_million: f64,
pub cached_input_per_million: Option<f64>,
pub cache_write_per_million: Option<f64>,
pub effective_at: DateTime<Utc>,
}Fields§
§input_per_million: f64USD per 1M input tokens.
output_per_million: f64USD per 1M output tokens.
cached_input_per_million: Option<f64>USD per 1M cached input tokens (Anthropic 10%, OpenAI 10%, Gemini 10%).
cache_write_per_million: Option<f64>USD per 1M cache-creation (cache-write) input tokens. Anthropic charges
~1.25× the base input rate for tokens written to the prompt cache.
None for providers with no documented write premium (cost path unchanged).
effective_at: DateTime<Utc>When this pricing took effect (for historical replay).
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
Source§impl<'de> Deserialize<'de> for ModelPricing
impl<'de> Deserialize<'de> for ModelPricing
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 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