Swap canonical model from openrouter to models.dev (#6625)

This commit is contained in:
David Katz
2026-01-29 13:40:52 -05:00
committed by GitHub
parent 35de0a21db
commit e2a18c932a
15 changed files with 16730 additions and 5026 deletions
@@ -482,17 +482,17 @@ pub async fn get_pricing(
let mut pricing_data = Vec::new();
if let (Some(input_cost), Some(output_cost)) = (
canonical_model.pricing.prompt,
canonical_model.pricing.completion,
) {
if let (Some(input_cost), Some(output_cost)) =
(canonical_model.cost.input, canonical_model.cost.output)
{
pricing_data.push(PricingData {
provider: query.provider.clone(),
model: query.model.clone(),
input_token_cost: input_cost,
output_token_cost: output_cost,
// Canonical model costs are per million tokens, convert to per-token
input_token_cost: input_cost / 1_000_000.0,
output_token_cost: output_cost / 1_000_000.0,
currency: "$".to_string(),
context_length: Some(canonical_model.context_length as u32),
context_length: Some(canonical_model.limit.context as u32),
});
}