#[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 ai_types::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 search
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.prompt: f64
Price per prompt token.
completion: f64
Price per completion token.
request: f64
Price per request.
image: f64
Price per image processed.
web_search: f64
Price per web search.
internal_reasoning: f64
Price for internal reasoning.
input_cache_read: f64
Price for reading from input cache.
input_cache_write: f64
Price for writing to input cache.
Trait Implementations§
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 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