{"slug": "getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on", "title": "Getting a paid x402 API discovered by AI agents: 5 things I learned listing on the PayAI Bazaar and the MCP Registry", "summary": "A developer running a pay-per-call Japan data API over x402 and a remote MCP server documented how they got the service indexed by AI agents, finding that discovery crawlers probe resource URLs without parameters, so bare requests must return a 402 with payment requirements rather than a 400. They also found that PayAI Bazaar listings appeared about a minute after a first settled payment per route, that facilitators maintain separate indexes, and that MCP Registry search matches names only, making specific names essential. The developer reported that listing works but outside paid traffic remains close to zero, calling discovery \"a prerequisite, not demand.", "body_md": "I run a small pay-per-call API with Japan data for AI agents (official ticket-sale openings, JMA weather warnings, prefecture minimum wages, foreign-worker rights). It costs 0.01 USDC per call over **x402** (HTTP 402 + USDC on Base) and is also exposed as a remote **MCP** server. Building the endpoints was the easy part. Getting agents to *find* them took most of the work. Here is what actually moved the needle, so you don't have to rediscover it.\n\nDiscovery crawlers probe your resource URL **without parameters**. My `/api/v1/warnings` returned `400 missing office` when called bare, so crawlers never saw a price and the route was never indexed.\n\nFix: with no parameters â†’ `402` with the payment requirements. After payment, return a sensible default (I return Tokyo with `defaulted_office: true` and a note). Invalid parameters (`office=zzz`) still get a `400` **before** the 402, so nobody pays for a query that can't succeed.\n\n``` php\nGET /api/v1/warnings            -> 402 (price visible to crawlers)\nGET /api/v1/warnings?office=zzz -> 400 (validated before payment)\nGET /api/v1/warnings?office=130000 + X-PAYMENT -> 200\n```\n\nI put the bazaar discovery metadata in my 402 responses, and only some routes appeared in the PayAI Bazaar. The missing routes showed up **about a minute after their first settled payment** through the facilitator. I made one 0.01 USDC self-payment per route (to my own payTo address). After that, `discovery/resources?payTo=<my address>` listed all of them.\n\nAlso note that facilitators don't share an index. Settling through PayAI got me listed on PayAI only. The Coinbase CDP Bazaar is a separate index, fed by settles through the CDP facilitator.\n\nOn Cloudflare Workers, settlement happens before your handler fetches data. If the handler then dies from the free plan's 10 ms CPU limit, the buyer has paid and gets nothing. Parsing the full 1.26 MB JMA map JSON took ~18 ms of CPU locally, so I dropped the \"nationwide summary\" idea. Keep the paid path cheap, and do the heavy parsing at build time.\n\n`mcp-publisher` supports **HTTP domain auth**. You serve one text line at `/.well-known/mcp-registry-auth`:\n\n```\nv=MCPv1; k=ed25519; p=<base64 public key>\n```\n\nThen `mcp-publisher login http --domain <your-domain> --private-key <hex>` and `mcp-publisher publish`. Your namespace is the reverse-DNS form of the domain (mine is `dev.pages.hodoyoku/japan-data`). Keep the private key out of anything you deploy.\n\nThe registry's `?search=` matches **names only**. \"japan\" already returns 100+ servers, so a generic \"Japan data\" name gets buried. Terms like foreign-worker rights or minimum wage had zero competing servers when I checked, so specific names win.\n\n`https://hodoyoku.pages.dev/mcp` (`tools/list` is free)`https://hodoyoku.pages.dev/.well-known/x402`\n`https://registry.modelcontextprotocol.io/v0/servers?search=hodoyoku`\nHonest status: listing works, but outside paid traffic is still close to zero. Discovery was a prerequisite, not demand. If you build agents that touch Japan (travel, HR, payroll, relocation), I'd love to hear which data you'd actually pay a cent per call for.\n\nSetup guide, tool list and curl examples: [https://hodoyoku.pages.dev/agents](https://hodoyoku.pages.dev/agents)", "url": "https://wpnews.pro/news/getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on", "canonical_source": "https://dev.to/member_0fbab672/getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on-the-payai-bazaar-and-8le", "published_at": "2026-11-27 01:01:44+00:00", "updated_at": "2026-11-27 01:14:38.466410+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools"], "entities": ["PayAI Bazaar", "MCP Registry", "Coinbase CDP Bazaar", "Cloudflare Workers", "x402", "Base", "Japan Meteorological Agency", "hodoyoku"], "also_reported_by": [], "takeaway": "Return a 402 with payment requirements on parameterless requests so discovery crawlers can see your price, and make one small self-payment per route to get it indexed by the facilitator's bazaar.", "recommendation": {"advice": "Make bare resource URLs return 402 with payment metadata instead of 400, validate bad parameters before payment, and settle one self-payment per route to trigger bazaar indexing.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on", "markdown": "https://wpnews.pro/news/getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on.md", "text": "https://wpnews.pro/news/getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on.txt", "jsonld": "https://wpnews.pro/news/getting-a-paid-x402-api-discovered-by-ai-agents-5-things-i-learned-listing-on.jsonld"}}