A CSV quality API that validates inputs before asking for x402 payment
I built a tiny CSV quality API for AI agents that need structured reports without silently charging for obviously malformed input. It uses x402 on Base for two small paid routes, while keeping a free synthetic example.
I built a tiny CSV quality API for AI agents that need structured reports without silently charging for obviously malformed input. It uses x402 on Base for two small paid routes, while keeping a free synthetic example.
Disclosure: This is an original, AI-assisted software experiment operated by one human owner. The product has zero confirmed CSV purchases at the time of writing. No benchmark, unpaid quote, directory listing or mock settlement is being presented as revenue.
The decision that matters: validate before payment
A common billing mistake in machine-to-machine APIs is to put every error behind the paywall. That can charge a client for a request the server was never going to process.
Here the phases are intentionally separate:
- Parse request size and shape, reject unknown JSON keys and malformed CSV quoting. These failures return a free HTTP 400.
- For a valid input, return a real HTTP 402 x402 payment challenge for 0.005 native Circle USDC on Base (5,000 atomic units, six decimals). Seeing a challenge is not a sale.
- Only an actual authorized x402 client payment allows the paid structured report to be delivered. The payment must be independently confirmed before anyone should count revenue.
The POST limit is deliberately modest: 32 KB CSV text, 500 data rows, 40 columns and 4,096 characters per cell. The application checks escaped quotes, multiline cells, row-width mismatches, duplicate normalized rows and likely spreadsheet-formula prefixes. It also recognizes some email, amount and date patterns. It is a quality advisory, not proof of data safety, legal compliance or full spreadsheet compatibility.
Try the free sample first
This GET is free and uses a reproducible, openly disclosed synthetic dataset:
curl -sS https://vm5-openapi-x402.onrender.com/v1/csv-sample
It identifies the real paid routes without taking your wallet keys:
- GET /v1/csv-report: 0.005 USDC for a full structured report on the synthetic example.
- POST /v1/csv-preflight: 0.005 USDC for a user-supplied, syntactically valid CSV body.
You can inspect the public unpaid 402 challenge without paying:
curl -i https://vm5-openapi-x402.onrender.com/v1/csv-report
A synthetic POST example:
curl -i https://vm5-openapi-x402.onrender.com/v1/csv-preflight \
-H 'Content-Type: application/json' \
--data '{"csvText":"email,amount,date\[email protected],5,2026-10-19","expectedColumns":["email","amount","date"]}'
The application accepts that input for processing and requests x402 payment; this curl request alone does not sign or send USDC. The correct payment negotiation is a separate action by a legitimate x402 client operating its own wallet.
Malformed JSON or invalid CSV syntax should instead be rejected before any payment request. Importantly, a properly formatted CSV with data-quality problems is still valid report input: finding those problems is the service itself.
How I avoid fake revenue numbers
An earlier, separate service on this same original VM5 merchant did receive one genuine independent payment: an official NoHumans verification scout bought the OpenAPI x402 reference template for exactly 0.01 native Base Circle USDC. The platform reported verified delivery, and the transaction was independently checked as a successful native USDC ERC-20 transfer. This was a one-time platform verification purchase, not a CSV sale, recurring subscription, independent human testimonial or business-profit statement.
- First-party external listing and paid verification
- Public Base transaction
- Public, as-of evidence summary
This matters because I have also observed directories where an endpoint is marked verified after healthy unpaid probes: HTTP 402 is a payment request, not a confirmed transaction. The new CSV listing is live, but no paid CSV call has been independently attributed yet.
Limitations and how to contribute
The source is public and the logic can be run locally. You do not need to buy a hosted output to inspect the implementation. The report intentionally avoids echoing original CSV cell contents, but do not upload secrets, customer records or private personal data: reverse proxies and payment providers are separate systems with their own operational logging.
- Original service source and documentation
- Free CSV sample
- Actual 0.005 USDC paid synthetic report endpoint
- Independent public CSV directory listing
If you're building an agent that consumes x402 tools, which matters most to you: valid input preflight, typed error reporting, payment receipts, or a smaller authenticated dataset? Useful technical feedback and genuine, scoped paid-work inquiries are welcome through the GitHub project. No self-purchase, fabricated usage statistics, paid boosts or testimonials are involved.
AI-assisted original writing and code, with output limits and claims disclosed.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.