Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Add BU3 pricing rows
MagMueller6caf43e5a944
diff --git a/browser_use/tokens/custom_pricing.py b/browser_use/tokens/custom_pricing.pyindex cab127103..037e58313 100644--- a/browser_use/tokens/custom_pricing.py+++ b/browser_use/tokens/custom_pricing.py@@ -27,6 +27,24 @@ CUSTOM_MODEL_PRICING: dict[str, dict[str, Any]] = {'max_input_tokens': None, # Not specified'max_output_tokens': None, # Not specified},+ 'bu-3': {+ 'input_cost_per_token': 2.00 / 1_000_000, # $2.00 per 1M tokens+ 'output_cost_per_token': 11.00 / 1_000_000, # $11.00 per 1M tokens+ 'cache_read_input_token_cost': 0.20 / 1_000_000, # $0.20 per 1M tokens+ 'cache_creation_input_token_cost': None, # Not charged+ 'max_tokens': None, # Not specified+ 'max_input_tokens': None, # Not specified+ 'max_output_tokens': None, # Not specified+ },+ 'bu-3-max': {+ 'input_cost_per_token': 2.50 / 1_000_000, # $2.50 per 1M tokens+ 'output_cost_per_token': 50.00 / 1_000_000, # $50.00 per 1M tokens+ 'cache_read_input_token_cost': 0.25 / 1_000_000, # $0.25 per 1M tokens+ 'cache_creation_input_token_cost': None, # Not charged+ 'max_tokens': None, # Not specified+ 'max_input_tokens': None, # Not specified+ 'max_output_tokens': None, # Not specified+ },'claude-sonnet-4-6': {'input_cost_per_token': 3.00 / 1_000_000,'output_cost_per_token': 15.00 / 1_000_000,diff --git a/tests/ci/test_openrouter_token_cost.py b/tests/ci/test_openrouter_token_cost.pyindex defafe367..711e4ae61 100644--- a/tests/ci/test_openrouter_token_cost.py+++ b/tests/ci/test_openrouter_token_cost.py@@ -3,6 +3,7 @@ import pytestfrom browser_use.llm.openrouter.chat import ChatOpenRouterfrom browser_use.llm.views import ChatInvokeUsagefrom browser_use.tokens import openrouter_pricing+from browser_use.tokens.custom_pricing import CUSTOM_MODEL_PRICINGfrom browser_use.tokens.openrouter_pricing import model_pricing_from_openrouter_metadatafrom browser_use.tokens.service import TokenCostfrom browser_use.tokens.views import ModelPricing@@ -36,6 +37,23 @@ def test_model_pricing_from_openrouter_metadata() -> None:assert pricing.max_output_tokens == 16_384+ ('model', 'input_cost', 'output_cost', 'cache_read_cost'),+ [+ ('bu-3', 2.00, 11.00, 0.20),+ ('bu-3-max', 2.50, 50.00, 0.25),+ ],+)+def test_custom_browser_use_pricing_includes_bu3_models(+ model: str, input_cost: float, output_cost: float, cache_read_cost: float+) -> None:+ pricing = CUSTOM_MODEL_PRICING[model]++ assert pricing['input_cost_per_token'] == pytest.approx(input_cost / 1_000_000)+ assert pricing['output_cost_per_token'] == pytest.approx(output_cost / 1_000_000)+ assert pricing['cache_read_input_token_cost'] == pytest.approx(cache_read_cost / 1_000_000)++async def test_openrouter_pricing_accepts_litellm_prefixed_model_ids(monkeypatch: pytest.MonkeyPatch) -> None:async def fake_get_openrouter_models_metadata(refresh: bool = False) -> dict[str, dict]:return {'deepseek/deepseek-v4-flash': _openrouter_metadata()}