mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
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).
41 lines
1.3 KiB
TypeScript
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";
|