Add web search fee notice for OpenRouter Closes #3833

22f1aee70b2dd7600b20cd6de67693a9379df7f4

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +9 -0Showing whitespace changes
public/index.html+3 -0
@@ -1963,6 +1963,9 @@
19631963 <span data-i18n="Use search capabilities provided by the backend.">
19641964 Use search capabilities provided by the backend.
19651965 </span>
1966+ <b data-source="openrouter" data-i18n="openrouter_web_search_fee">
1967+ Not free, adds a $0.02 fee to each prompt.
1968+ </b>
19661969 </div>
19671970 </div>
19681971 <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai">
public/scripts/openai.js+6 -0
@@ -1693,6 +1693,11 @@ function calculateOpenRouterCost() {
16931693 }
16941694 }
16951695
1696+ if (oai_settings.enable_web_search) {
1697+ const webSearchCost = (0.02).toFixed(2);
1698+ cost = t`${cost} + $${webSearchCost}`;
1699+ }
1700+
16961701 $('#openrouter_max_prompt_cost').text(cost);
16971702}
16981703
@@ -5700,6 +5705,7 @@ export function initOpenAI() {
57005705
57015706 $('#openai_enable_web_search').on('input', function () {
57025707 oai_settings.enable_web_search = !!$(this).prop('checked');
5708+ calculateOpenRouterCost();
57035709 saveSettingsDebounced();
57045710 });
57055711