Files
OmniRoute/src/shared/constants/pricing.ts
Diego Rodrigues de Sa e Souza 78f09c8d9f Release v3.8.41 (#5327)
Release v3.8.41 — 52 commits since v3.8.40 (19 CHANGELOG bullets, 11 contributors).

All gating CI green: Unit×8, Coverage×8, Vitest, Package Artifact, Quality Ratchet, CodeQL, Lint, Docs Sync (Strict), Node 24/26 compat, E2E×9, Integration, Electron smoke.

Advisory checks overridden (main unprotected): PR Test Policy = test-masking heuristic on the cumulative 52-commit assert delta (legitimate dead-code-sweep removals + consolidations, reviewed per-PR); SonarCloud/SonarQube = new-code maintainability/coverage quality gate (CodeQL/Semgrep/Security/npm-audit/Dependabot all clean — not a security finding).
2026-06-29 16:51:03 -03:00

41 lines
1.3 KiB
TypeScript

import { DEFAULT_PRICING } from "./pricing/default-pricing";
export { DEFAULT_PRICING } from "./pricing/default-pricing";
// Default pricing rates for AI models
// All rates are in dollars per million tokens ($/1M tokens)
// Based on user-provided pricing for Antigravity models and industry standards for others
// Shared pricing constants to reduce duplication
type ProviderPricingTable = Record<string, Record<string, unknown>>;
/**
* Get pricing for a specific provider and model
* @param {string} provider - Provider ID (e.g., "openai", "cc", "antigravity")
* @param {string} model - Model ID
* @returns {object|null} Pricing object or null if not found
*/
export function getPricingForModel(
provider: string,
model: string
): Record<string, unknown> | null {
if (!provider || !model) return null;
const providerPricing = (DEFAULT_PRICING as ProviderPricingTable)[provider];
if (!providerPricing) return null;
const modelPricing = providerPricing[model];
if (!modelPricing || typeof modelPricing !== "object") return null;
return modelPricing as Record<string, unknown>;
}
/**
* Get all pricing data
* @returns {object} All default pricing
*/
export function getDefaultPricing() {
return DEFAULT_PRICING;
}
export { formatCost } from "../utils/formatting";