{i18next.t( '输入价格:{{symbol}}{{price}} / 1M tokens{{audioPrice}}', { symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), audioPrice: audioInputSeperatePrice ? i18next.t(',音频 {{symbol}}{{price}} / 1M tokens', { symbol, price: (audioInputPrice * rate).toFixed(6), }) : '', }, )}
{i18next.t( '输出价格:{{symbol}}{{price}} * {{completionRatio}} = {{symbol}}{{total}} / 1M tokens (补全倍率: {{completionRatio}})', { symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), total: (completionRatioPrice * rate).toFixed(6), completionRatio: completionRatio, }, )}
{cacheTokens > 0 && ({i18next.t( '缓存价格:{{symbol}}{{price}} * {{cacheRatio}} = {{symbol}}{{total}} / 1M tokens (缓存倍率: {{cacheRatio}})', { symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), total: (inputRatioPrice * cacheRatio * rate).toFixed(6), cacheRatio: cacheRatio, }, )}
)} {image && imageOutputTokens > 0 && ({i18next.t( '图片输入价格:{{symbol}}{{price}} * {{ratio}} = {{symbol}}{{total}} / 1M tokens (图片倍率: {{imageRatio}})', { symbol: symbol, price: (imageRatioPrice * rate).toFixed(6), ratio: groupRatio, total: (imageRatioPrice * groupRatio * rate).toFixed(6), imageRatio: imageRatio, }, )}
)} {webSearch && webSearchCallCount > 0 && ({i18next.t('Web搜索价格:{{symbol}}{{price}} / 1K 次', { symbol: symbol, price: (webSearchPrice * rate).toFixed(6), })}
)} {fileSearch && fileSearchCallCount > 0 && ({i18next.t('文件搜索价格:{{symbol}}{{price}} / 1K 次', { symbol: symbol, price: (fileSearchPrice * rate).toFixed(6), })}
)} {imageGenerationCall && imageGenerationCallPrice > 0 && ({i18next.t('图片生成调用:{{symbol}}{{price}} / 1次', { symbol: symbol, price: (imageGenerationCallPrice * rate).toFixed(6), })}
)}{(() => { // 构建输入部分描述 let inputDesc = ''; if (image && imageOutputTokens > 0) { inputDesc = i18next.t( '(输入 {{nonImageInput}} tokens + 图片输入 {{imageInput}} tokens * {{imageRatio}} / 1M tokens * {{symbol}}{{price}}', { nonImageInput: inputTokens >= imageOutputTokens ? inputTokens - imageOutputTokens : inputTokens, imageInput: imageOutputTokens, imageRatio: imageRatio, symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), }, ); } else if (cacheTokens > 0) { inputDesc = i18next.t( '(输入 {{nonCacheInput}} tokens / 1M tokens * {{symbol}}{{price}} + 缓存 {{cacheInput}} tokens / 1M tokens * {{symbol}}{{cachePrice}}', { nonCacheInput: inputTokens >= cacheTokens ? inputTokens - cacheTokens : inputTokens, cacheInput: cacheTokens, symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), cachePrice: (cacheRatioPrice * rate).toFixed(6), }, ); } else if (audioInputSeperatePrice && audioInputTokens > 0) { inputDesc = i18next.t( '(输入 {{nonAudioInput}} tokens / 1M tokens * {{symbol}}{{price}} + 音频输入 {{audioInput}} tokens / 1M tokens * {{symbol}}{{audioPrice}}', { nonAudioInput: inputTokens >= audioInputTokens ? inputTokens - audioInputTokens : inputTokens, audioInput: audioInputTokens, symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), audioPrice: (audioInputPrice * rate).toFixed(6), }, ); } else { inputDesc = i18next.t( '(输入 {{input}} tokens / 1M tokens * {{symbol}}{{price}}', { input: inputTokens, symbol: symbol, price: (inputRatioPrice * rate).toFixed(6), }, ); } // 构建输出部分描述 const outputDesc = i18next.t( '输出 {{completion}} tokens / 1M tokens * {{symbol}}{{compPrice}}) * {{ratioType}} {{ratio}}', { completion: completionTokens, symbol: symbol, compPrice: (completionRatioPrice * rate).toFixed(6), ratio: groupRatio, ratioType: ratioLabel, }, ); // 构建额外服务描述 const extraServices = [ webSearch && webSearchCallCount > 0 ? i18next.t( ' + Web搜索 {{count}}次 / 1K 次 * {{symbol}}{{price}} * {{ratioType}} {{ratio}}', { count: webSearchCallCount, symbol: symbol, price: (webSearchPrice * rate).toFixed(6), ratio: groupRatio, ratioType: ratioLabel, }, ) : '', fileSearch && fileSearchCallCount > 0 ? i18next.t( ' + 文件搜索 {{count}}次 / 1K 次 * {{symbol}}{{price}} * {{ratioType}} {{ratio}}', { count: fileSearchCallCount, symbol: symbol, price: (fileSearchPrice * rate).toFixed(6), ratio: groupRatio, ratioType: ratioLabel, }, ) : '', imageGenerationCall && imageGenerationCallPrice > 0 ? i18next.t( ' + 图片生成调用 {{symbol}}{{price}} / 1次 * {{ratioType}} {{ratio}}', { symbol: symbol, price: (imageGenerationCallPrice * rate).toFixed(6), ratio: groupRatio, ratioType: ratioLabel, }, ) : '', ].join(''); return i18next.t( '{{inputDesc}} + {{outputDesc}}{{extraServices}} = {{symbol}}{{total}}', { inputDesc, outputDesc, extraServices, symbol: symbol, total: (price * rate).toFixed(6), }, ); })()}
{i18next.t('仅供参考,以实际扣费为准')}