pub struct MdCost {
pub input: f64,
pub output: f64,
pub cache_read: Option<f64>,
pub cache_write: Option<f64>,
pub tiers: Option<Vec<MdCostTier>>,
pub context_over_200k: Option<MdCostTierData>,
pub reasoning: Option<f64>,
pub input_audio: Option<f64>,
pub output_audio: Option<f64>,
}Expand description
Pricing. All values are USD per million tokens.
Fields§
§input: f64Cost per million input tokens.
output: f64Cost per million output tokens.
cache_read: Option<f64>Cost per million cached read tokens, if billed separately.
cache_write: Option<f64>Cost per million cached write tokens, if billed separately.
tiers: Option<Vec<MdCostTier>>Tiered pricing (e.g. context-length-based tiers).
context_over_200k: Option<MdCostTierData>Context >200K pricing (Anthropic-specific extended pricing tier).
reasoning: Option<f64>Separate pricing for reasoning/thinking tokens.
input_audio: Option<f64>Audio modality input pricing.
output_audio: Option<f64>Audio modality output pricing.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MdCost
impl<'de> Deserialize<'de> for MdCost
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MdCost, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MdCost, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for MdCost
impl Serialize for MdCost
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for MdCost
impl RefUnwindSafe for MdCost
impl Send for MdCost
impl Sync for MdCost
impl Unpin for MdCost
impl UnsafeUnpin for MdCost
impl UnwindSafe for MdCost
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