Use case
Meter and monetize the tools AI agents call.
MCP tool servers and paid data APIs are built to be called by agents. Wayleave identifies which agents call them, applies your limits, and prices calls with HTTP 402 — while humans using your product stay free.
Common setups
- Paid data API — price premium endpoints per call.
- MCP tool server over HTTP — identify and rate-limit callers.
- Observe-only content site — measure agent reads before deciding.
- Landing page in front of a priced API — humans browse, agents pay.
Price a tool endpoint
import Wayleave from 'wayleave';
import { coinbaseFacilitator } from 'wayleave/x402';
const gate = new Wayleave({
rules: {
verified_agent: [['/api/admin', false], ['/api', true]],
suspected_bot: [['/api', false]],
},
rateLimits: { declared_agent: 10 },
pricedPaths: { '/api/premium': 0.05 }, // agents pay 5¢/call, humans free
strictPricedPaths: true,
verifyPayment: coinbaseFacilitator({ /* your keys */ }),
});
app.use(gate.express());Questions
Does Wayleave work with MCP?
Wayleave works at the HTTP layer, so any MCP server exposed over HTTP through Express can use it.