Struct Model Pricing
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.
pub struct ModelPricing {
pub provider: String,
pub model_id: String,
pub aliases: Vec<String>,
pub currency: String,
pub unit: PricingUnit,
pub rates: Option<TokenPricingRates>,
pub rate_schedule: Option<TokenRateSchedule>,
pub prompt_cache: PromptCachePricing,
pub pricing_as_of: String,
pub pricing_source: String,
}
Per-token pricing for a model, expressed in USD per one million tokens.
Fields
provider: String
Provider that owns this pricing entry.
model_id: String
Canonical model ID for this pricing entry.
aliases: Vec<String>
Additional model IDs that should use this pricing.
currency: String
ISO 4217 currency for this pricing entry.
unit: PricingUnit
Billing unit represented by this pricing entry.
rates: Option<TokenPricingRates>
Token rates expressed as USD per one million tokens.
rate_schedule: Option<TokenRateSchedule>
Data-driven token rate schedule for threshold-based provider pricing.
prompt_cache: PromptCachePricing
Prompt-cache accounting model for this provider/model.
pricing_as_of: String
Date this pricing entry was last verified.
pricing_source: String
Source URL for this pricing entry.
Implementations
impl ModelPricing
impl ModelPricing
estimate_cost
pub fn estimate_cost(&self, usage: &Usage) -> Option<CostEstimate>
Estimates cost for the provided token usage.
Trait Implementations
impl Clone for ModelPricing
impl Clone for ModelPricing
clone
fn clone(&self) -> ModelPricing
clone_from
fn clone_from(&mut self, source: &Self)
impl Debug for ModelPricing
impl Debug for ModelPricing
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<'de> Deserialize<'de> for ModelPricing
impl<'de> Deserialize<'de> for ModelPricing
deserialize
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl PartialEq for ModelPricing
impl PartialEq for ModelPricing
eq
fn eq(&self, other: &ModelPricing) -> bool
ne
fn ne(&self, other: &Rhs) -> bool
impl Serialize for ModelPricing
impl Serialize for ModelPricing
serialize
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
impl StructuralPartialEq for ModelPricing
impl StructuralPartialEq for ModelPricing