Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions messages/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,17 @@
"modelName": "Model Name",
"provider": "Provider",
"capabilities": "Capabilities",
"price": "Price",
"inputPrice": "Input Price ($/M)",
"outputPrice": "Output Price ($/M)",
"priceInput": "In",
"priceOutput": "Out",
"pricePerRequest": "Req",
"cacheReadPrice": "Cache Read ($/M)",
"cacheCreationPrice": "Cache Create ($/M)",
"cache5m": "5m",
"cache1h": "1h+",
"copyModelId": "Copy model ID",
"updatedAt": "Updated At",
"actions": "Actions",
"typeChat": "Chat",
Expand Down Expand Up @@ -660,6 +669,8 @@
"manualDownload": "You can also manually download",
"latestPriceTable": "cloud price table",
"andUploadViaButton": ", and upload via button above",
"cloudModelCountLoading": "Loading cloud model count...",
"cloudModelCountFailed": "Failed to load cloud model count",
"supportedModels": "Currently supports {count} models",
"results": {
"title": "Update Results",
Expand All @@ -679,15 +690,28 @@
"editModelDescription": "Edit the model price configuration",
"deleteConfirm": "Are you sure you want to delete model {name}? This action cannot be undone.",
"form": {
"modelName": "Model Name",
"modelName": "Model ID",
"modelNamePlaceholder": "e.g., gpt-5.2-codex",
"modelNameRequired": "Model name is required",
"modelNameRequired": "Model ID is required",
"displayName": "Display Name (Optional)",
"displayNamePlaceholder": "e.g., GPT-5.2 Codex",
"type": "Type",
"provider": "Provider",
"providerPlaceholder": "e.g., openai",
"requestPrice": "Per-call Price ($/request)",
"inputPrice": "Input Price ($/M tokens)",
"outputPrice": "Output Price ($/M tokens)",
"outputPriceImage": "Output Price ($/image)"
"outputPriceImage": "Output Price ($/image)",
"cacheReadPrice": "Cache Read Price ($/M tokens)",
"cacheCreationPrice5m": "Cache Creation Price (5m, $/M tokens)",
"cacheCreationPrice1h": "Cache Creation Price (1h+, $/M tokens)"
},
"drawer": {
"prefillLabel": "Search existing models to prefill",
"prefillEmpty": "No matching models found",
"prefillFailed": "Search failed",
"promptCachingHint": "Enable if the model supports prompt caching",
"cachePricingTitle": "Cache Pricing"
},
"actions": {
"edit": "Edit",
Expand Down
30 changes: 27 additions & 3 deletions messages/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,17 @@
"modelName": "モデル名",
"provider": "プロバイダー",
"capabilities": "機能",
"price": "価格",
"inputPrice": "入力価格 ($/M)",
"outputPrice": "出力価格 ($/M)",
"priceInput": "入力",
"priceOutput": "出力",
"pricePerRequest": "回",
"cacheReadPrice": "キャッシュ読み取り ($/M)",
"cacheCreationPrice": "キャッシュ作成 ($/M)",
"cache5m": "5m",
"cache1h": "1h+",
"copyModelId": "モデルIDをコピー",
"updatedAt": "更新日時",
"actions": "操作",
"typeChat": "チャット",
Expand Down Expand Up @@ -651,6 +660,8 @@
"manualDownload": "手動でダウンロードすることもできます",
"latestPriceTable": "クラウド価格表",
"andUploadViaButton": "、上のボタンでアップロードしてください",
"cloudModelCountLoading": "クラウドモデル数を読み込み中...",
"cloudModelCountFailed": "クラウドモデル数の読み込みに失敗しました",
"supportedModels": "現在{count}個のモデルをサポート",
"results": {
"title": "更新結果",
Expand All @@ -670,15 +681,28 @@
"editModelDescription": "モデルの価格設定を編集します",
"deleteConfirm": "モデル {name} を削除してもよろしいですか?この操作は元に戻せません。",
"form": {
"modelName": "モデル名",
"modelName": "モデルID",
"modelNamePlaceholder": "例: gpt-5.2-codex",
"modelNameRequired": "モデル名は必須です",
"modelNameRequired": "モデルIDは必須です",
"displayName": "表示名(任意)",
"displayNamePlaceholder": "例: GPT-5.2 Codex",
"type": "タイプ",
"provider": "プロバイダー",
"providerPlaceholder": "例: openai",
"requestPrice": "呼び出し単価 ($/request)",
"inputPrice": "入力価格 ($/M tokens)",
"outputPrice": "出力価格 ($/M tokens)",
"outputPriceImage": "出力価格 ($/image)"
"outputPriceImage": "出力価格 ($/image)",
"cacheReadPrice": "キャッシュ読み取り価格 ($/M tokens)",
"cacheCreationPrice5m": "キャッシュ作成価格(5m,$/M tokens)",
"cacheCreationPrice1h": "キャッシュ作成価格(1h+,$/M tokens)"
},
"drawer": {
"prefillLabel": "既存モデルを検索してプリフィル",
"prefillEmpty": "一致するモデルが見つかりません",
"prefillFailed": "検索に失敗しました",
"promptCachingHint": "モデルがキャッシュに対応している場合のみ有効化し、下のキャッシュ価格を設定してください",
"cachePricingTitle": "キャッシュ価格"
},
"actions": {
"edit": "編集",
Expand Down
30 changes: 27 additions & 3 deletions messages/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,17 @@
"modelName": "Название модели",
"provider": "Поставщик",
"capabilities": "Возможности",
"price": "Цена",
"inputPrice": "Цена ввода ($/M)",
"outputPrice": "Цена вывода ($/M)",
"priceInput": "Ввод",
"priceOutput": "Вывод",
"pricePerRequest": "Запрос",
"cacheReadPrice": "Чтение кэша ($/M)",
"cacheCreationPrice": "Создание кэша ($/M)",
"cache5m": "5m",
"cache1h": "1h+",
"copyModelId": "Скопировать ID модели",
"updatedAt": "Обновлено",
"actions": "Действия",
"typeChat": "Чат",
Expand Down Expand Up @@ -651,6 +660,8 @@
"manualDownload": "Вы также можете скачать вручную",
"latestPriceTable": "облачный прайс-лист",
"andUploadViaButton": ", и загрузить через кнопку выше",
"cloudModelCountLoading": "Загрузка количества моделей из облака...",
"cloudModelCountFailed": "Не удалось загрузить количество моделей из облака",
"supportedModels": "Поддерживается {count} моделей",
"results": {
"title": "Результаты обновления",
Expand All @@ -670,15 +681,28 @@
"editModelDescription": "Редактировать цену модели",
"deleteConfirm": "Удалить модель {name}? Это действие необратимо.",
"form": {
"modelName": "Название модели",
"modelName": "ID модели",
"modelNamePlaceholder": "например: gpt-5.2-codex",
"modelNameRequired": "Название модели обязательно",
"modelNameRequired": "ID модели обязателен",
"displayName": "Отображаемое имя (необязательно)",
"displayNamePlaceholder": "например: GPT-5.2 Codex",
"type": "Тип",
"provider": "Поставщик",
"providerPlaceholder": "например: openai",
"requestPrice": "Цена за вызов ($/request)",
"inputPrice": "Цена ввода ($/M токенов)",
"outputPrice": "Цена вывода ($/M токенов)",
"outputPriceImage": "Цена вывода ($/изображение)"
"outputPriceImage": "Цена вывода ($/изображение)",
"cacheReadPrice": "Цена чтения кэша ($/M токенов)",
"cacheCreationPrice5m": "Цена создания кэша (5m, $/M токенов)",
"cacheCreationPrice1h": "Цена создания кэша (1h+, $/M токенов)"
},
"drawer": {
"prefillLabel": "Поиск существующих моделей для автозаполнения",
"prefillEmpty": "Модели не найдены",
"prefillFailed": "Ошибка поиска",
"promptCachingHint": "Включайте только если модель поддерживает кэширование, и задайте цены кэша ниже",
"cachePricingTitle": "Цены кэша"
},
"actions": {
"edit": "Редактировать",
Expand Down
30 changes: 27 additions & 3 deletions messages/zh-CN/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1335,8 +1335,17 @@
"modelName": "模型名称",
"provider": "提供商",
"capabilities": "能力",
"price": "价格",
"inputPrice": "输入价格 ($/M)",
"outputPrice": "输出价格 ($/M)",
"priceInput": "输入",
"priceOutput": "输出",
"pricePerRequest": "按次",
"cacheReadPrice": "缓存读取 ($/M)",
"cacheCreationPrice": "缓存创建 ($/M)",
"cache5m": "5m",
"cache1h": "1h+",
"copyModelId": "复制模型 ID",
"updatedAt": "更新时间",
"actions": "操作",
"typeChat": "对话",
Expand Down Expand Up @@ -1379,6 +1388,8 @@
"manualDownload": "你也可以手动下载",
"latestPriceTable": "云端价格表",
"andUploadViaButton": ",并通过上方按钮上传",
"cloudModelCountLoading": "云端模型数量加载中...",
"cloudModelCountFailed": "云端模型数量加载失败",
"supportedModels": "当前支持 {count} 个模型",
"results": {
"title": "更新结果",
Expand All @@ -1398,15 +1409,28 @@
"editModelDescription": "编辑模型的价格配置",
"deleteConfirm": "确定要删除模型 {name} 吗?此操作不可撤销。",
"form": {
"modelName": "模型名称",
"modelName": "模型 ID",
"modelNamePlaceholder": "例如: gpt-5.2-codex",
"modelNameRequired": "模型名称不能为空",
"modelNameRequired": "模型 ID 不能为空",
"displayName": "展示名称(可选)",
"displayNamePlaceholder": "例如: GPT-5.2 Codex",
"type": "类型",
"provider": "供应商",
"providerPlaceholder": "例如: openai",
"requestPrice": "按次调用价格 ($/request)",
"inputPrice": "输入价格 ($/M tokens)",
"outputPrice": "输出价格 ($/M tokens)",
"outputPriceImage": "输出价格 ($/image)"
"outputPriceImage": "输出价格 ($/image)",
"cacheReadPrice": "缓存读取价格 ($/M tokens)",
"cacheCreationPrice5m": "缓存创建价格(5m,$/M tokens)",
"cacheCreationPrice1h": "缓存创建价格(1h+,$/M tokens)"
},
"drawer": {
"prefillLabel": "搜索现有模型并预填充",
"prefillEmpty": "未找到匹配的模型",
"prefillFailed": "搜索失败",
"promptCachingHint": "仅当模型支持缓存时开启,并配置下方缓存价格",
"cachePricingTitle": "缓存价格"
},
"actions": {
"edit": "编辑",
Expand Down
30 changes: 27 additions & 3 deletions messages/zh-TW/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,17 @@
"modelName": "模型名稱",
"provider": "提供商",
"capabilities": "能力",
"price": "價格",
"inputPrice": "輸入價格 ($/M)",
"outputPrice": "輸出價格 ($/M)",
"priceInput": "輸入",
"priceOutput": "輸出",
"pricePerRequest": "按次",
"cacheReadPrice": "快取讀取 ($/M)",
"cacheCreationPrice": "快取建立 ($/M)",
"cache5m": "5m",
"cache1h": "1h+",
"copyModelId": "複製模型 ID",
Comment on lines +610 to +620
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

建议与英文保持相同的“1h+”语义标注

当前表格为 cache1h: "1h+",但表单字段 cacheCreationPrice1h 文案是“1h”;若确实表示 “1h 以上”阶梯价,建议同步改成“1h+”以对齐。

Also applies to: 663-664, 684-699, 701-706

🤖 Prompt for AI Agents
In @messages/zh-TW/settings.json around lines 610 - 620, The translation for the
1-hour cache tier is inconsistent: the key cache1h is "1h+" but related form
labels like cacheCreationPrice1h (and the same pattern at the other mentioned
ranges) show "1h" — update the displayed strings so meaning is consistent (use
"1h+" everywhere if the tier means "1 hour or more"); locate and change the
values for cache1h, cacheCreationPrice1h and the duplicated entries at the
referenced ranges (lines ~663-664, 684-699, 701-706) to use the same "1h+"
wording so the UI and form labels match.

"updatedAt": "更新時間",
"actions": "操作",
"typeChat": "對話",
Expand Down Expand Up @@ -651,6 +660,8 @@
"manualDownload": "你也可以手動下載",
"latestPriceTable": "雲端價格表",
"andUploadViaButton": ",並透過上方按鈕上傳",
"cloudModelCountLoading": "雲端模型數量載入中...",
"cloudModelCountFailed": "雲端模型數量載入失敗",
"supportedModels": "目前支援 {count} 個模型",
"results": {
"title": "更新結果",
Expand All @@ -670,15 +681,28 @@
"editModelDescription": "編輯模型的價格設定",
"deleteConfirm": "確定要刪除模型 {name} 嗎?此操作無法復原。",
"form": {
"modelName": "模型名稱",
"modelName": "模型 ID",
"modelNamePlaceholder": "例如: gpt-5.2-codex",
"modelNameRequired": "模型名稱為必填",
"modelNameRequired": "模型 ID 為必填",
"displayName": "顯示名稱(選填)",
"displayNamePlaceholder": "例如: GPT-5.2 Codex",
"type": "類型",
"provider": "提供商",
"providerPlaceholder": "例如: openai",
"requestPrice": "按次呼叫價格 ($/request)",
"inputPrice": "輸入價格 ($/M tokens)",
"outputPrice": "輸出價格 ($/M tokens)",
"outputPriceImage": "輸出價格 ($/張圖)"
"outputPriceImage": "輸出價格 ($/張圖)",
"cacheReadPrice": "快取讀取價格 ($/M tokens)",
"cacheCreationPrice5m": "快取建立價格(5m,$/M tokens)",
"cacheCreationPrice1h": "快取建立價格(1h+,$/M tokens)"
},
"drawer": {
"prefillLabel": "搜尋現有模型並預填充",
"prefillEmpty": "未找到匹配的模型",
"prefillFailed": "搜尋失敗",
"promptCachingHint": "僅當模型支援快取時開啟,並配置下方快取價格",
"cachePricingTitle": "快取價格"
},
"actions": {
"edit": "編輯",
Expand Down
37 changes: 37 additions & 0 deletions src/actions/model-prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,17 @@ export async function syncLiteLLMPrices(
*/
export interface SingleModelPriceInput {
modelName: string;
displayName?: string;
mode: "chat" | "image_generation" | "completion";
litellmProvider?: string;
supportsPromptCaching?: boolean;
inputCostPerToken?: number;
outputCostPerToken?: number;
outputCostPerImage?: number;
inputCostPerRequest?: number;
cacheReadInputTokenCost?: number;
cacheCreationInputTokenCost?: number;
cacheCreationInputTokenCostAbove1hr?: number;
}

/**
Expand Down Expand Up @@ -496,14 +502,45 @@ export async function upsertSingleModelPrice(
) {
return { ok: false, error: "图片价格必须为非负数" };
}
if (
input.inputCostPerRequest !== undefined &&
(input.inputCostPerRequest < 0 || !Number.isFinite(input.inputCostPerRequest))
) {
return { ok: false, error: "按次调用价格必须为非负数" };
}
if (
input.cacheReadInputTokenCost !== undefined &&
(input.cacheReadInputTokenCost < 0 || !Number.isFinite(input.cacheReadInputTokenCost))
) {
return { ok: false, error: "缓存读取价格必须为非负数" };
}
if (
input.cacheCreationInputTokenCost !== undefined &&
(input.cacheCreationInputTokenCost < 0 || !Number.isFinite(input.cacheCreationInputTokenCost))
) {
return { ok: false, error: "缓存创建价格必须为非负数" };
}
if (
input.cacheCreationInputTokenCostAbove1hr !== undefined &&
(input.cacheCreationInputTokenCostAbove1hr < 0 ||
!Number.isFinite(input.cacheCreationInputTokenCostAbove1hr))
) {
return { ok: false, error: "缓存创建(1h)价格必须为非负数" };
}

// 构建价格数据
const priceData: ModelPriceData = {
mode: input.mode,
display_name: input.displayName?.trim() || undefined,
litellm_provider: input.litellmProvider || undefined,
supports_prompt_caching: input.supportsPromptCaching,
input_cost_per_token: input.inputCostPerToken,
output_cost_per_token: input.outputCostPerToken,
output_cost_per_image: input.outputCostPerImage,
input_cost_per_request: input.inputCostPerRequest,
cache_read_input_token_cost: input.cacheReadInputTokenCost,
cache_creation_input_token_cost: input.cacheCreationInputTokenCost,
cache_creation_input_token_cost_above_1hr: input.cacheCreationInputTokenCostAbove1hr,
};

// 执行更新
Expand Down
Loading
Loading