Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
JavaScript
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>" } ] }
Update the active run cap without starting another run.
Set the maximum spend for the active run in a session.
x > 0
Successful Response
Was this page helpful?