Five APIs on Cloudflare Workers, and the bugs that nearly shipped
Five APIs on Cloudflare Workers, and the bugs that nearly shipped Five products, 37 endpoints, 470 tests, one deploy command each. This is the architecture, the pricing maths against the market, and the four bugs that
Five APIs on Cloudflare Workers, and the bugs that nearly shipped
Five products, 37 endpoints, 470 tests, one deploy command each. This is the architecture, the pricing maths against the market, and the four bugs that would have made the whole thing useless.
The shape of it
One pnpm workspace, five Workers, one shared package. Each Worker is its own product with its own name, key, quota and failure domain. A bug in the PDF parser cannot take down email verification.
The shared package does the dangerous work once: error envelope, CORS, request ids, timing headers, OpenAPI generation, SSRF-safe fetching, and the marketplace proxy-secret check. Every route is registered through app.openapi(createRoute(...), handler) so the spec is generated from the same source as the handler. No hand-written YAML to drift.
That gave 37 endpoints and 470 tests. Every app passes tsc --noEmit, and every route was answered with a real curl before it was listed anywhere.
Why these five
Marketplace APIs sell on search intent. Someone types "email verification api" because their signup is leaking bounces. They do not want a platform. The product has to name the job.
So: email verification, on-page SEO audit, document text extraction, text analysis, PII redaction. Five jobs with clear intent, all things a developer wants to call once and forget.
The pricing maths, published
The interesting part is not the price, it is what the market charges. I put the numbers on a public page, including where I am expensive:
- EmailListVerify charges €5 per 1,000 credits, falling to €2.16 at 25k. Roughly half a cent per address.
- PennyOCR charges $0.75 per 1,000 pages. AWS Textract is $1.50 per 1,000.
- Sidian charges $799/month for 20,000 document pages, then $0.04 per page.
Against that, a flat $0.05 per call is wrong in one place and right in others:
| Unit | Our price | Market | Verdict |
|---|---|---|---|
| one email verification | $0.05 | $0.005 | 10x the market |
| 100 emails via bulk | $0.0005 each | $0.005 | 10x cheaper |
| 100-page PDF | $0.0005 per page | $0.00075 | parity |
| 1-page PDF | $0.05 per page | $0.00075 | 66x the market |
Publishing that table was the most useful marketing decision I made. It says what the product is bad at, which is the only reason anyone believes the rest.
Four bugs worth talking about
1. The SSRF guard blocked every hostname. The validator ran an IP-range check against the hostname string, and hostnames are not IPs. Every request was refused. The fix was to resolve first (DNS-over-HTTPS), then range-check the resolved IPs, and only range-check the literal when the input is actually an IP.
2. The OpenAPI import failed with "Failed to parse JSON". Not a schema problem: PowerShell's Set-Content -Encoding UTF8 writes a BOM, and the marketplace importer rejects it. Download the raw bytes or write with UTF8Encoding(false).
3. Every marketplace call returned 401. The proxy secret had a trailing newline from echo secret | wrangler secret put. Trim both sides in the comparison. Obvious in hindsight, invisible for two hours.
4. The listings were private. For days. The publish page renders a visibility toggle that flips to "Public" on click, and nothing is sent to the server until you press a Save button in a sticky bar at the bottom of the page. I clicked the toggle, saw it turn green, and reported the listings as live. They 404'd for everyone but me. That is the worst kind of bug: the UI agrees with you.
What I would do differently
Measure the client-visible number, not the server one. Every response from these APIs carries x-response-time-ms and Server-Timing, and the Worker does its work in about 16ms. A client round trip from India measures 172ms, because the rest is distance. Quoting "under 100ms" invites a buyer to measure something they will never see. I replaced every latency claim with a measured number and published the p50/p95 table.
Same for accuracy: I wrote endpoint lists from memory, and three of the five were wrong. Testing the docs like code (a script diffs every documented path against the live OpenAPI document) found it.
Links
- The APIs: https://labs.ayamk.in
- Live demos, no key needed: https://labs.ayamk.in/demo.html
- The pricing comparison with sources: https://labs.ayamk.in/compare-pricing.html
- Measured latency: https://labs.ayamk.in/performance.html
- Source, MIT: https://github.com/ayam04/ayam-labs-apis
Disclosure: I built these APIs and I sell them. The comparison page names where a competitor is cheaper, and the latency numbers are measured from one machine rather than a load test. Treat this as a build log, not an independent review.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.