How to Make Your FastAPI App Discoverable by AI Agents
说明与用途
FastAPI 应用通过添加 llms.txt、agents.json、实现 x402 支付并提供免费套餐,变得可被 AI 代理发现。
问题
FastAPI apps are invisible to AI agents because they lack machine‑readable discovery files and programmatic payment support.
结果
The API becomes discoverable by AI agents, gains programmatic payment, and attracts usage through a free tier.
工作流
- Create /llms.txt with service description and pricing
- Create /agents.json with Schema.org Service entries
- Add x402 middleware to protected endpoints
- Register API with Smithery.ai and Glama.ai registries
- Set up proof chain for reliability verification
- Offer free tier (5 calls/day/IP) to attract agents
- Add x402 payment after volume justifies it
证据
Agents don't browse Google or read your landing page. They crawl specific machine-readable files that tell them what your API does, what it costs, and how to pay you.
Agents won't fill out signup forms. They need to pay programmatically via the x402 protocol (HTTP 402 + USDC on Base).
- 记录日期: 2026-09-07T02:51:26.074Z