Dynamic pricing for x402
Stop charging every agent the same price.
Tollwise plugs into your x402 price function and quotes each request by load, request shape, cost and settled volume. It learns which prices agents actually pay, keeps every price inside your bounds, and never touches your funds.
Works with @x402/hono · @x402/express · @x402/next
- 0x7a3f…c21e/v1/scrape?pages=2$0.0080tier · smallpaid
- 0xe502…9f13/v1/session$0.1000clamped · ceilingabandoned
- 0x5f2c…a7d0/v1/infer$0.0130off-peak ×0.9paid
- 0x19bd…04aa/v1/enrich$0.0045volume −20%paid
- 0x0b7e…5512/v1/scrape?pages=8$0.0120cost-plus floorquoted
- 0xd8a1…3c09/v1/infer$0.0170experiment · arm bpaid
The problem
A static price leaves money on every request
Your costs aren't flat
A two-page scrape and a two-hundred-page crawl cost you very different amounts. One price means overcharging small jobs or eating the big ones.
Load comes in waves
When capacity is tight, the same request is worth more. A static price can't tell 3am on a Sunday from launch day.
Your best buyers pay list
An agent that settled ten thousand payments this month pays the same as a wallet created five minutes ago.
How it works
Quote, observe, learn, adjust
The loop every pricing team runs by hand, built into the 402 response.
- 01
Quote
Every 402 carries a price computed in-process from your signed policy. Microseconds, no network call.
- 02
Observe
x402 settlement hooks show which quotes get paid and which are abandoned, per endpoint and price point.
- 03
Learn
A bandit experiment tests candidate price points against an always-on holdout of your static price.
- 04
Adjust
You approve every change. Floors, ceilings and daily change limits keep each price inside your bounds.
Integration
One line changes in your x402 config
Swap your static price for a Tollwise price function. Rules and experiments are set in the dashboard and shipped to your servers as a signed policy.
Request-shape tiers
Price by pages, tokens, or any numeric attribute.
Settled-volume discounts
Reward wallets with real payment history. New wallets pay list.
Load surge
Raise prices as capacity tightens, within your ceiling.
Time of day
Off-peak discounts and peak windows, in UTC.
Cost-plus floor
Never sell a request below upstream cost plus your margin.
Price experiments
Thompson sampling across candidate prices, measured against holdout.
import { createTollwise } from "@tollwise/sdk/hono";
const tollwise = createTollwise({
apiKey: process.env.TOLLWISE_API_KEY,
routes: {
"GET /v1/scrape": {
defaultPrice: "$0.01", floor: "$0.005", ceiling: "$0.10",
network: "eip155:8453",
},
},
});
app.use(paymentMiddleware({
"GET /v1/scrape": {
accepts: {
scheme: "exact", network: "eip155:8453", payTo: WALLET,
// was: price: "$0.01"
price: tollwise.price("GET /v1/scrape"),
},
},
}, server));Safety
Built so a pricing mistake can't hurt you
A wrong price costs you money. A missed optimization costs nothing. Tollwise is designed around that asymmetry.
No custody, ever
Buyers pay your wallet through your facilitator. Tollwise only picks the number.
Fail-safe to your price
Missing, stale or invalid policy? You get the static price you set in code. Your API never waits on us.
Settled equals quoted
Each quote is signed. The agent pays exactly what it was shown, across instances and policy updates.
Hard bounds win
Floors and ceilings live in your code. No rule or experiment can cross them.
Holdout always on
A slice of traffic stays on your static price, so uplift is measured, not guessed.
Behaviour only
Prices depend on volume, load, time and request shape. Never on who someone is.
Early access
Become a design partner
We're working with a small group of x402 sellers whose cost per request varies: inference, scraping, browser sessions and data enrichment.
- Hands-on setup with the founder
- Start with tight bounds and widen them as the data comes in
- A direct say in what we build next
FAQ
Questions sellers ask
Does Tollwise ever hold or route payments?
No. Payments settle directly from the buyer to your wallet through the facilitator you already use. Tollwise decides the price in your x402 config and nothing else.
What happens if Tollwise is down?
Nothing your buyers would notice. Prices are computed inside your process from a cached, signed policy. If the policy is missing or too old, the SDK serves the default price you configured.
Will an agent ever pay more than it was quoted?
No. Every quote carries a signed token, and the paid retry settles at exactly the quoted amount until the quote expires.
Which frameworks, networks and assets?
The SDK plugs into the x402 v2 middleware for Hono, Express and Next.js. It works with any network and asset your facilitator supports, with USDC on Base built in.
Is it available today?
Tollwise is in early access. We're onboarding a small group of design partners and setting each one up personally.