What you control
When an agent can spend, the important question is not just “can it pay?” It is “can it pay within the rules I set?” You should control:- which wallet funds the agent;
- which networks and assets it can use;
- which sellers, agents, or domains it can pay;
- how much it can spend per request, task, route, or time window;
- whether larger payments require approval;
- when the agent should stop, ask for help, or choose a cheaper option;
- how payments connect to task logs and delivered results.
Set up your agent
1
Create a dedicated wallet
Use a wallet for the agent or application, not your main wallet. Keep automated signing separate from personal funds.
2
Deposit collateral
Deposit ETH or a supported into 4Mica on the network your target sellers accept.
3
Register the client scheme
Configure the 4Mica client for each network the agent may use.
4
Define spending policy
Set limits for amount, seller, route, network, task, time window, and approval requirements.
5
Make paid requests
Use a wrapped HTTP client so the agent can handle paid resources while Your policy decides which payments to sign.
6
Audit the task
Record each payment with the seller, route, amount, reason, guarantee ID, request ID, and task result.
Make a Paid Request
@x402/fetch only pays in assets its scheme client recognises. FourMicaEvmScheme recognises whatever 4Mica core lists for the network, so the seller’s advertised USDC passes the client’s spend controls and the default $1 per-payment cap applies. Pass spendControls to raise the cap or allow other assets.Before the agent pays
Your agent should inspect the seller’s payment requirements and decide:- is this seller or domain allowed?
- is the price within budget?
- is the network and asset allowed?
- does the payment match the task?
- does the agent need human approval first?
- should the agent continue, stop, or choose another seller?
After the agent pays
Every paid request should produce a record that explains what happened:- which agent paid;
- which seller received the payment;
- how much was authorized;
- why the payment happened;
- which task or request it belongs to;
- what result came back;
- whether the guarantee or settlement obligation is still open.