x402 is a payment protocol created by Coinbase that lets APIs, or AI agents, charge for requests directly with crypto. x402 lets your code, or an autonomous AI agent, pay Browser Use Cloud directly with cryptocurrency. No account signup, no credit card, and no API key is needed. Your wallet is your identity.Documentation Index
Fetch the complete documentation index at: https://browseruse-0aece648-x402-sdk.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
New to crypto? Here’s the gist:
- USDC is a stablecoin pegged 1:1 to the US dollar. 1 USDC = $1.
- Base is a low-fee blockchain network operated by Coinbase. Sending a payment costs fractions of a cent.
- Wallet = a public address (your “username”) and a private key (your “password”). The private key signs payments.
- You’ll need at least $5 of USDC on Base in a wallet you control. The Claude Code quickstart below walks you through everything from scratch.
Claude Code
One command. Claude does the wallet setup, funding walkthrough, and verification for you.
SDK
One line in your Python or TypeScript app. Bring your own wallet.
Raw HTTP
Skip the SDK. Sign EIP-3009, send
X-PAYMENT header.Claude Code quickstart
The fastest path. Install the x402 skill, and Claude walks you through everything:BROWSER_USE_X402_PRIVATE_KEY to your .env, installs the SDK, and runs a verification task. Total: ~2 minutes if you have a Coinbase account.
SDK quickstart
The Browser Use SDK has built-in x402 support. Pass a wallet private key, and you’re done.BROWSER_USE_X402_PRIVATE_KEY in your env, and skip the constructor arg entirely:
Python: x402 is async-only. Use
AsyncBrowserUse, not BrowserUse.Raw HTTP quickstart
Use this if you’re in a language we don’t ship an SDK for (Go, Rust, Ruby, etc.), or if you want to use other x402 APIs from the same client library. Hithttps://x402.api.browser-use.com directly with any x402 client library:
https://x402.api.browser-use.com exposes the same routes as https://api.browser-use.com. It supports every /api/v2/* and /api/v3/* route, gated by an x402 challenge instead of API key auth.
What you need
- EVM wallet (MetaMask, Rabby, Coinbase Wallet, etc.) with its private key available to your app
- USD Coin (USDC) on Base mainnet
- Default top-up:
$5.00USDC per request ($1.00minimum for budget-constrained wallets)
No wallet yet? Jump to Wallet setup below.
Pricing and credits
Each x402 payment adds$5 of credits to your project by default (or $1 if your wallet falls back to the smaller option). When credits hit zero, the next request returns 402, and the SDK automatically signs another payment to keep going. You don’t manage top-ups manually; just make sure your wallet has enough USDC for your expected usage.
See the pricing page for model and browser costs.
Topping up an existing account
If you already have a Browser Use API key (for example, one created viabrowser-use cloud signup or the dashboard), you can use x402 to add credits to that account instead of creating a new project based on your crypto wallet. Send your existing API key alongside the payment:
- Agents that ran out of free-tier credits and need to keep going
- Adding credits via crypto when you already have a regular Browser Use account
- Multi-wallet setups funding one shared account
How it works
Your code asks for something, we say “$5 please”, your wallet pays automatically, we run your request. A bit more detail:- Your code makes a request (e.g. “run this task”).
- If your project has no credits, we respond with “Payment required: 1` as a fallback for smaller wallets).
- The SDK auto-signs the payment from your wallet and resends the request.
- Coinbase moves the USDC on-chain. We add the same amount to your project’s credit balance.
- We run your task and send back the result.
Wallet setup
If you don’t have a wallet ready, here’s one easy path. We use MetaMask below. It’s a popular crypto wallet (think of it as an in-browser app for holding crypto and signing payments). Any other EVM-compatible wallet works equally well: Rabby, Coinbase Wallet, Frame, Trust Wallet, Phantom, etc. Pick whichever you prefer.Install MetaMask (or your wallet of choice)
Get the MetaMask browser extension via the official site only. Create a new wallet, save the seed phrase somewhere offline, set a password.
Add the Base network
By default, most wallets only show Ethereum. You need to add Base (the network we accept payments on) so your wallet can hold USDC there.
Get USDC into your wallet on Base
Click “Buy” inside MetaMask. Pick USDC, set network to Base, and pay with credit card, bank, etc. The USDC lands directly in your wallet.
Advanced: bring your own x402 client
For custom signers, multi-network setups, or non-EVM wallets, build the x402 client yourself, and pass it asx402 instead of x402_private_key:
Troubleshooting
HTTP 402 keeps coming back, never settles
HTTP 402 keeps coming back, never settles
Two likely causes:
- Wallet has no USDC on Base. Check your balance. If empty, top it up.
- Your HTTP client isn’t x402-aware. Plain
requests/fetchjust sees a 402 and stops; it doesn’t know how to read the payment instructions and sign a payment. Use the SDK (which handles this automatically) or wrap your HTTP client with one of the x402 client libraries.
ImportError / Cannot find module '@x402/fetch'
ImportError / Cannot find module '@x402/fetch'
You haven’t installed the optional x402 deps. Run
pip install "browser-use-sdk[x402]" (Python) or npm install @x402/fetch @x402/evm viem (TypeScript).HTTP 500 with "payment was settled but processing failed"
HTTP 500 with "payment was settled but processing failed"
The on-chain payment may or may not have settled — contact support with your wallet address. This is very rare.
Insufficient credits despite paying
Insufficient credits despite paying
Wait a few seconds. Settlement and credit grant happen in the same request, but the response may be sent before the credit grant fully commits. If credits still show
$0 after a few minutes, contact support.Wallet on the wrong network
Wallet on the wrong network
eip155:8453 is Base mainnet; eip155:84532 is Base Sepolia testnet. Browser Use Cloud only accepts mainnet. Withdrawing USDC to Sepolia from Coinbase is not the same as Base mainnet, even though both use the same wallet address.Related
- x402 protocol spec
- Standard API key auth — alternative if you don’t want pay-per-use
x402Claude Code skill source