x402 starter kit
Wire the decision
before the wallet.
A practical starting point for charging agents with Volance and x402: the decision payload, the trust check, a five-step test plan, and the mistakes to avoid.
The decision in one request
Your edge calls POST /api/trace/agent/decide with the path, method, and whatever evidence it already has. Volance classifies the caller, resolves the Web Bot Auth signature, applies your rules, and returns one of three decisions: allow, charge, or block.
If the decision is charge, the response carries the price and a ready x402 challenge. Your edge base64-encodes the challenge into PAYMENT-REQUIRED, returns 402, and serves the resource after the agent pays.
{
"decision": "charge",
"reason": "verified_agent",
"trust": "verified_agent",
"priceUsd": 0.002,
"settlementMode": "x402",
"paymentRequired": {
"x402Version": 2,
"accepts": [{
"scheme": "exact",
"network": "eip155:8453",
"asset": "0x8335...",
"payTo": "0xYourWallet",
"maxAmountRequired": "2000",
"resource": "/articles/premium",
"description": "Volance-priced access",
"mimeType": "text/html",
"maxTimeoutSeconds": 60
}]
}
}
maxAmountRequired is in the asset’s smallest unit. With a six-decimal stablecoin, 2000 is $0.002. The network, asset, and wallet are configured per workspace; the price is yours to set.
The trust check
Web Bot Auth is the difference between “an agent says who it is” and “this request carries a valid signature.” Volance returns the trust state separately from the score, because a verified key is authorization evidence, not proof of good intent.
| Trust state | What it means | Sensible default |
|---|---|---|
verified_agent | The signature verifies against a published key. | Charge by rule, or allow free if you want the traffic. |
unresolved_signer | A signature is present, but the key is not resolved. | Flag or charge a default price; do not treat it as verified. |
spoofed_disclosure | The claim fails verification. | Block. A bad claim is worse than no claim. |
none | No disclosure was presented. | Score the request and apply the normal policy. |
A verified signature proves control of a key. It does not prove the agent is welcome, that the user approved this exact purchase, or that the request is not abusive. Keep authentication, rate limits, and your own policy in the loop.
Five-step test plan
- Start in IOU mode. Set a small rule, such as $0.002 on one test path, with no wallet configured. Volance records what the rule would charge without moving money.
- Send a human request. Expect
allow, free. If a human is charged, the rule is too broad. - Send a verified agent request. Present a valid Web Bot Auth signature. Expect
charge, the price you set, and apaymentRequiredblock. - Send a spoofed signature. Change one signed header. Expect
trust: "spoofed_disclosure"andblock. - Switch to testnet x402. Return the 402, pay the challenge with a test wallet, verify the receipt, and confirm the edge serves the content. Do not start with production settlement.
Pitfalls
- Price units.
maxAmountRequiredis in the asset’s smallest unit, not dollars. A six-decimal stablecoin means2000is $0.002. - No wallet, no x402 charge. A
chargein x402 mode with no wallet configured returns409. Start with IOU until the wallet is ready. - Do not trust the user-agent. A string that says
GPTBotis not an identity. Verify the signed disclosure or score the request. - Do not charge everything. Humans and known good crawlers are free by default. A toll booth with one rule for every caller is a paywall, and a paywall breaks discovery.
- Do not treat a charge as a payment guarantee. The agent can fail, dispute, or disappear. Your edge owns the fallback.
What this does not do
Volance is a decision layer, not a payment processor. It does not hold funds, take a percentage of settled volume, issue refunds, or guarantee that an agent pays. The x402 challenge is generated, but your edge enforces it and your facilitator settles it. Live production settlement is still a preview; decisions, IOUs, and testnet challenges are the safe place to start.
Where to go next
- The agent monetization guide — the decision flow, fields, and preview boundary.
- The agent API reference — the exact endpoints and response shapes.
- The product overview — what the decision layer does and does not own.
- The blog — the agent-payment landscape and the decision-layer argument.
Frequently asked
Do I need a wallet to start?
No. IOU mode records what your rules would charge without moving money. When you are ready, switch to testnet x402; live production settlement is still a preview.
Does Volance hold funds?
No. Volance returns the decision and the x402 challenge. Your edge enforces it and settles through your facilitator to your wallet. Volance never holds or transmits funds.
What does a verified agent prove?
A valid Web Bot Auth signature proves control of a key and the authority attached to it. It does not prove the agent is welcome, well-behaved, or acting within the user’s intent. Your policy still decides.
Can I charge humans or search crawlers?
You can, but the intended default is no: humans stay free, known good crawlers stay free, verified agents can be charged by rule, and spoofed disclosure is blocked. Every rule is customer-configurable.
START WITH THE DECISION.
Price what you can measure.
Enforce what you decide.
Classify the caller.
Set the toll.
Settle to your own wallet.