Agent402 has over a thousand tools, and most of them are pure CPU โ no external API calls, no network I/O, just computation. Things like JSON formatting, hash generation, regex matching, unit conversion, and text analysis.
For these tools, we offer a proof-of-work free tier: instead of paying USDC, the caller solves a small computational challenge. It's the same idea as Hashcash (the precursor to Bitcoin mining), adapted for API access control.
How it works
- Request a challenge. The client sends a request without payment. The server responds with
402 Payment Requiredand includes a PoW challenge in the response headers. - Solve the challenge. The client finds a nonce that, when combined with the challenge, produces a hash with a required number of leading zero bits. This takes roughly 50-200ms on modern hardware.
- Submit the solution. The client re-sends the original request with the PoW solution in the headers. The server verifies the solution (instant) and serves the result.
Each solution is single-use and slug-scoped โ it can only be used once, and only for the specific tool it was issued for. This prevents replay attacks and solution-sharing across tools.
Why proof-of-work?
We wanted a free tier that didn't require registration or API keys (that would defeat the whole point of x402). PoW gives us three things:
- Abuse prevention. Solving a challenge has a real CPU cost, so bulk abuse is expensive even though the tools are "free."
- No identity required. The caller doesn't need an account, email, or API key. Just compute the answer.
- Fair access. Every caller pays the same cost โ a few milliseconds of CPU time โ regardless of who they are.
Browser-side solving
The PoW challenge is designed to be solvable in the browser using Web Crypto. The agent402-client SDK handles this automatically โ it detects a 402 response, solves the challenge, and retries, all transparently. For agents using the MCP integration, the hosted server at /mcp handles PoW internally.
Which tools are free?
Any tool that runs purely on the server's CPU without making external network requests is PoW-eligible. Tools that call upstream APIs (web search, rendering, geocoding) require payment because they have a real marginal cost. The tool catalog marks each tool's pricing โ $0.000 means PoW-eligible.