pub struct PricingConfig {
pub input_cost_per_million: f64,
pub output_cost_per_million: f64,
pub cache_read_cost_per_million: Option<f64>,
pub cache_write_cost_per_million: Option<f64>,
pub reasoning_cost_per_million: Option<f64>,
pub audio_input_cost_per_million: Option<f64>,
pub audio_output_cost_per_million: Option<f64>,
pub server_tool_cost_per_call: BTreeMap<String, f64>,
}Expand description
Per-model token pricing. One rate per usage axis. Secondary rates are
Option<f64> so “absent” means fall back to the coarser bucket rather
than free — see crate::ModelInfo::cost for the fallback chain.
Field names use the canonical “input/output” vocabulary; legacy
“prompt/completion/cache_hit” names are accepted via serde aliases so
existing configs and the generated models/cloud.toml continue to load.
Fields§
§input_cost_per_million: f64Cost per million uncached input tokens in USD.
output_cost_per_million: f64Cost per million output tokens in USD.
cache_read_cost_per_million: Option<f64>Cost per million cache-read input tokens in USD.
None → falls back to input_cost_per_million.
cache_write_cost_per_million: Option<f64>Cost per million cache-write input tokens in USD (Anthropic charges
~1.25× of base input for this). None → falls back to
input_cost_per_million.
reasoning_cost_per_million: Option<f64>Cost per million reasoning output tokens in USD.
None → falls back to output_cost_per_million.
audio_input_cost_per_million: Option<f64>Cost per million audio input tokens in USD.
None → falls back to input_cost_per_million.
audio_output_cost_per_million: Option<f64>Cost per million audio output tokens in USD.
None → falls back to output_cost_per_million.
server_tool_cost_per_call: BTreeMap<String, f64>Per-call cost in USD for upstream-side tools like web search. Keyed by
tool name (must match the names crabllm reports in
crate::Usage::server_tool_calls).
Trait Implementations§
Source§impl Clone for PricingConfig
impl Clone for PricingConfig
Source§fn clone(&self) -> PricingConfig
fn clone(&self) -> PricingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more