pub struct ModelPricing {
pub prompt: Option<Decimal>,
pub completion: Option<Decimal>,
pub image: Option<Decimal>,
pub cache_read: Option<Decimal>,
pub cache_write: Option<Decimal>,
pub reference: Option<ReferencePricing>,
}Expand description
Pricing information for a model, including input/output token costs and caching discounts.
All costs are per-token in USD. Use TokenUsage::cost to compute the total
cost of a request from token counts and pricing.
Fields§
§prompt: Option<Decimal>Cost per input token (USD).
completion: Option<Decimal>Cost per output token (USD).
image: Option<Decimal>Cost per image generated (USD).
cache_read: Option<Decimal>Cost per cached input token read (USD).
cache_write: Option<Decimal>Cost per cache creation (write) input token (USD).
reference: Option<ReferencePricing>Published reference rates, which may differ from the provider’s charges.
Trait Implementations§
Source§impl Clone for ModelPricing
impl Clone for ModelPricing
Source§impl Debug for ModelPricing
impl Debug for ModelPricing
Auto Trait Implementations§
impl Forget for ModelPricing
impl Freeze for ModelPricing
impl Move for ModelPricing
impl RefUnwindSafe for ModelPricing
impl Send for ModelPricing
impl Sync for ModelPricing
impl Unpin for ModelPricing
impl UnsafeUnpin for ModelPricing
impl UnwindSafe for ModelPricing
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