Get Session Cost
Everything this session has cost so far, split by source.
A run’s total_cost_usd is its LLM (and web-search) charge only. Browser
time and proxy bandwidth are metered against the session’s browser, which
outlives any one run — so this is the endpoint for the session’s full cost.
These are recorded usage costs, not an invoice total: promotional waivers and credits are applied downstream in billing, so a session run under a promotion can report cost here that was never charged.
Costs keep moving after a run reports finished: LLM calls settle up to
about 90 seconds later, and the browser accrues time and proxy traffic
until it stops.
const options = {method: 'GET', headers: {'X-Browser-Use-API-Key': '<api-key>'}};
fetch('https://api.browser-use.com/api/v4/sessions/{session_id}/cost', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.browser-use.com/api/v4/sessions/{session_id}/cost \
--header 'X-Browser-Use-API-Key: <api-key>'import requests
url = "https://api.browser-use.com/api/v4/sessions/{session_id}/cost"
headers = {"X-Browser-Use-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"numRuns": 123,
"llmCostUsd": "<string>",
"searchCostUsd": "<string>",
"browserCostUsd": "<string>",
"proxyCostUsd": "<string>",
"proxyUsedMb": "<string>",
"totalCostUsd": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Response
Successful Response
Everything a session cost, split by what it was spent on.
Recorded usage, not an invoice total — promotional waivers and credits are applied downstream in billing.
Browser time and proxy bandwidth are metered against the session's browser,
which outlives any single run, so they have no per-run number — only
RunSummary.total_cost_usd, the LLM (and web search) charge, does.
All amounts are fixed-6-decimal strings for the same reason as
RunSummary.total_cost_usd: JS clients lose precision on float.
Was this page helpful?
const options = {method: 'GET', headers: {'X-Browser-Use-API-Key': '<api-key>'}};
fetch('https://api.browser-use.com/api/v4/sessions/{session_id}/cost', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.browser-use.com/api/v4/sessions/{session_id}/cost \
--header 'X-Browser-Use-API-Key: <api-key>'import requests
url = "https://api.browser-use.com/api/v4/sessions/{session_id}/cost"
headers = {"X-Browser-Use-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"numRuns": 123,
"llmCostUsd": "<string>",
"searchCostUsd": "<string>",
"browserCostUsd": "<string>",
"proxyCostUsd": "<string>",
"proxyUsedMb": "<string>",
"totalCostUsd": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}