We built a free x402 bill-reader — the open internet's headers humbled us in 24h
AI agents are starting to buy things from APIs on their own. The standard they use is x402: the server answers 402 Payment Required and puts its price in a response header, like a bill slipped under the door. No account, no card — the payment itself is what opens the door. We built a free tool so buyers can see that bill before anyone pays: paste an endpoint's address at paydlux.com/check and we…
In a single day, a free tool called paydlux.com/check exposed three critical bugs in real-world x402 payment endpoints. x402 is an emerging standard where servers answer 402 Payment Required and list the price in response headers. Our tool, which checks endpoints for free, revealed that many servers were sending unreadable or misleading payment information.
The first bug involved the header that lies: the parser kept the first payment-related header it encountered, which was actually a version marker, not the payment details. The fix was to test all candidate headers and take the first one that parsed correctly. The second bug revealed that the amount was encoded in base64, not as raw JSON, and the third bug showed a discrepancy in the amount due, with the endpoint charging $0.003 instead of $3000.
These bugs underscore the importance of thorough testing with real-world data rather than relying solely on fixtures. The tool now shows UNREADABLE when it cannot parse the bill, providing a more accurate indication of the situation. The source code for the paydlux.com/check tool is available on GitHub under the MIT license, and the community is encouraged to contribute to improving the parser and the live assertion.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to