Errors
The shape
Section titled “The shape”Errors have FastAPI’s shape, as Browser Use returns them. Most carry a code and a message:
{ "detail": { "message": "This organization's balance is spent. Add credits in Billing", "code": "balance_exhausted" } }A body that does not validate returns 422 with a list of the fields at fault:
{ "detail": [{ "loc": ["body", "timeout"], "msg": "Too big: expected number to be <=240", "type": "too_big" }] }A 404 for an id that does not exist in your organization has a plain string:
{ "detail": "Session not found" }Match on the status and the code; the message is for people and can change. Where a row below names two statuses
or codes, either can be returned for the same cause: handle both.
The Browser Use SDKs raise BrowserUseError with the status and the message, and retry a 429 by themselves (three
times by default).
Every request
Section titled “Every request”| Status | Code | When | What to do |
|---|---|---|---|
401 |
unauthorized |
No key, a key that does not exist, or one that was revoked | Send a secret key in X-Browser-Use-API-Key or Authorization: Bearer |
403 or 401 |
secret_key_required or unauthorized |
A publishable key | Use a secret key (sk_…) |
404 |
none | No such browser, profile, policy or extension in your organization, or no such route | Check the id and the path |
422 |
none (a list) | A body or a value that does not validate | Fix the fields the list names |
422 |
invalid_request |
A stop or a proxy change whose body is not what the route takes | Send the body the route documents |
503 |
unavailable |
BrowserReal cannot take the request right now | Retry in a few seconds |
Creating a browser
Section titled “Creating a browser”POST /browsers, and a profile import, which starts one.
| Status | Code | When | What to do |
|---|---|---|---|
402 |
balance_exhausted |
The balance is spent | Add credits, or turn on auto recharge, on Billing |
404 |
profile_not_found, network_policy_not_found, extension_not_found |
The create request names one that does not exist | Check the id |
409 |
profile_in_use |
The profile is being imported into. A profile that other browsers run on is not an error: the request starts another browser, shared live with them | Try again in a moment |
409 |
starting |
Another create request with the same Idempotency-Key is still starting its browser |
Retry in a second |
422 |
unsupported |
A customProxy that asks for caBundle, caBundleUrl or ignoreCertErrors, is not on a public address, has a username without a password, or SOCKS5 credentials over 255 bytes |
Change the proxy settings |
422 |
invalid_country |
proxyCountryCode is not a country code |
Send an ISO code in lower case ("de") |
422 |
extensions_too_large |
The extensions named are over 512 MB unzipped, together | Name fewer |
429 |
too_many_sessions |
Your tier’s live browsers are all running. May come with Retry-After |
Wait for one to stop, or stop one |
429 or 503 |
no_capacity or browser_capacity |
No machine is free right now | Retry in a minute |
503 |
proxy_pool_empty |
No residential address in that country passed its check in time. Comes with Retry-After: 5 |
Retry after that many seconds: see Proxies |
503 |
start_failed |
The browser did not start | Retry |
Stopping a browser
Section titled “Stopping a browser”A stop that is not carried out is not an error: it returns 200 with the browser, still active, and a
stopRefused message. See Stop a browser.
| Status | Code | When | What to do |
|---|---|---|---|
409 |
starting |
The browser is still starting | Stop it again in a moment |
Changing a proxy
Section titled “Changing a proxy”GET and PATCH /browsers/{id}/proxy.
| Status | Code | When | What to do |
|---|---|---|---|
409 |
proxy_unavailable |
The browser is not running, or residential proxies cannot be had right now | Start a browser, or retry |
409 |
proxy_busy |
Another change for this browser is under way | Retry in a moment |
409 |
mode_required |
The browser is on a custom proxy, or has no residential proxy to rotate, and the change names no mode |
Send "mode" with the change |
422 |
invalid_change |
A custom proxy with a country, target, rotate or sticky; customProxy without "mode": "custom"; sticky without a residential proxy; nothing to change |
Send one of the bodies in Proxies |
422 |
invalid_country |
country is not a country code |
Send an ISO code in lower case |
502 |
proxy_failed |
The browser’s machine did not confirm the change | Retry; the proxy it had still applies |
503 |
proxy_pool_empty |
No residential address in that country passed its check in time. Comes with Retry-After: 5 |
Retry after that many seconds |
Profiles
Section titled “Profiles”| Status | Code | When | What to do |
|---|---|---|---|
402 |
profile_limit |
The organization has 100 profiles | Delete one |
404 |
profile_not_found |
An import into a profile that does not exist | Check the id |
409 |
profile_in_use |
Deleting or importing into a profile that live browsers run on | Stop those browsers first |
400 |
empty |
An import without a body or its Content-Length |
Send the file as the body |
422 |
unknown_kind |
An import whose content type is neither zip nor JSON | Send Content-Type, or ?kind=folder or ?kind=state |
422 |
too_large |
An import over 50 MB, or a storage state over 20 MB | Leave the caches out of the zip |
422 |
not_a_storage_state |
The JSON is not what storage_state() writes |
Export it again |
422 |
import_failed |
The upload could not be applied (a zip without a profile, a broken state) | Check the file |
Network policies
Section titled “Network policies”| Status | Code | When | What to do |
|---|---|---|---|
422 |
invalid_domain |
An entry that is not a domain (a URL, a path, a port, an IP address, a wildcard other than a leading *.), or a domain in both lists |
Fix the entry the message names |
422 |
too_many_domains |
Over 10,000 domains in a policy, allow and block together | Shorten the lists |
422 |
too_many_policies |
The organization has 100 policies | Delete one |
Extensions
Section titled “Extensions”| Status | Code | When | What to do |
|---|---|---|---|
413 |
too_large |
A zip over 100 MB | Make it smaller |
422 |
invalid_extension |
Not a zip, no manifest.json at its root, not Manifest V3, no name or version, over 256 MB or 10,000 files unzipped |
The message says which |
422 |
prohibited_key |
The manifest has a key |
Remove it |
422 |
prohibited_permission |
The manifest asks for debugger, proxy, processes, dns, experimental or enterprise.* |
Remove the permission |
422 |
too_many_extensions |
The organization has 100 extensions | Delete one |
503 |
unavailable |
The zip could not be stored or deleted | Retry |