Add web search fee notice for OpenRouter Closes #3833

22f1aee70b2dd7600b20cd6de67693a9379df7f4

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

2 files changed, +9 -0Ignore whitespace
public/index.html+3 -0
@@ -1963,6 +1963,9 @@
1963 <span data-i18n="Use search capabilities provided by the backend.">1963 <span data-i18n="Use search capabilities provided by the backend.">
1964 Use search capabilities provided by the backend.1964 Use search capabilities provided by the backend.
1965 </span>1965 </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>
1966 </div>1969 </div>
1967 </div>1970 </div>
1968 <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21,xai">1971 <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() {
1693 }1693 }
1694 }1694 }
16951695
1696 if (oai_settings.enable_web_search) {
1697 const webSearchCost = (0.02).toFixed(2);
1698 cost = t`${cost} + $${webSearchCost}`;
1699 }
1700
1696 $('#openrouter_max_prompt_cost').text(cost);1701 $('#openrouter_max_prompt_cost').text(cost);
1697}1702}
16981703
@@ -5700,6 +5705,7 @@ export function initOpenAI() {
57005705
5701 $('#openai_enable_web_search').on('input', function () {5706 $('#openai_enable_web_search').on('input', function () {
5702 oai_settings.enable_web_search = !!$(this).prop('checked');5707 oai_settings.enable_web_search = !!$(this).prop('checked');
5708 calculateOpenRouterCost();
5703 saveSettingsDebounced();5709 saveSettingsDebounced();
5704 });5710 });
57055711