pub struct Pricing { /* private fields */ }Expand description
Per-token pricing information (USD).
Implementations§
Source§impl Pricing
impl Pricing
Sourcepub const fn new(input_per_token: f64, output_per_token: f64) -> Self
pub const fn new(input_per_token: f64, output_per_token: f64) -> Self
Creates a new pricing entry.
Sourcepub const fn input_per_token(&self) -> f64
pub const fn input_per_token(&self) -> f64
Input cost per token.
Sourcepub const fn output_per_token(&self) -> f64
pub const fn output_per_token(&self) -> f64
Output cost per token.
Sourcepub const fn cache_read_per_token(&self) -> Option<f64>
pub const fn cache_read_per_token(&self) -> Option<f64>
Cache read cost per token, if applicable.
Sourcepub const fn cache_write_per_token(&self) -> Option<f64>
pub const fn cache_write_per_token(&self) -> Option<f64>
Cache write cost per token, if applicable.
Sourcepub const fn reasoning_per_token(&self) -> Option<f64>
pub const fn reasoning_per_token(&self) -> Option<f64>
Reasoning output cost per token, if applicable.
Sourcepub const fn image_per_token(&self) -> Option<f64>
pub const fn image_per_token(&self) -> Option<f64>
Image input cost per token, if applicable.
Sourcepub const fn with_cache_read(self, cost: f64) -> Self
pub const fn with_cache_read(self, cost: f64) -> Self
Sets cache read cost per token.
Sourcepub const fn with_cache_write(self, cost: f64) -> Self
pub const fn with_cache_write(self, cost: f64) -> Self
Sets cache write cost per token.
Sourcepub const fn with_reasoning(self, cost: f64) -> Self
pub const fn with_reasoning(self, cost: f64) -> Self
Sets reasoning output cost per token.
Sourcepub const fn with_image(self, cost: f64) -> Self
pub const fn with_image(self, cost: f64) -> Self
Sets image input cost per token.
Trait Implementations§
impl StructuralPartialEq for Pricing
Auto Trait Implementations§
impl Freeze for Pricing
impl RefUnwindSafe for Pricing
impl Send for Pricing
impl Sync for Pricing
impl Unpin for Pricing
impl UnsafeUnpin for Pricing
impl UnwindSafe for Pricing
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