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

> Source: <https://dev.to/chinawire/making-a-small-api-discoverable-by-ai-agents-what-worked-what-did-not-339a>
> Published: 2026-12-04 12:41:31+00:00

**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 the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

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 agents`robots.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.
