#[non_exhaustive]pub struct Pricing {
pub prompt: f64,
pub completion: f64,
pub request: f64,
pub image: f64,
pub web_search: f64,
pub internal_reasoning: f64,
pub input_cache_read: f64,
pub input_cache_write: f64,
}Expand description
Pricing information for a model’s various capabilities (unit: USD).
This struct contains detailed pricing information for different aspects of model usage. All prices are in USD and typically represent costs per unit (token, request, image, etc.).
§Examples
ⓘ
use aither::llm::model::Pricing;
let mut pricing = Pricing::default();
pricing.prompt = 0.01; // $0.01 per 1K prompt tokens
pricing.completion = 0.03; // $0.03 per 1K completion tokens
pricing.image = 0.25; // $0.25 per image
pricing.web_search = 0.005; // $0.005 per searchFields (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.prompt: f64Price per prompt token.
completion: f64Price per completion token.
request: f64Price per request.
image: f64Price per image processed.
web_search: f64Price per web search.
internal_reasoning: f64Price for internal reasoning.
input_cache_read: f64Price for reading from input cache.
input_cache_write: f64Price for writing to input cache.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pricing
impl<'de> Deserialize<'de> for Pricing
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 PartialOrd for Pricing
impl PartialOrd for Pricing
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