Update Session Cost Cap
Update the active run cap without starting another run.
PATCH
/
sessions
/
{session_id}
/
cost-cap
Update Session Cost Cap
const options = {
method: 'PATCH',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({maxCostUsd: 1})
};
fetch('https://api.browser-use.com/api/v4/sessions/{session_id}/cost-cap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.browser-use.com/api/v4/sessions/{session_id}/cost-cap \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"maxCostUsd": 1
}
'import requests
url = "https://api.browser-use.com/api/v4/sessions/{session_id}/cost-cap"
payload = { "maxCostUsd": 1 }
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"maxCostUsd": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Body
application/json
Set the maximum spend for the active run in a session.
Required range:
x > 0Was this page helpful?
⌘I
Update Session Cost Cap
const options = {
method: 'PATCH',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({maxCostUsd: 1})
};
fetch('https://api.browser-use.com/api/v4/sessions/{session_id}/cost-cap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.browser-use.com/api/v4/sessions/{session_id}/cost-cap \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"maxCostUsd": 1
}
'import requests
url = "https://api.browser-use.com/api/v4/sessions/{session_id}/cost-cap"
payload = { "maxCostUsd": 1 }
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"maxCostUsd": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}