pub struct ModelPricing {
pub prompt: Option<String>,
pub completion: Option<String>,
pub input_cache_read: Option<String>,
pub input_cache_write: Option<String>,
}Expand description
Per-token pricing for a model. All values are per-token rates as strings
expressed in USD per token — e.g. "0.000005" = $5.00 per 1M tokens.
Deserialized from the pricing object in OpenAI-compatible /models
responses (Kilo Gateway, OpenRouter, etc.).
Fields§
§prompt: Option<String>Input/prompt tokens per-token rate (USD per token, e.g. "0.000005" = $5/1M tokens).
completion: Option<String>Output/completion tokens per-token rate (USD per token, e.g. "0.000020" = $20/1M tokens).
input_cache_read: Option<String>Cached input read rate — per-token charge for reading cached prompt data
(USD per token, e.g. "0.000001" = $1/1M tokens). Kilo Gateway specific.
input_cache_write: Option<String>Cached input write rate — per-token charge for writing prompt data to cache
(USD per token, e.g. "0.000001" = $1/1M tokens). Kilo Gateway specific.
Trait Implementations§
Source§impl Clone for ModelPricing
impl Clone for ModelPricing
Source§fn clone(&self) -> ModelPricing
fn clone(&self) -> ModelPricing
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelPricing
impl Debug for ModelPricing
Source§impl<'de> Deserialize<'de> for ModelPricing
impl<'de> Deserialize<'de> for ModelPricing
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
Auto Trait Implementations§
impl Freeze 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