feat: extract and centralize cost maps (#1691)

This commit is contained in:
Daniel Salazar
2025-10-06 14:52:09 -07:00
committed by GitHub
parent 44fcb5800b
commit f06bec4cd4
19 changed files with 1200 additions and 4056 deletions
+4 -2
View File
@@ -43,7 +43,9 @@ interface Extension extends RouterMethods {
declare global {
// Declare the extension variable
const extension: Extension;
const config: { [k: string | number | symbol]: unknown };
const config: Record<string | number | symbol, unknown>;
const global_config: Record<string | number | symbol, unknown>;
}
export {};
export { };
+3 -4051
View File
File diff suppressed because it is too large Load Diff
@@ -37,7 +37,7 @@ export class MeteringAndBillingService {
}
const currentMonth = this.#getMonthYearString();
return this.#superUserService.sudo(async () => {
const totalCost = costOverride ?? USAGE_TYPE_MAPS[usageType] * usageAmount; // TODO DS: apply our policy discounts here eventually
const totalCost = (costOverride ?? USAGE_TYPE_MAPS[usageType] * usageAmount) || 0; // TODO DS: apply our policy discounts here eventually
const appId = actor.type?.app?.uid || GLOBAL_APP_KEY;
const actorId = actor.type?.user.uuid;
const pathAndAmountMap = {
@@ -74,6 +74,16 @@ export class MeteringAndBillingService {
[`${appId}.count`]: 1,
},
});
const puterConsumptionKey = `${METRICS_PREFIX}:puter:${currentMonth}`; // global consumption across all users and apps
this.#kvClientWrapper.incr({
key: puterConsumptionKey,
pathAndAmountMap: {
'total': totalCost,
[`${usageType}.units`]: usageAmount,
[`${usageType}.cost`]: totalCost,
[`${usageType}.count`]: 1,
},
});
return (await Promise.all([lastUpdatedPromise, actorUsagesPromise]))[1];
});
// TODO DS: this should increment the cost for the given type of operation, and the total cost for daily, weekly and monthly usage
@@ -71,7 +71,7 @@ export class MeteringAndBillingService {
const currentMonth = this.#getMonthYearString();
return this.#superUserService.sudo(async () => {
const totalCost = costOverride ?? USAGE_TYPE_MAPS[usageType] * usageAmount; // TODO DS: apply our policy discounts here eventually
const totalCost = (costOverride ?? USAGE_TYPE_MAPS[usageType] * usageAmount) || 0; // TODO DS: apply our policy discounts here eventually
const appId = actor.type?.app?.uid || GLOBAL_APP_KEY
const actorId = actor.type?.user.uuid
const pathAndAmountMap = {
@@ -111,9 +111,19 @@ export class MeteringAndBillingService {
pathAndAmountMap: {
[`${appId}.total`]: totalCost,
[`${appId}.count`]: 1,
},
})
const puterConsumptionKey = `${METRICS_PREFIX}:puter:${currentMonth}`; // global consumption across all users and apps
this.#kvClientWrapper.incr({
key: puterConsumptionKey,
pathAndAmountMap: {
'total': totalCost,
[`${usageType}.units`]: usageAmount,
[`${usageType}.cost`]: totalCost,
[`${usageType}.count`]: 1,
}
})
return (await Promise.all([lastUpdatedPromise, actorUsagesPromise]))[1] as UsageByType;
})
// TODO DS: this should increment the cost for the given type of operation, and the total cost for daily, weekly and monthly usage
@@ -0,0 +1,24 @@
// AWS Polly Cost Map (character-based pricing for text-to-speech)
//
// This map defines per-character pricing (in microcents) for AWS Polly TTS engines.
// Pricing is based on the ENGINE_PRICING object from AWSPollyService.js.
// Each entry is the cost per character for the specified engine.
//
// Pattern: "aws-polly:{engine}:character"
// Example: "aws-polly:standard:character" → 400 microcents per character
//
// Note: This is per-character pricing for TTS engines, not token-based.
export const AWS_POLLY_COST_MAP = {
// Standard engine: $4.00 per 1M characters (400 microcents per character)
"aws-polly:standard:character": 400,
// Neural engine: $16.00 per 1M characters (1600 microcents per character)
"aws-polly:neural:character": 1600,
// Long-form engine: $100.00 per 1M characters (10000 microcents per character)
"aws-polly:long-form:character": 10000,
// Generative engine: $30.00 per 1M characters (3000 microcents per character)
"aws-polly:generative:character": 3000,
};
@@ -0,0 +1,15 @@
// AWS Textract Cost Map (page-based pricing for OCR)
//
// This map defines per-page pricing (in microcents) for AWS Textract OCR API.
// Pricing is based on the Detect Document Text API: $1.50 per 1,000 pages.
// Each entry is the cost per page for the specified API.
//
// Pattern: "aws-textract:{api}:page"
// Example: "aws-textract:detect-document-text:page" → 150 microcents per page
//
// Note: 1,000,000 microcents = $0.01 USD. $1.50 per 1,000 pages = 150 microcents per page.
//
export const AWS_TEXTRACT_COST_MAP = {
// Detect Document Text API: $1.50 per 1,000 pages (150 microcents per page)
"aws-textract:detect-document-text:page": 150,
};
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const CLAUDE_COST_MAP = {
// Claude Sonnet 4.5
"claude:claude-sonnet-4-5-20250929:input": 300,
"claude:claude-sonnet-4-5-20250929:output": 1500,
// Claude Opus 4.1
"claude:claude-opus-4-1-20250805:input": 1500,
"claude:claude-opus-4-1-20250805:output": 7500,
// Claude Opus 4
"claude:claude-opus-4-20250514:input": 1500,
"claude:claude-opus-4-20250514:output": 7500,
// Claude Sonnet 4
"claude:claude-sonnet-4-20250514:input": 300,
"claude:claude-sonnet-4-20250514:output": 1500,
// Claude 3.7 Sonnet
"claude:claude-3-7-sonnet-20250219:input": 300,
"claude:claude-3-7-sonnet-20250219:output": 1500,
// Claude 3.5 Sonnet (Oct 2024)
"claude:claude-3-5-sonnet-20241022:input": 300,
"claude:claude-3-5-sonnet-20241022:output": 1500,
// Claude 3.5 Sonnet (June 2024)
"claude:claude-3-5-sonnet-20240620:input": 300,
"claude:claude-3-5-sonnet-20240620:output": 1500,
// Claude 3 Haiku
"claude:claude-3-haiku-20240307:input": 25,
"claude:claude-3-haiku-20240307:output": 125,
};
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const DEEPSEEK_COST_MAP = {
// DeepSeek Chat
"deepseek:deepseek-chat:input": 56,
"deepseek:deepseek-chat:output": 168,
// DeepSeek Reasoner
"deepseek:deepseek-reasoner:input": 56,
"deepseek:deepseek-reasoner:output": 168,
};
@@ -0,0 +1,17 @@
// TODO DS: these should be loaded from config or db eventually
/**
* flat cost map based on usage types, numbers are in microcents (1/1 millionth of a cent)
* E.g. 1000000 microcents = 1 cent
* most services measure their prices in 1 million requests or tokens or whatever, so if that's the case you can simply use the cent val
* $0.63 per 1M reads = 63 microcents per read
* $1.25 per 1M writes = 125 microcents per write
*/
export const GEMINI_COST_MAP = {
// Gemini api usage types (costs per token in microcents)
"gemini:gemini-2.0-flash:input": 10,
"gemini:gemini-2.0-flash:output": 40,
"gemini:gemini-1.5-flash:input": 7.5,
"gemini:gemini-1.5-flash:output": 30,
'gemini-2.5-flash-image-preview1024x1024': 3_900_000
}
@@ -0,0 +1,70 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const GROQ_COST_MAP = {
// Gemma models
"groq:gemma2-9b-it:input": 20,
"groq:gemma2-9b-it:output": 20,
"groq:gemma-7b-it:input": 7,
"groq:gemma-7b-it:output": 7,
// Llama 3 Groq Tool Use Preview
"groq:llama3-groq-70b-8192-tool-use-preview:input": 89,
"groq:llama3-groq-70b-8192-tool-use-preview:output": 89,
"groq:llama3-groq-8b-8192-tool-use-preview:input": 19,
"groq:llama3-groq-8b-8192-tool-use-preview:output": 19,
// Llama 3.1
"groq:llama-3.1-70b-versatile:input": 59,
"groq:llama-3.1-70b-versatile:output": 79,
"groq:llama-3.1-70b-specdec:input": 59,
"groq:llama-3.1-70b-specdec:output": 99,
"groq:llama-3.1-8b-instant:input": 5,
"groq:llama-3.1-8b-instant:output": 8,
// Llama Guard
"groq:meta-llama/llama-guard-4-12b:input": 20,
"groq:meta-llama/llama-guard-4-12b:output": 20,
"groq:llama-guard-3-8b:input": 20,
"groq:llama-guard-3-8b:output": 20,
// Prompt Guard
"groq:meta-llama/llama-prompt-guard-2-86m:input": 4,
"groq:meta-llama/llama-prompt-guard-2-86m:output": 4,
// Llama 3.2 Preview
"groq:llama-3.2-1b-preview:input": 4,
"groq:llama-3.2-1b-preview:output": 4,
"groq:llama-3.2-3b-preview:input": 6,
"groq:llama-3.2-3b-preview:output": 6,
"groq:llama-3.2-11b-vision-preview:input": 18,
"groq:llama-3.2-11b-vision-preview:output": 18,
"groq:llama-3.2-90b-vision-preview:input": 90,
"groq:llama-3.2-90b-vision-preview:output": 90,
// Llama 3 8k/70B
"groq:llama3-70b-8192:input": 59,
"groq:llama3-70b-8192:output": 79,
"groq:llama3-8b-8192:input": 5,
"groq:llama3-8b-8192:output": 8,
// Mixtral
"groq:mixtral-8x7b-32768:input": 24,
"groq:mixtral-8x7b-32768:output": 24,
};
@@ -0,0 +1,27 @@
import { AWS_POLLY_COST_MAP } from "./awsPollyCostMap";
import { AWS_TEXTRACT_COST_MAP } from "./awsTextractCostMap";
import { CLAUDE_COST_MAP } from "./claudeCostMap";
import { DEEPSEEK_COST_MAP } from "./deepSeekCostMap";
import { GROQ_COST_MAP } from "./groqCostMap";
import { KV_COST_MAP } from "./kvCostMap";
import { MISTRAL_COST_MAP } from "./mistralCostMap";
import { OPENAI_COST_MAP } from "./openAiCostMap";
import { OPENAI_IMAGE_COST_MAP } from "./openaiImageCostMap";
import { OPENROUTER_COST_MAP } from "./openrouterCostMap";
import { TOGETHER_COST_MAP } from "./togetherCostMap";
import { XAI_COST_MAP } from "./xaiCostMap";
export const COST_MAPS = {
...OPENAI_COST_MAP,
...KV_COST_MAP,
...OPENROUTER_COST_MAP,
...MISTRAL_COST_MAP,
...GROQ_COST_MAP,
...OPENAI_IMAGE_COST_MAP,
...XAI_COST_MAP,
...DEEPSEEK_COST_MAP,
...TOGETHER_COST_MAP,
...CLAUDE_COST_MAP,
...AWS_POLLY_COST_MAP,
...AWS_TEXTRACT_COST_MAP
}
@@ -0,0 +1,5 @@
export const KV_COST_MAP = {
// Map with unit to cost measurements in microcent
'kv:read': 63,
'kv:write': 125,
}
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const MISTRAL_COST_MAP = {
// Mistral models (values in microcents/token, from MistralAIService.js)
"mistral:mistral-large-latest:input": 200,
"mistral:mistral-large-latest:output": 600,
"mistral:pixtral-large-latest:input": 200,
"mistral:pixtral-large-latest:output": 600,
"mistral:mistral-small-latest:input": 20,
"mistral:mistral-small-latest:output": 60,
"mistral:codestral-latest:input": 30,
"mistral:codestral-latest:output": 90,
"mistral:ministral-8b-latest:input": 10,
"mistral:ministral-8b-latest:output": 10,
"mistral:ministral-3b-latest:input": 4,
"mistral:ministral-3b-latest:output": 4,
"mistral:pixtral-12b:input": 15,
"mistral:pixtral-12b:output": 15,
"mistral:mistral-nemo:input": 15,
"mistral:mistral-nemo:output": 15,
"mistral:open-mistral-7b:input": 25,
"mistral:open-mistral-7b:output": 25,
"mistral:open-mixtral-8x7b:input": 7,
"mistral:open-mixtral-8x7b:output": 7,
"mistral:open-mixtral-8x22b:input": 2,
"mistral:open-mixtral-8x22b:output": 6,
"mistral:magistral-medium-latest:input": 200,
"mistral:magistral-medium-latest:output": 500,
"mistral:magistral-small-latest:input": 10,
"mistral:magistral-small-latest:output": 10,
"mistral:mistral-medium-latest:input": 40,
"mistral:mistral-medium-latest:output": 200,
"mistral:mistral-moderation-latest:input": 10,
"mistral:mistral-moderation-latest:output": 10,
"mistral:devstral-small-latest:input": 10,
"mistral:devstral-small-latest:output": 10,
"mistral:mistral-saba-latest:input": 20,
"mistral:mistral-saba-latest:output": 60,
"mistral:open-mistral-nemo:input": 10,
"mistral:open-mistral-nemo:output": 10,
"mistral:mistral-ocr-latest:input": 100,
"mistral:mistral-ocr-latest:output": 300,
};
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const OPENAI_COST_MAP = {
// GPT-5 models
"openai:gpt-5-2025-08-07:input": 125,
"openai:gpt-5-2025-08-07:output": 1000,
"openai:gpt-5-mini-2025-08-07:input": 25,
"openai:gpt-5-mini-2025-08-07:output": 200,
"openai:gpt-5-nano-2025-08-07:input": 5,
"openai:gpt-5-nano-2025-08-07:output": 40,
"openai:gpt-5-chat-latest:input": 125,
"openai:gpt-5-chat-latest:output": 1000,
// GPT-4o models
"openai:gpt-4o:input": 250,
"openai:gpt-4o:output": 1000,
"openai:gpt-4o-mini:input": 15,
"openai:gpt-4o-mini:output": 60,
// O1 models
"openai:o1:input": 1500,
"openai:o1:output": 6000,
"openai:o1-mini:input": 300,
"openai:o1-mini:output": 1200,
"openai:o1-pro:input": 15000,
"openai:o1-pro:output": 60000,
// O3 models
"openai:o3:input": 1000,
"openai:o3:output": 4000,
"openai:o3-mini:input": 110,
"openai:o3-mini:output": 440,
// O4 models
"openai:o4-mini:input": 110,
"openai:o4-mini:output": 440,
// GPT-4.1 models
"openai:gpt-4.1:input": 200,
"openai:gpt-4.1:output": 800,
"openai:gpt-4.1-mini:input": 40,
"openai:gpt-4.1-mini:output": 160,
"openai:gpt-4.1-nano:input": 10,
"openai:gpt-4.1-nano:output": 40,
// GPT-4.5 preview
"openai:gpt-4.5-preview:input": 7500,
"openai:gpt-4.5-preview:output": 15000,
};
@@ -0,0 +1,22 @@
// OpenAI Image Generation Cost Map (microcents per image)
// Pricing for DALL-E 2 and DALL-E 3 models based on image dimensions.
// All costs are in microcents (1/1,000,000th of a cent). Example: 1,000,000 microcents = $0.01 USD.
//
// Source: [`TrackSpendingService.js`](../../../../TrackSpendingService.js) ImageGenerationStrategy static models
//
// Naming pattern: "openai:{model}:{size}" or "openai:{model}:hd:{size}" for HD images
export const OPENAI_IMAGE_COST_MAP = {
// DALL-E 3
"openai:dall-e-3:1024x1024": 40000, // $0.04
"openai:dall-e-3:1024x1792": 80000, // $0.08
"openai:dall-e-3:1792x1024": 80000, // $0.08
"openai:dall-e-3:hd:1024x1024": 80000, // $0.08
"openai:dall-e-3:hd:1024x1792": 120000, // $0.12
"openai:dall-e-3:hd:1792x1024": 120000, // $0.12
// DALL-E 2
"openai:dall-e-2:1024x1024": 20000, // $0.02
"openai:dall-e-2:512x512": 18000, // $0.018
"openai:dall-e-2:256x256": 16000, // $0.016
};
@@ -0,0 +1,669 @@
export const OPENROUTER_COST_MAP = {
"openrouter:meituan/longcat-flash-chatprompt": 15,
"openrouter:meituan/longcat-flash-chatcompletion": 75,
"openrouter:nvidia/nemotron-nano-9b-v2prompt": 4,
"openrouter:nvidia/nemotron-nano-9b-v2completion": 16,
"openrouter:qwen/qwen3-maxprompt": 120,
"openrouter:qwen/qwen3-maxcompletion": 600,
"openrouter:qwen/qwen3-maxinput_cache_read": 24,
"openrouter:moonshotai/kimi-k2-0905prompt": 38,
"openrouter:moonshotai/kimi-k2-0905completion": 152,
"openrouter:bytedance/seed-oss-36b-instructprompt": 10,
"openrouter:bytedance/seed-oss-36b-instructcompletion": 41,
"openrouter:deepcogito/cogito-v2-preview-llama-109b-moeprompt": 18,
"openrouter:deepcogito/cogito-v2-preview-llama-109b-moecompletion": 59,
"openrouter:deepcogito/cogito-v2-preview-deepseek-671bprompt": 125,
"openrouter:deepcogito/cogito-v2-preview-deepseek-671bcompletion": 125,
"openrouter:stepfun-ai/step3prompt": 57,
"openrouter:stepfun-ai/step3completion": 142,
"openrouter:qwen/qwen3-30b-a3b-thinking-2507prompt": 9,
"openrouter:qwen/qwen3-30b-a3b-thinking-2507completion": 36,
"openrouter:x-ai/grok-code-fast-1prompt": 20,
"openrouter:x-ai/grok-code-fast-1completion": 150,
"openrouter:x-ai/grok-code-fast-1input_cache_read": 2,
"openrouter:nousresearch/hermes-4-70bprompt": 13,
"openrouter:nousresearch/hermes-4-70bcompletion": 51,
"openrouter:nousresearch/hermes-4-405bprompt": 25,
"openrouter:nousresearch/hermes-4-405bcompletion": 100,
"openrouter:google/gemini-2.5-flash-image-previewprompt": 30,
"openrouter:google/gemini-2.5-flash-image-previewcompletion": 250,
"openrouter:google/gemini-2.5-flash-image-previewimage": 123800,
"openrouter:deepseek/deepseek-chat-v3.1prompt": 25,
"openrouter:deepseek/deepseek-chat-v3.1completion": 100,
"openrouter:deepseek/deepseek-v3.1-baseprompt": 25,
"openrouter:deepseek/deepseek-v3.1-basecompletion": 100,
"openrouter:openai/gpt-4o-audio-previewprompt": 250,
"openrouter:openai/gpt-4o-audio-previewcompletion": 1000,
"openrouter:openai/gpt-4o-audio-previewaudio": 4000,
"openrouter:mistralai/mistral-medium-3.1prompt": 40,
"openrouter:mistralai/mistral-medium-3.1completion": 200,
"openrouter:baidu/ernie-4.5-21b-a3bprompt": 7,
"openrouter:baidu/ernie-4.5-21b-a3bcompletion": 28,
"openrouter:baidu/ernie-4.5-vl-28b-a3bprompt": 14,
"openrouter:baidu/ernie-4.5-vl-28b-a3bcompletion": 56,
"openrouter:z-ai/glm-4.5vprompt": 50,
"openrouter:z-ai/glm-4.5vcompletion": 180,
"openrouter:ai21/jamba-mini-1.7prompt": 20,
"openrouter:ai21/jamba-mini-1.7completion": 40,
"openrouter:ai21/jamba-large-1.7prompt": 200,
"openrouter:ai21/jamba-large-1.7completion": 800,
"openrouter:openai/gpt-5-chatprompt": 125,
"openrouter:openai/gpt-5-chatcompletion": 1000,
"openrouter:openai/gpt-5-chatinput_cache_read": 12,
"openrouter:openai/gpt-5prompt": 125,
"openrouter:openai/gpt-5completion": 1000,
"openrouter:openai/gpt-5input_cache_read": 12,
"openrouter:openai/gpt-5-miniprompt": 25,
"openrouter:openai/gpt-5-minicompletion": 200,
"openrouter:openai/gpt-5-miniinput_cache_read": 3,
"openrouter:openai/gpt-5-nanoprompt": 5,
"openrouter:openai/gpt-5-nanocompletion": 40,
"openrouter:openai/gpt-5-nanoweb_search": 1000000,
"openrouter:openai/gpt-5-nanoinput_cache_read": 1,
"openrouter:openai/gpt-oss-120bprompt": 7,
"openrouter:openai/gpt-oss-120bcompletion": 28,
"openrouter:openai/gpt-oss-20bprompt": 4,
"openrouter:openai/gpt-oss-20bcompletion": 15,
"openrouter:anthropic/claude-opus-4.1prompt": 1500,
"openrouter:anthropic/claude-opus-4.1completion": 7500,
"openrouter:anthropic/claude-opus-4.1image": 2400000,
"openrouter:anthropic/claude-opus-4.1web_search": 1000000,
"openrouter:anthropic/claude-opus-4.1input_cache_read": 150,
"openrouter:anthropic/claude-opus-4.1input_cache_write": 1875,
"openrouter:mistralai/codestral-2508prompt": 30,
"openrouter:mistralai/codestral-2508completion": 90,
"openrouter:qwen/qwen3-coder-30b-a3b-instructprompt": 7,
"openrouter:qwen/qwen3-coder-30b-a3b-instructcompletion": 28,
"openrouter:qwen/qwen3-30b-a3b-instruct-2507prompt": 7,
"openrouter:qwen/qwen3-30b-a3b-instruct-2507completion": 28,
"openrouter:z-ai/glm-4.5prompt": 41,
"openrouter:z-ai/glm-4.5completion": 165,
"openrouter:z-ai/glm-4.5-airprompt": 14,
"openrouter:z-ai/glm-4.5-aircompletion": 86,
"openrouter:qwen/qwen3-235b-a22b-thinking-2507prompt": 10,
"openrouter:qwen/qwen3-235b-a22b-thinking-2507completion": 39,
"openrouter:z-ai/glm-4-32bprompt": 10,
"openrouter:z-ai/glm-4-32bcompletion": 10,
"openrouter:qwen/qwen3-coderprompt": 25,
"openrouter:qwen/qwen3-codercompletion": 100,
"openrouter:bytedance/ui-tars-1.5-7bprompt": 10,
"openrouter:bytedance/ui-tars-1.5-7bcompletion": 20,
"openrouter:google/gemini-2.5-flash-liteprompt": 10,
"openrouter:google/gemini-2.5-flash-litecompletion": 40,
"openrouter:google/gemini-2.5-flash-liteinput_cache_read": 3,
"openrouter:google/gemini-2.5-flash-liteinput_cache_write": 18,
"openrouter:qwen/qwen3-235b-a22b-2507prompt": 10,
"openrouter:qwen/qwen3-235b-a22b-2507completion": 39,
"openrouter:switchpoint/routerprompt": 85,
"openrouter:switchpoint/routercompletion": 340,
"openrouter:moonshotai/kimi-k2prompt": 14,
"openrouter:moonshotai/kimi-k2completion": 249,
"openrouter:thudm/glm-4.1v-9b-thinkingprompt": 4,
"openrouter:thudm/glm-4.1v-9b-thinkingcompletion": 14,
"openrouter:mistralai/devstral-mediumprompt": 40,
"openrouter:mistralai/devstral-mediumcompletion": 200,
"openrouter:mistralai/devstral-smallprompt": 7,
"openrouter:mistralai/devstral-smallcompletion": 28,
"openrouter:x-ai/grok-4prompt": 300,
"openrouter:x-ai/grok-4completion": 1500,
"openrouter:x-ai/grok-4input_cache_read": 75,
"openrouter:tencent/hunyuan-a13b-instructprompt": 3,
"openrouter:tencent/hunyuan-a13b-instructcompletion": 3,
"openrouter:morph/morph-v3-largeprompt": 90,
"openrouter:morph/morph-v3-largecompletion": 190,
"openrouter:morph/morph-v3-fastprompt": 90,
"openrouter:morph/morph-v3-fastcompletion": 190,
"openrouter:baidu/ernie-4.5-vl-424b-a47bprompt": 42,
"openrouter:baidu/ernie-4.5-vl-424b-a47bcompletion": 125,
"openrouter:baidu/ernie-4.5-300b-a47bprompt": 28,
"openrouter:baidu/ernie-4.5-300b-a47bcompletion": 110,
"openrouter:thedrummer/anubis-70b-v1.1prompt": 40,
"openrouter:thedrummer/anubis-70b-v1.1completion": 70,
"openrouter:inception/mercuryprompt": 25,
"openrouter:inception/mercurycompletion": 100,
"openrouter:mistralai/mistral-small-3.2-24b-instructprompt": 5,
"openrouter:mistralai/mistral-small-3.2-24b-instructcompletion": 10,
"openrouter:minimax/minimax-m1prompt": 30,
"openrouter:minimax/minimax-m1completion": 165,
"openrouter:google/gemini-2.5-flash-lite-preview-06-17prompt": 10,
"openrouter:google/gemini-2.5-flash-lite-preview-06-17completion": 40,
"openrouter:google/gemini-2.5-flash-lite-preview-06-17input_cache_read": 3,
"openrouter:google/gemini-2.5-flash-lite-preview-06-17input_cache_write": 18,
"openrouter:google/gemini-2.5-flashprompt": 30,
"openrouter:google/gemini-2.5-flashcompletion": 250,
"openrouter:google/gemini-2.5-flashimage": 123800,
"openrouter:google/gemini-2.5-flashinput_cache_read": 7,
"openrouter:google/gemini-2.5-flashinput_cache_write": 38,
"openrouter:google/gemini-2.5-proprompt": 125,
"openrouter:google/gemini-2.5-procompletion": 1000,
"openrouter:google/gemini-2.5-proimage": 516000,
"openrouter:google/gemini-2.5-proinput_cache_read": 31,
"openrouter:google/gemini-2.5-proinput_cache_write": 163,
"openrouter:moonshotai/kimi-dev-72bprompt": 29,
"openrouter:moonshotai/kimi-dev-72bcompletion": 115,
"openrouter:openai/o3-proprompt": 2000,
"openrouter:openai/o3-procompletion": 8000,
"openrouter:openai/o3-proimage": 1530000,
"openrouter:x-ai/grok-3-miniprompt": 30,
"openrouter:x-ai/grok-3-minicompletion": 50,
"openrouter:x-ai/grok-3-miniinput_cache_read": 7,
"openrouter:x-ai/grok-3prompt": 300,
"openrouter:x-ai/grok-3completion": 1500,
"openrouter:x-ai/grok-3input_cache_read": 75,
"openrouter:mistralai/magistral-small-2506prompt": 50,
"openrouter:mistralai/magistral-small-2506completion": 150,
"openrouter:mistralai/magistral-medium-2506prompt": 200,
"openrouter:mistralai/magistral-medium-2506completion": 500,
"openrouter:mistralai/magistral-medium-2506:thinkingprompt": 200,
"openrouter:mistralai/magistral-medium-2506:thinkingcompletion": 500,
"openrouter:google/gemini-2.5-pro-previewprompt": 125,
"openrouter:google/gemini-2.5-pro-previewcompletion": 1000,
"openrouter:google/gemini-2.5-pro-previewimage": 516000,
"openrouter:google/gemini-2.5-pro-previewinput_cache_read": 31,
"openrouter:google/gemini-2.5-pro-previewinput_cache_write": 163,
"openrouter:deepseek/deepseek-r1-0528-qwen3-8bprompt": 1,
"openrouter:deepseek/deepseek-r1-0528-qwen3-8bcompletion": 5,
"openrouter:deepseek/deepseek-r1-0528prompt": 25,
"openrouter:deepseek/deepseek-r1-0528completion": 100,
"openrouter:anthropic/claude-opus-4prompt": 1500,
"openrouter:anthropic/claude-opus-4completion": 7500,
"openrouter:anthropic/claude-opus-4image": 2400000,
"openrouter:anthropic/claude-opus-4web_search": 1000000,
"openrouter:anthropic/claude-opus-4input_cache_read": 150,
"openrouter:anthropic/claude-opus-4input_cache_write": 1875,
"openrouter:anthropic/claude-sonnet-4prompt": 300,
"openrouter:anthropic/claude-sonnet-4completion": 1500,
"openrouter:anthropic/claude-sonnet-4image": 480000,
"openrouter:anthropic/claude-sonnet-4input_cache_read": 30,
"openrouter:anthropic/claude-sonnet-4input_cache_write": 375,
"openrouter:mistralai/devstral-small-2505prompt": 4,
"openrouter:mistralai/devstral-small-2505completion": 14,
"openrouter:google/gemma-3n-e4b-itprompt": 2,
"openrouter:google/gemma-3n-e4b-itcompletion": 4,
"openrouter:openai/codex-miniprompt": 150,
"openrouter:openai/codex-minicompletion": 600,
"openrouter:openai/codex-miniinput_cache_read": 38,
"openrouter:nousresearch/deephermes-3-mistral-24b-previewprompt": 13,
"openrouter:nousresearch/deephermes-3-mistral-24b-previewcompletion": 51,
"openrouter:mistralai/mistral-medium-3prompt": 40,
"openrouter:mistralai/mistral-medium-3completion": 200,
"openrouter:google/gemini-2.5-pro-preview-05-06prompt": 125,
"openrouter:google/gemini-2.5-pro-preview-05-06completion": 1000,
"openrouter:google/gemini-2.5-pro-preview-05-06image": 516000,
"openrouter:google/gemini-2.5-pro-preview-05-06input_cache_read": 31,
"openrouter:google/gemini-2.5-pro-preview-05-06input_cache_write": 163,
"openrouter:arcee-ai/spotlightprompt": 18,
"openrouter:arcee-ai/spotlightcompletion": 18,
"openrouter:arcee-ai/maestro-reasoningprompt": 90,
"openrouter:arcee-ai/maestro-reasoningcompletion": 330,
"openrouter:arcee-ai/virtuoso-largeprompt": 75,
"openrouter:arcee-ai/virtuoso-largecompletion": 120,
"openrouter:arcee-ai/coder-largeprompt": 50,
"openrouter:arcee-ai/coder-largecompletion": 80,
"openrouter:microsoft/phi-4-reasoning-plusprompt": 7,
"openrouter:microsoft/phi-4-reasoning-pluscompletion": 35,
"openrouter:inception/mercury-coderprompt": 25,
"openrouter:inception/mercury-codercompletion": 100,
"openrouter:deepseek/deepseek-prover-v2prompt": 50,
"openrouter:deepseek/deepseek-prover-v2completion": 218,
"openrouter:meta-llama/llama-guard-4-12bprompt": 18,
"openrouter:meta-llama/llama-guard-4-12bcompletion": 18,
"openrouter:qwen/qwen3-30b-a3bprompt": 4,
"openrouter:qwen/qwen3-30b-a3bcompletion": 14,
"openrouter:qwen/qwen3-8bprompt": 4,
"openrouter:qwen/qwen3-8bcompletion": 14,
"openrouter:qwen/qwen3-14bprompt": 6,
"openrouter:qwen/qwen3-14bcompletion": 24,
"openrouter:qwen/qwen3-32bprompt": 3,
"openrouter:qwen/qwen3-32bcompletion": 13,
"openrouter:qwen/qwen3-235b-a22bprompt": 13,
"openrouter:qwen/qwen3-235b-a22bcompletion": 60,
"openrouter:tngtech/deepseek-r1t-chimeraprompt": 25,
"openrouter:tngtech/deepseek-r1t-chimeracompletion": 100,
"openrouter:microsoft/mai-ds-r1prompt": 25,
"openrouter:microsoft/mai-ds-r1completion": 100,
"openrouter:thudm/glm-z1-32bprompt": 4,
"openrouter:thudm/glm-z1-32bcompletion": 14,
"openrouter:thudm/glm-4-32bprompt": 55,
"openrouter:thudm/glm-4-32bcompletion": 166,
"openrouter:openai/o4-mini-highprompt": 110,
"openrouter:openai/o4-mini-highcompletion": 440,
"openrouter:openai/o4-mini-highimage": 84150,
"openrouter:openai/o4-mini-highinput_cache_read": 28,
"openrouter:openai/o3prompt": 200,
"openrouter:openai/o3completion": 800,
"openrouter:openai/o3image": 153000,
"openrouter:openai/o3input_cache_read": 50,
"openrouter:openai/o4-miniprompt": 110,
"openrouter:openai/o4-minicompletion": 440,
"openrouter:openai/o4-miniimage": 84150,
"openrouter:openai/o4-miniinput_cache_read": 28,
"openrouter:shisa-ai/shisa-v2-llama3.3-70bprompt": 4,
"openrouter:shisa-ai/shisa-v2-llama3.3-70bcompletion": 14,
"openrouter:openai/gpt-4.1prompt": 200,
"openrouter:openai/gpt-4.1completion": 800,
"openrouter:openai/gpt-4.1input_cache_read": 50,
"openrouter:openai/gpt-4.1-miniprompt": 40,
"openrouter:openai/gpt-4.1-minicompletion": 160,
"openrouter:openai/gpt-4.1-miniinput_cache_read": 10,
"openrouter:openai/gpt-4.1-nanoprompt": 10,
"openrouter:openai/gpt-4.1-nanocompletion": 40,
"openrouter:openai/gpt-4.1-nanoinput_cache_read": 3,
"openrouter:eleutherai/llemma_7bprompt": 80,
"openrouter:eleutherai/llemma_7bcompletion": 120,
"openrouter:alfredpros/codellama-7b-instruct-solidityprompt": 80,
"openrouter:alfredpros/codellama-7b-instruct-soliditycompletion": 120,
"openrouter:arliai/qwq-32b-arliai-rpr-v1prompt": 2,
"openrouter:arliai/qwq-32b-arliai-rpr-v1completion": 7,
"openrouter:agentica-org/deepcoder-14b-previewprompt": 1,
"openrouter:agentica-org/deepcoder-14b-previewcompletion": 1,
"openrouter:moonshotai/kimi-vl-a3b-thinkingprompt": 6,
"openrouter:moonshotai/kimi-vl-a3b-thinkingcompletion": 25,
"openrouter:x-ai/grok-3-mini-betaprompt": 30,
"openrouter:x-ai/grok-3-mini-betacompletion": 50,
"openrouter:x-ai/grok-3-mini-betainput_cache_read": 7,
"openrouter:x-ai/grok-3-betaprompt": 300,
"openrouter:x-ai/grok-3-betacompletion": 1500,
"openrouter:x-ai/grok-3-betainput_cache_read": 75,
"openrouter:nvidia/llama-3.1-nemotron-ultra-253b-v1prompt": 60,
"openrouter:nvidia/llama-3.1-nemotron-ultra-253b-v1completion": 180,
"openrouter:meta-llama/llama-4-maverickprompt": 15,
"openrouter:meta-llama/llama-4-maverickcompletion": 60,
"openrouter:meta-llama/llama-4-maverickimage": 66840,
"openrouter:meta-llama/llama-4-scoutprompt": 8,
"openrouter:meta-llama/llama-4-scoutcompletion": 30,
"openrouter:allenai/molmo-7b-dprompt": 10,
"openrouter:allenai/molmo-7b-dcompletion": 20,
"openrouter:qwen/qwen2.5-vl-32b-instructprompt": 4,
"openrouter:qwen/qwen2.5-vl-32b-instructcompletion": 14,
"openrouter:deepseek/deepseek-chat-v3-0324prompt": 25,
"openrouter:deepseek/deepseek-chat-v3-0324completion": 100,
"openrouter:openai/o1-proprompt": 15000,
"openrouter:openai/o1-procompletion": 60000,
"openrouter:openai/o1-proimage": 21675000,
"openrouter:mistralai/mistral-small-3.1-24b-instructprompt": 4,
"openrouter:mistralai/mistral-small-3.1-24b-instructcompletion": 15,
"openrouter:allenai/olmo-2-0325-32b-instructprompt": 100,
"openrouter:allenai/olmo-2-0325-32b-instructcompletion": 150,
"openrouter:google/gemma-3-4b-itprompt": 4,
"openrouter:google/gemma-3-4b-itcompletion": 8,
"openrouter:google/gemma-3-12b-itprompt": 4,
"openrouter:google/gemma-3-12b-itcompletion": 14,
"openrouter:cohere/command-aprompt": 250,
"openrouter:cohere/command-acompletion": 1000,
"openrouter:openai/gpt-4o-mini-search-previewprompt": 15,
"openrouter:openai/gpt-4o-mini-search-previewcompletion": 60,
"openrouter:openai/gpt-4o-mini-search-previewrequest": 2750000,
"openrouter:openai/gpt-4o-mini-search-previewimage": 21700,
"openrouter:openai/gpt-4o-search-previewprompt": 250,
"openrouter:openai/gpt-4o-search-previewcompletion": 1000,
"openrouter:openai/gpt-4o-search-previewrequest": 3500000,
"openrouter:openai/gpt-4o-search-previewimage": 361300,
"openrouter:google/gemma-3-27b-itprompt": 7,
"openrouter:google/gemma-3-27b-itcompletion": 26,
"openrouter:thedrummer/anubis-pro-105b-v1prompt": 50,
"openrouter:thedrummer/anubis-pro-105b-v1completion": 100,
"openrouter:thedrummer/skyfall-36b-v2prompt": 4,
"openrouter:thedrummer/skyfall-36b-v2completion": 16,
"openrouter:microsoft/phi-4-multimodal-instructprompt": 5,
"openrouter:microsoft/phi-4-multimodal-instructcompletion": 10,
"openrouter:microsoft/phi-4-multimodal-instructimage": 17685,
"openrouter:perplexity/sonar-reasoning-proprompt": 200,
"openrouter:perplexity/sonar-reasoning-procompletion": 800,
"openrouter:perplexity/sonar-reasoning-proweb_search": 500000,
"openrouter:perplexity/sonar-proprompt": 300,
"openrouter:perplexity/sonar-procompletion": 1500,
"openrouter:perplexity/sonar-proweb_search": 500000,
"openrouter:perplexity/sonar-deep-researchprompt": 200,
"openrouter:perplexity/sonar-deep-researchcompletion": 800,
"openrouter:perplexity/sonar-deep-researchweb_search": 500000,
"openrouter:perplexity/sonar-deep-researchinternal_reasoning": 300,
"openrouter:qwen/qwq-32bprompt": 15,
"openrouter:qwen/qwq-32bcompletion": 40,
"openrouter:google/gemini-2.0-flash-lite-001prompt": 7,
"openrouter:google/gemini-2.0-flash-lite-001completion": 30,
"openrouter:anthropic/claude-3.7-sonnetprompt": 300,
"openrouter:anthropic/claude-3.7-sonnetcompletion": 1500,
"openrouter:anthropic/claude-3.7-sonnetimage": 480000,
"openrouter:anthropic/claude-3.7-sonnetinput_cache_read": 30,
"openrouter:anthropic/claude-3.7-sonnetinput_cache_write": 375,
"openrouter:anthropic/claude-3.7-sonnet:thinkingprompt": 300,
"openrouter:anthropic/claude-3.7-sonnet:thinkingcompletion": 1500,
"openrouter:anthropic/claude-3.7-sonnet:thinkingimage": 480000,
"openrouter:anthropic/claude-3.7-sonnet:thinkinginput_cache_read": 30,
"openrouter:anthropic/claude-3.7-sonnet:thinkinginput_cache_write": 375,
"openrouter:perplexity/r1-1776prompt": 200,
"openrouter:perplexity/r1-1776completion": 800,
"openrouter:mistralai/mistral-sabaprompt": 20,
"openrouter:mistralai/mistral-sabacompletion": 60,
"openrouter:cognitivecomputations/dolphin3.0-r1-mistral-24bprompt": 1,
"openrouter:cognitivecomputations/dolphin3.0-r1-mistral-24bcompletion": 3,
"openrouter:cognitivecomputations/dolphin3.0-mistral-24bprompt": 3,
"openrouter:cognitivecomputations/dolphin3.0-mistral-24bcompletion": 11,
"openrouter:meta-llama/llama-guard-3-8bprompt": 2,
"openrouter:meta-llama/llama-guard-3-8bcompletion": 6,
"openrouter:openai/o3-mini-highprompt": 110,
"openrouter:openai/o3-mini-highcompletion": 440,
"openrouter:openai/o3-mini-highinput_cache_read": 55,
"openrouter:deepseek/deepseek-r1-distill-llama-8bprompt": 4,
"openrouter:deepseek/deepseek-r1-distill-llama-8bcompletion": 4,
"openrouter:google/gemini-2.0-flash-001prompt": 10,
"openrouter:google/gemini-2.0-flash-001completion": 40,
"openrouter:google/gemini-2.0-flash-001image": 2580,
"openrouter:google/gemini-2.0-flash-001audio": 70,
"openrouter:google/gemini-2.0-flash-001input_cache_read": 3,
"openrouter:google/gemini-2.0-flash-001input_cache_write": 18,
"openrouter:qwen/qwen-vl-plusprompt": 21,
"openrouter:qwen/qwen-vl-pluscompletion": 63,
"openrouter:qwen/qwen-vl-plusimage": 26880,
"openrouter:aion-labs/aion-1.0prompt": 400,
"openrouter:aion-labs/aion-1.0completion": 800,
"openrouter:aion-labs/aion-1.0-miniprompt": 70,
"openrouter:aion-labs/aion-1.0-minicompletion": 140,
"openrouter:aion-labs/aion-rp-llama-3.1-8bprompt": 20,
"openrouter:aion-labs/aion-rp-llama-3.1-8bcompletion": 20,
"openrouter:qwen/qwen-vl-maxprompt": 80,
"openrouter:qwen/qwen-vl-maxcompletion": 320,
"openrouter:qwen/qwen-vl-maximage": 102400,
"openrouter:qwen/qwen-turboprompt": 5,
"openrouter:qwen/qwen-turbocompletion": 20,
"openrouter:qwen/qwen-turboinput_cache_read": 2,
"openrouter:qwen/qwen2.5-vl-72b-instructprompt": 25,
"openrouter:qwen/qwen2.5-vl-72b-instructcompletion": 100,
"openrouter:qwen/qwen-plusprompt": 40,
"openrouter:qwen/qwen-pluscompletion": 120,
"openrouter:qwen/qwen-plusinput_cache_read": 16,
"openrouter:qwen/qwen-maxprompt": 160,
"openrouter:qwen/qwen-maxcompletion": 640,
"openrouter:qwen/qwen-maxinput_cache_read": 64,
"openrouter:openai/o3-miniprompt": 110,
"openrouter:openai/o3-minicompletion": 440,
"openrouter:openai/o3-miniinput_cache_read": 55,
"openrouter:mistralai/mistral-small-24b-instruct-2501prompt": 4,
"openrouter:mistralai/mistral-small-24b-instruct-2501completion": 15,
"openrouter:deepseek/deepseek-r1-distill-qwen-32bprompt": 7,
"openrouter:deepseek/deepseek-r1-distill-qwen-32bcompletion": 15,
"openrouter:deepseek/deepseek-r1-distill-qwen-14bprompt": 15,
"openrouter:deepseek/deepseek-r1-distill-qwen-14bcompletion": 15,
"openrouter:perplexity/sonar-reasoningprompt": 100,
"openrouter:perplexity/sonar-reasoningcompletion": 500,
"openrouter:perplexity/sonar-reasoningrequest": 500000,
"openrouter:perplexity/sonarprompt": 100,
"openrouter:perplexity/sonarcompletion": 100,
"openrouter:perplexity/sonarrequest": 500000,
"openrouter:liquid/lfm-7bprompt": 1,
"openrouter:liquid/lfm-7bcompletion": 1,
"openrouter:liquid/lfm-3bprompt": 2,
"openrouter:liquid/lfm-3bcompletion": 2,
"openrouter:deepseek/deepseek-r1-distill-llama-70bprompt": 3,
"openrouter:deepseek/deepseek-r1-distill-llama-70bcompletion": 13,
"openrouter:deepseek/deepseek-r1prompt": 40,
"openrouter:deepseek/deepseek-r1completion": 200,
"openrouter:minimax/minimax-01prompt": 20,
"openrouter:minimax/minimax-01completion": 110,
"openrouter:mistralai/codestral-2501prompt": 30,
"openrouter:mistralai/codestral-2501completion": 90,
"openrouter:microsoft/phi-4prompt": 6,
"openrouter:microsoft/phi-4completion": 14,
"openrouter:deepseek/deepseek-chatprompt": 25,
"openrouter:deepseek/deepseek-chatcompletion": 100,
"openrouter:sao10k/l3.3-euryale-70bprompt": 65,
"openrouter:sao10k/l3.3-euryale-70bcompletion": 75,
"openrouter:openai/o1prompt": 1500,
"openrouter:openai/o1completion": 6000,
"openrouter:openai/o1image": 2167500,
"openrouter:openai/o1input_cache_read": 750,
"openrouter:x-ai/grok-2-vision-1212prompt": 200,
"openrouter:x-ai/grok-2-vision-1212completion": 1000,
"openrouter:x-ai/grok-2-vision-1212image": 360000,
"openrouter:x-ai/grok-2-1212prompt": 200,
"openrouter:x-ai/grok-2-1212completion": 1000,
"openrouter:cohere/command-r7b-12-2024prompt": 4,
"openrouter:cohere/command-r7b-12-2024completion": 15,
"openrouter:meta-llama/llama-3.3-70b-instructprompt": 4,
"openrouter:meta-llama/llama-3.3-70b-instructcompletion": 12,
"openrouter:amazon/nova-lite-v1prompt": 6,
"openrouter:amazon/nova-lite-v1completion": 24,
"openrouter:amazon/nova-lite-v1image": 9000,
"openrouter:amazon/nova-micro-v1prompt": 4,
"openrouter:amazon/nova-micro-v1completion": 14,
"openrouter:amazon/nova-pro-v1prompt": 80,
"openrouter:amazon/nova-pro-v1completion": 320,
"openrouter:amazon/nova-pro-v1image": 120000,
"openrouter:qwen/qwq-32b-previewprompt": 20,
"openrouter:qwen/qwq-32b-previewcompletion": 20,
"openrouter:openai/gpt-4o-2024-11-20prompt": 250,
"openrouter:openai/gpt-4o-2024-11-20completion": 1000,
"openrouter:openai/gpt-4o-2024-11-20image": 361300,
"openrouter:openai/gpt-4o-2024-11-20input_cache_read": 125,
"openrouter:mistralai/mistral-large-2411prompt": 200,
"openrouter:mistralai/mistral-large-2411completion": 600,
"openrouter:mistralai/mistral-large-2407prompt": 200,
"openrouter:mistralai/mistral-large-2407completion": 600,
"openrouter:mistralai/pixtral-large-2411prompt": 200,
"openrouter:mistralai/pixtral-large-2411completion": 600,
"openrouter:mistralai/pixtral-large-2411image": 288800,
"openrouter:qwen/qwen-2.5-coder-32b-instructprompt": 6,
"openrouter:qwen/qwen-2.5-coder-32b-instructcompletion": 15,
"openrouter:raifle/sorcererlm-8x22bprompt": 450,
"openrouter:raifle/sorcererlm-8x22bcompletion": 450,
"openrouter:thedrummer/unslopnemo-12bprompt": 40,
"openrouter:thedrummer/unslopnemo-12bcompletion": 40,
"openrouter:anthropic/claude-3.5-haikuprompt": 80,
"openrouter:anthropic/claude-3.5-haikucompletion": 400,
"openrouter:anthropic/claude-3.5-haikuweb_search": 1000000,
"openrouter:anthropic/claude-3.5-haikuinput_cache_read": 8,
"openrouter:anthropic/claude-3.5-haikuinput_cache_write": 100,
"openrouter:anthropic/claude-3.5-haiku-20241022prompt": 80,
"openrouter:anthropic/claude-3.5-haiku-20241022completion": 400,
"openrouter:anthropic/claude-3.5-haiku-20241022input_cache_read": 8,
"openrouter:anthropic/claude-3.5-haiku-20241022input_cache_write": 100,
"openrouter:anthracite-org/magnum-v4-72bprompt": 200,
"openrouter:anthracite-org/magnum-v4-72bcompletion": 500,
"openrouter:anthropic/claude-3.5-sonnetprompt": 300,
"openrouter:anthropic/claude-3.5-sonnetcompletion": 1500,
"openrouter:anthropic/claude-3.5-sonnetimage": 480000,
"openrouter:anthropic/claude-3.5-sonnetinput_cache_read": 30,
"openrouter:anthropic/claude-3.5-sonnetinput_cache_write": 375,
"openrouter:mistralai/ministral-8bprompt": 10,
"openrouter:mistralai/ministral-8bcompletion": 10,
"openrouter:mistralai/ministral-3bprompt": 4,
"openrouter:mistralai/ministral-3bcompletion": 4,
"openrouter:qwen/qwen-2.5-7b-instructprompt": 4,
"openrouter:qwen/qwen-2.5-7b-instructcompletion": 10,
"openrouter:nvidia/llama-3.1-nemotron-70b-instructprompt": 12,
"openrouter:nvidia/llama-3.1-nemotron-70b-instructcompletion": 30,
"openrouter:inflection/inflection-3-productivityprompt": 250,
"openrouter:inflection/inflection-3-productivitycompletion": 1000,
"openrouter:inflection/inflection-3-piprompt": 250,
"openrouter:inflection/inflection-3-picompletion": 1000,
"openrouter:google/gemini-flash-1.5-8bprompt": 4,
"openrouter:google/gemini-flash-1.5-8bcompletion": 15,
"openrouter:google/gemini-flash-1.5-8binput_cache_read": 1,
"openrouter:google/gemini-flash-1.5-8binput_cache_write": 6,
"openrouter:thedrummer/rocinante-12bprompt": 17,
"openrouter:thedrummer/rocinante-12bcompletion": 43,
"openrouter:anthracite-org/magnum-v2-72bprompt": 300,
"openrouter:anthracite-org/magnum-v2-72bcompletion": 300,
"openrouter:meta-llama/llama-3.2-3b-instructprompt": 1,
"openrouter:meta-llama/llama-3.2-3b-instructcompletion": 2,
"openrouter:meta-llama/llama-3.2-1b-instructprompt": 1,
"openrouter:meta-llama/llama-3.2-1b-instructcompletion": 1,
"openrouter:meta-llama/llama-3.2-90b-vision-instructprompt": 35,
"openrouter:meta-llama/llama-3.2-90b-vision-instructcompletion": 40,
"openrouter:meta-llama/llama-3.2-90b-vision-instructimage": 50580,
"openrouter:meta-llama/llama-3.2-11b-vision-instructprompt": 5,
"openrouter:meta-llama/llama-3.2-11b-vision-instructcompletion": 5,
"openrouter:meta-llama/llama-3.2-11b-vision-instructimage": 7948,
"openrouter:qwen/qwen-2.5-72b-instructprompt": 7,
"openrouter:qwen/qwen-2.5-72b-instructcompletion": 26,
"openrouter:neversleep/llama-3.1-lumimaid-8bprompt": 9,
"openrouter:neversleep/llama-3.1-lumimaid-8bcompletion": 60,
"openrouter:openai/o1-miniprompt": 110,
"openrouter:openai/o1-minicompletion": 440,
"openrouter:openai/o1-miniinput_cache_read": 55,
"openrouter:openai/o1-mini-2024-09-12prompt": 110,
"openrouter:openai/o1-mini-2024-09-12completion": 440,
"openrouter:openai/o1-mini-2024-09-12input_cache_read": 55,
"openrouter:mistralai/pixtral-12bprompt": 10,
"openrouter:mistralai/pixtral-12bcompletion": 10,
"openrouter:mistralai/pixtral-12bimage": 14450,
"openrouter:cohere/command-r-plus-08-2024prompt": 250,
"openrouter:cohere/command-r-plus-08-2024completion": 1000,
"openrouter:cohere/command-r-08-2024prompt": 15,
"openrouter:cohere/command-r-08-2024completion": 60,
"openrouter:qwen/qwen-2.5-vl-7b-instructprompt": 20,
"openrouter:qwen/qwen-2.5-vl-7b-instructcompletion": 20,
"openrouter:qwen/qwen-2.5-vl-7b-instructimage": 14450,
"openrouter:sao10k/l3.1-euryale-70bprompt": 65,
"openrouter:sao10k/l3.1-euryale-70bcompletion": 75,
"openrouter:microsoft/phi-3.5-mini-128k-instructprompt": 10,
"openrouter:microsoft/phi-3.5-mini-128k-instructcompletion": 10,
"openrouter:nousresearch/hermes-3-llama-3.1-70bprompt": 10,
"openrouter:nousresearch/hermes-3-llama-3.1-70bcompletion": 28,
"openrouter:nousresearch/hermes-3-llama-3.1-405bprompt": 70,
"openrouter:nousresearch/hermes-3-llama-3.1-405bcompletion": 80,
"openrouter:openai/chatgpt-4o-latestprompt": 500,
"openrouter:openai/chatgpt-4o-latestcompletion": 1500,
"openrouter:openai/chatgpt-4o-latestimage": 722500,
"openrouter:sao10k/l3-lunaris-8bprompt": 2,
"openrouter:sao10k/l3-lunaris-8bcompletion": 5,
"openrouter:openai/gpt-4o-2024-08-06prompt": 250,
"openrouter:openai/gpt-4o-2024-08-06completion": 1000,
"openrouter:openai/gpt-4o-2024-08-06image": 361300,
"openrouter:openai/gpt-4o-2024-08-06input_cache_read": 125,
"openrouter:meta-llama/llama-3.1-405bprompt": 200,
"openrouter:meta-llama/llama-3.1-405bcompletion": 200,
"openrouter:meta-llama/llama-3.1-8b-instructprompt": 1,
"openrouter:meta-llama/llama-3.1-8b-instructcompletion": 2,
"openrouter:meta-llama/llama-3.1-405b-instructprompt": 80,
"openrouter:meta-llama/llama-3.1-405b-instructcompletion": 80,
"openrouter:meta-llama/llama-3.1-70b-instructprompt": 10,
"openrouter:meta-llama/llama-3.1-70b-instructcompletion": 28,
"openrouter:mistralai/mistral-nemoprompt": 2,
"openrouter:mistralai/mistral-nemocompletion": 7,
"openrouter:openai/gpt-4o-miniprompt": 15,
"openrouter:openai/gpt-4o-minicompletion": 60,
"openrouter:openai/gpt-4o-miniimage": 21700,
"openrouter:openai/gpt-4o-miniinput_cache_read": 7,
"openrouter:openai/gpt-4o-mini-2024-07-18prompt": 15,
"openrouter:openai/gpt-4o-mini-2024-07-18completion": 60,
"openrouter:openai/gpt-4o-mini-2024-07-18image": 722500,
"openrouter:openai/gpt-4o-mini-2024-07-18input_cache_read": 7,
"openrouter:google/gemma-2-27b-itprompt": 65,
"openrouter:google/gemma-2-27b-itcompletion": 65,
"openrouter:google/gemma-2-9b-itprompt": 2,
"openrouter:google/gemma-2-9b-itcompletion": 4,
"openrouter:anthropic/claude-3.5-sonnet-20240620prompt": 300,
"openrouter:anthropic/claude-3.5-sonnet-20240620completion": 1500,
"openrouter:anthropic/claude-3.5-sonnet-20240620image": 480000,
"openrouter:anthropic/claude-3.5-sonnet-20240620input_cache_read": 30,
"openrouter:anthropic/claude-3.5-sonnet-20240620input_cache_write": 375,
"openrouter:sao10k/l3-euryale-70bprompt": 148,
"openrouter:sao10k/l3-euryale-70bcompletion": 148,
"openrouter:cognitivecomputations/dolphin-mixtral-8x22bprompt": 90,
"openrouter:cognitivecomputations/dolphin-mixtral-8x22bcompletion": 90,
"openrouter:mistralai/mistral-7b-instructprompt": 3,
"openrouter:mistralai/mistral-7b-instructcompletion": 5,
"openrouter:nousresearch/hermes-2-pro-llama-3-8bprompt": 3,
"openrouter:nousresearch/hermes-2-pro-llama-3-8bcompletion": 4,
"openrouter:mistralai/mistral-7b-instruct-v0.3prompt": 3,
"openrouter:mistralai/mistral-7b-instruct-v0.3completion": 5,
"openrouter:microsoft/phi-3-mini-128k-instructprompt": 10,
"openrouter:microsoft/phi-3-mini-128k-instructcompletion": 10,
"openrouter:microsoft/phi-3-medium-128k-instructprompt": 100,
"openrouter:microsoft/phi-3-medium-128k-instructcompletion": 100,
"openrouter:neversleep/llama-3-lumimaid-70bprompt": 400,
"openrouter:neversleep/llama-3-lumimaid-70bcompletion": 600,
"openrouter:google/gemini-flash-1.5prompt": 7,
"openrouter:google/gemini-flash-1.5completion": 30,
"openrouter:google/gemini-flash-1.5image": 4000,
"openrouter:google/gemini-flash-1.5input_cache_read": 2,
"openrouter:google/gemini-flash-1.5input_cache_write": 16,
"openrouter:openai/gpt-4oprompt": 250,
"openrouter:openai/gpt-4ocompletion": 1000,
"openrouter:openai/gpt-4oimage": 361300,
"openrouter:openai/gpt-4oinput_cache_read": 125,
"openrouter:openai/gpt-4o:extendedprompt": 600,
"openrouter:openai/gpt-4o:extendedcompletion": 1800,
"openrouter:openai/gpt-4o:extendedimage": 722500,
"openrouter:meta-llama/llama-guard-2-8bprompt": 20,
"openrouter:meta-llama/llama-guard-2-8bcompletion": 20,
"openrouter:openai/gpt-4o-2024-05-13prompt": 500,
"openrouter:openai/gpt-4o-2024-05-13completion": 1500,
"openrouter:openai/gpt-4o-2024-05-13image": 722500,
"openrouter:meta-llama/llama-3-8b-instructprompt": 3,
"openrouter:meta-llama/llama-3-8b-instructcompletion": 6,
"openrouter:meta-llama/llama-3-70b-instructprompt": 30,
"openrouter:meta-llama/llama-3-70b-instructcompletion": 40,
"openrouter:mistralai/mixtral-8x22b-instructprompt": 90,
"openrouter:mistralai/mixtral-8x22b-instructcompletion": 90,
"openrouter:microsoft/wizardlm-2-8x22bprompt": 48,
"openrouter:microsoft/wizardlm-2-8x22bcompletion": 48,
"openrouter:google/gemini-pro-1.5prompt": 125,
"openrouter:google/gemini-pro-1.5completion": 500,
"openrouter:google/gemini-pro-1.5image": 65750,
"openrouter:openai/gpt-4-turboprompt": 1000,
"openrouter:openai/gpt-4-turbocompletion": 3000,
"openrouter:openai/gpt-4-turboimage": 1445000,
"openrouter:cohere/command-r-plusprompt": 300,
"openrouter:cohere/command-r-pluscompletion": 1500,
"openrouter:cohere/command-r-plus-04-2024prompt": 300,
"openrouter:cohere/command-r-plus-04-2024completion": 1500,
"openrouter:sophosympatheia/midnight-rose-70bprompt": 80,
"openrouter:sophosympatheia/midnight-rose-70bcompletion": 80,
"openrouter:cohere/commandprompt": 100,
"openrouter:cohere/commandcompletion": 200,
"openrouter:cohere/command-rprompt": 50,
"openrouter:cohere/command-rcompletion": 150,
"openrouter:anthropic/claude-3-haikuprompt": 25,
"openrouter:anthropic/claude-3-haikucompletion": 125,
"openrouter:anthropic/claude-3-haikuimage": 40000,
"openrouter:anthropic/claude-3-haikuinput_cache_read": 3,
"openrouter:anthropic/claude-3-haikuinput_cache_write": 30,
"openrouter:anthropic/claude-3-opusprompt": 1500,
"openrouter:anthropic/claude-3-opuscompletion": 7500,
"openrouter:anthropic/claude-3-opusimage": 2400000,
"openrouter:anthropic/claude-3-opusinput_cache_read": 150,
"openrouter:anthropic/claude-3-opusinput_cache_write": 1875,
"openrouter:cohere/command-r-03-2024prompt": 50,
"openrouter:cohere/command-r-03-2024completion": 150,
"openrouter:mistralai/mistral-largeprompt": 200,
"openrouter:mistralai/mistral-largecompletion": 600,
"openrouter:openai/gpt-3.5-turbo-0613prompt": 100,
"openrouter:openai/gpt-3.5-turbo-0613completion": 200,
"openrouter:openai/gpt-4-turbo-previewprompt": 1000,
"openrouter:openai/gpt-4-turbo-previewcompletion": 3000,
"openrouter:mistralai/mistral-smallprompt": 20,
"openrouter:mistralai/mistral-smallcompletion": 60,
"openrouter:mistralai/mistral-tinyprompt": 25,
"openrouter:mistralai/mistral-tinycompletion": 25,
"openrouter:mistralai/mixtral-8x7b-instructprompt": 8,
"openrouter:mistralai/mixtral-8x7b-instructcompletion": 24,
"openrouter:neversleep/noromaid-20bprompt": 100,
"openrouter:neversleep/noromaid-20bcompletion": 175,
"openrouter:alpindale/goliath-120bprompt": 400,
"openrouter:alpindale/goliath-120bcompletion": 550,
"openrouter:openrouter/autoprompt": -100000000,
"openrouter:openrouter/autocompletion": -100000000,
"openrouter:openai/gpt-4-1106-previewprompt": 1000,
"openrouter:openai/gpt-4-1106-previewcompletion": 3000,
"openrouter:openai/gpt-3.5-turbo-instructprompt": 150,
"openrouter:openai/gpt-3.5-turbo-instructcompletion": 200,
"openrouter:mistralai/mistral-7b-instruct-v0.1prompt": 11,
"openrouter:mistralai/mistral-7b-instruct-v0.1completion": 19,
"openrouter:openai/gpt-3.5-turbo-16kprompt": 300,
"openrouter:openai/gpt-3.5-turbo-16kcompletion": 400,
"openrouter:mancer/weaverprompt": 113,
"openrouter:mancer/weavercompletion": 113,
"openrouter:undi95/remm-slerp-l2-13bprompt": 45,
"openrouter:undi95/remm-slerp-l2-13bcompletion": 65,
"openrouter:gryphe/mythomax-l2-13bprompt": 6,
"openrouter:gryphe/mythomax-l2-13bcompletion": 6,
"openrouter:openai/gpt-3.5-turboprompt": 50,
"openrouter:openai/gpt-3.5-turbocompletion": 150,
"openrouter:openai/gpt-4prompt": 3000,
"openrouter:openai/gpt-4completion": 6000,
"openrouter:openai/gpt-4-0314prompt": 3000,
"openrouter:openai/gpt-4-0314completion": 6000
}
@@ -0,0 +1,12 @@
// TogetherAI Cost Map
// Note: TogetherAI uses dynamic pricing fetched from their API. This map only includes static/hardcoded test models.
// For production, model costs should be fetched dynamically via the Together API.
//
// Most TogetherAI models are not listed here due to dynamic pricing.
// Only hardcoded test models are included.
export const TOGETHER_COST_MAP = {
// Test model (hardcoded)
"together:model-fallback-test-1:input": 10,
"together:model-fallback-test-1:output": 10,
};
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2024-present Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const XAI_COST_MAP = {
// Grok Beta
"xai:grok-beta:input": 500,
"xai:grok-beta:output": 1500,
// Grok Vision Beta
"xai:grok-vision-beta:input": 500,
"xai:grok-vision-beta:output": 1500,
"xai:grok-vision-beta:image": 1000,
// Grok 3
"xai:grok-3:input": 300,
"xai:grok-3:output": 1500,
// Grok 3 Fast
"xai:grok-3-fast:input": 500,
"xai:grok-3-fast:output": 2500,
// Grok 3 Mini
"xai:grok-3-mini:input": 30,
"xai:grok-3-mini:output": 50,
// Grok 3 Mini Fast
"xai:grok-3-mini-fast:input": 60,
"xai:grok-3-mini-fast:output": 400,
// Grok 2 Vision
"xai:grok-2-vision:input": 200,
"xai:grok-2-vision:output": 1000,
// Grok 2
"xai:grok-2:input": 200,
"xai:grok-2:output": 1000,
};
@@ -0,0 +1,49 @@
// TODO DS: these should be loaded from config or db eventually
/**
* flat cost map based on usage types, numbers are in microcents (1/1 millionth of a cent)
* E.g. 1000000 microcents = 1 cent
* most services measure their prices in 1 million requests or tokens or whatever, so if that's the case you can simply use the cent val
* $0.63 per 1M reads = 63 microcents per read
* $1.25 per 1M writes = 125 microcents per write
*/
export const USAGE_TYPE_MAPS = {
// Map with unit to cost measurements in microcent
'kv:read': 63,
'kv:write': 125,
// OpenAI api usage types (costs per token in microcents)
// Source: OpenAICompletionService.js models_() pricing (usd-cents per 1M tokens × 1000 = microcents per token)
'openai:gpt-5:input': 125,
'openai:gpt-5:output': 1000,
'openai:gpt-5-mini:input': 25,
'openai:gpt-5-mini:output': 200,
'openai:gpt-5-nano:input': 5,
'openai:gpt-5-nano:output': 40,
'openai:gpt-5-chat-latest:input': 125,
'openai:gpt-5-chat-latest:output': 1000,
'openai:gpt-4o:input': 250,
'openai:gpt-4o:output': 1000,
'openai:gpt-4o-mini:input': 15,
'openai:gpt-4o-mini:output': 60,
'openai:o1:input': 1500,
'openai:o1:output': 6000,
'openai:o1-mini:input': 300,
'openai:o1-mini:output': 1200,
'openai:o1-pro:input': 15000,
'openai:o1-pro:output': 60000,
'openai:o3:input': 1000,
'openai:o3:output': 4000,
'openai:o3-mini:input': 110,
'openai:o3-mini:output': 440,
'openai:o4-mini:input': 110,
'openai:o4-mini:output': 440,
'openai:gpt-4.1:input': 200,
'openai:gpt-4.1:output': 800,
'openai:gpt-4.1-mini:input': 40,
'openai:gpt-4.1-mini:output': 160,
'openai:gpt-4.1-nano:input': 10,
'openai:gpt-4.1-nano:output': 40,
'openai:gpt-4.5-preview:input': 7500,
'openai:gpt-4.5-preview:output': 15000,
}