How to Make Your API Agent-Discoverable with llms.txt
说明与用途
使用 llms.txt、agents.json 和 openapi.json 的 API 能被代理自动发现,通过 HTTP 402 进行支付,SDK 自动生成所需文件。
问题
AI agents skip APIs that lack machine-readable manifests, preventing discovery and monetization.
结果
Two agents discovered the API, made payments totaling $0.125, and the SDK automatically generated all required discovery files.
工作流
- Create llms.txt with service, authentication, and payment details
- Create agents.json with Schema.org Service and Offer data
- Create openapi.json with x‑402 pricing extensions
- Deploy API with x‑402 middleware (e.g., nano‑empire‑tollbooth)
- Publish the three files at the domain root
- Agents crawl the files, discover the API, and pay via HTTP 402
- Agents retry with signed receipt and receive 200 OK
证据
Result: 2 agents found us organically, paid $0.125 total.
The SDK generates all three discovery files automatically.
- 记录日期: 2026-09-09T02:01:53.216Z