cd /news/ai-agents/making-a-small-api-discoverable-by-a… · home › topics › ai-agents › article
[ARTICLE · art-181772] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Making a small API discoverable by AI agents: what worked, what did not

A developer behind ChinaWire, a small paid API for Chinese web content, documented how they made the service discoverable to AI agents using the x402 v2 payment protocol. Key steps included returning a properly shaped 402 Payment Required response with a PAYMENT-REQUIRED header before request validation, publishing /openapi.json with x-payment-info, /.well-known/x402, /llms.txt, robots.txt and sitemap.xml, and registering routes via the x402 registry. The developer reported that switching from an sslip.io host to a normal domain behind Cloudflare with Full (strict) was what finally got directory crawlers probing the API.

recommendation

Serve a valid x402 402 response before validation, publish OpenAPI, /.well-known/x402 and llms.txt, and use a real domain behind Cloudflare Full (strict) so directory crawlers will probe your API.

more in playbook: Designing agent systems
by read1 min views1 publishedDec 4, 2026

I run ChinaWire, a small paid API for Chinese web content. Getting it technically correct was the easy part; getting agents to find it was the hard part. Here is what moved the needle, in order.

Not a 401, not a 403, not a JSON error. The x402 v2 shape that directories and agents actually parse:

HTTP/1.1 402 Payment Required`` PAYMENT-REQUIRED header containing accepts[] with scheme: exact, network: eip155:8453, the USDC asset, payTo, and the amount in token atomic units Probes must reach the 402 before query/body validation rejects the request. If /v1/thing returns 422 without a parameter, a directory will mark it as broken.

/openapi.json with x-payment-info per operation/.well-known/x402 listing the paid resource URLs/llms.txt - a plain-text map for agentsrobots.txt that allows agent crawlers, and a sitemap.xml These are cheap and they gave every crawler something to chew on.

/api/x402/registry/register-origin with the signed payload registered every route in my OpenAPI.sslip.io): directory crawlers treated it as a free host. A normal domain behind Cloudflare, with Full (strict), was the switch that made crawlers start probing.

PAYMENT-SIGNATURE header path separately so you can tell probes from payers. If you are building an x402 service, the conformance checklist is the easy 20%. The other 80% is being in the places an agent already reads.

── more in #ai-agents 4 stories · sorted by recency
── more on @chinawire 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/making-a-small-api-d…] indexed:0 read:1min 2026-12-04 · —