#[non_exhaustive]pub struct ModelRates {
pub input: Option<f64>,
pub output: Option<f64>,
pub cache_read: Option<f64>,
pub cache_write: Option<f64>,
pub extra: Extra,
}Expand description
A model’s rates, in USD per million tokens.
The USD-per-million-token rates for that model, all four required. cacheWrite covers both
five-minute and one-hour cache writes.
Docs: modelPricing.overrides.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.input: Option<f64>The rate for input tokens.
- Values: USD per million tokens,
0to10000; all four rates are required - Default: unset
Docs: input.
output: Option<f64>The rate for output tokens.
- Values: USD per million tokens,
0to10000; all four rates are required - Default: unset
Docs: output.
cache_read: Option<f64>The rate for cache reads.
- Values: USD per million tokens,
0to10000; all four rates are required - Default: unset
Docs: cacheRead.
cache_write: Option<f64>The rate for cache writes, five-minute and one-hour alike.
- Values: USD per million tokens,
0to10000; all four rates are required - Default: unset
Docs: cacheWrite.
extra: ExtraKeys Claude Code accepts here that this crate doesn’t model (newer or undocumented ones), kept as written so the document round-trips.
Trait Implementations§
Source§impl Clone for ModelRates
impl Clone for ModelRates
Source§impl Debug for ModelRates
impl Debug for ModelRates
Source§impl Default for ModelRates
impl Default for ModelRates
Source§impl<'de> Deserialize<'de> for ModelRates
impl<'de> Deserialize<'de> for ModelRates
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
Source§impl PartialEq for ModelRates
impl PartialEq for ModelRates
Source§impl Serialize for ModelRates
impl Serialize for ModelRates
impl StructuralPartialEq for ModelRates
Auto Trait Implementations§
impl Forget for ModelRates
impl Freeze for ModelRates
impl Move for ModelRates
impl RefUnwindSafe for ModelRates
impl Send for ModelRates
impl Sync for ModelRates
impl Unpin for ModelRates
impl UnsafeUnpin for ModelRates
impl UnwindSafe for ModelRates
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