Documentation Index
Fetch the complete documentation index at: https://agentcash.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Why This Matters
If agents can’t discover your API, they can’t call it. Bulletproof discovery turns your endpoint from merely listed to reliably invocable. When metadata and runtime402 behavior agree, agents succeed on the first pass. You get fewer AgentCash failures, less debugging churn, and more real agent traffic.
- Publish OpenAPI as the canonical machine-readable contract.
- Treat runtime
402challenge behavior as the final source of truth.
Copy for Agents
Paste this directly into your coding agent. It should handle discovery implementation and validation end-to-end.Paste into Claude Code, Cursor, or Codex.
Discovery Strategy
OpenAPI is the canonical discovery format. Use it for the cleanest machine-readable contract and best agent compatibility. Thex-payment-info fields are a superset of the IETF API payment spec. The fields do not collide, so your service is still compatible if you already follow the IETF standard.
Expected location: GET /openapi.json
Requirements:
- Top-level fields:
openapi,info.title,info.x-guidance,info.version,paths. - For paid operations:
responses.402andx-payment-info. - Set
x-payment-info.protocols(array of protocol objects) and one pricing mode (fixedordynamic) withcurrency. - Use OpenAPI security +
components.securitySchemesfor auth declaration. - Add high-level guidance in
info.x-guidancefor user-friendly discovery.
Minimal valid example
Discovery Precedence
AgentCash uses the OpenAPI document at/openapi.json to discover your API. It will also check the runtime 402 challenge behavior to ensure it is correct.
| Order | Source | Expected Location |
|---|---|---|
| 1 | OpenAPI document | /openapi.json |
| 2 | 402 API Response | Correct 402 header response |
Common Failure Reasons
These are the most frequent errors seen during registration.| Error | Likely Cause | Fix |
|---|---|---|
Not Found | OpenAPI not found at {origin}/openapi.json | Add an OpenAPI document at {origin}/openapi.json |
Input/Output Schema Missing | Operation has no input or output schema | Add an input and output schema to the operation |
No Payment Modes Detected | No payment modes detected in the response | Add a valid payment mode to the response (x402 or MPP) |