Add web search fee notice for OpenRouter

Closes #3833
This commit is contained in:
Cohee
2025-04-13 14:15:49 +03:00
parent 35395fcb39
commit 22f1aee70b
2 changed files with 9 additions and 0 deletions

View File

@ -1963,6 +1963,9 @@
<span data-i18n="Use search capabilities provided by the backend."> <span data-i18n="Use search capabilities provided by the backend.">
Use search capabilities provided by the backend. Use search capabilities provided by the backend.
</span> </span>
<b data-source="openrouter" data-i18n="openrouter_web_search_fee">
Not free, adds a $0.02 fee to each prompt.
</b>
</div> </div>
</div> </div>
<div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai"> <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai">

View File

@ -1693,6 +1693,11 @@ function calculateOpenRouterCost() {
} }
} }
if (oai_settings.enable_web_search) {
const webSearchCost = (0.02).toFixed(2);
cost = t`${cost} + $${webSearchCost}`;
}
$('#openrouter_max_prompt_cost').text(cost); $('#openrouter_max_prompt_cost').text(cost);
} }
@ -5700,6 +5705,7 @@ export function initOpenAI() {
$('#openai_enable_web_search').on('input', function () { $('#openai_enable_web_search').on('input', function () {
oai_settings.enable_web_search = !!$(this).prop('checked'); oai_settings.enable_web_search = !!$(this).prop('checked');
calculateOpenRouterCost();
saveSettingsDebounced(); saveSettingsDebounced();
}); });