fix(x402 docs): Adding common LLM discovery documentation

This commit is contained in:
Chris Troutner
2026-04-01 08:36:47 -07:00
parent 3950560989
commit 5d77880a0e
12 changed files with 695 additions and 0 deletions
+16
View File
@@ -98,6 +98,16 @@ Every API call under the `/v6` prefix requires a BCH micro-payment. When a reque
This is the right choice for **public, monetized APIs** where you want to charge per call.
When `X402_ENABLED=true`, the server also exposes machine-discovery endpoints:
- `/.well-known/x402` - x402-bch v2 payment discovery manifest
- `/openapi.json` - OpenAPI 3 projection generated from apiDoc annotations
- `/swagger.json` - Swagger 2.0 compatibility projection
- `/llms.txt` - LLM-oriented markdown index of service metadata
- `/.well-known/agent.json` - draft agent manifest describing API actions
When `X402_ENABLED=false`, these discovery endpoints return `404`.
#### Combined: x402 + Bearer Token
You can enable both at the same time:
@@ -147,6 +157,12 @@ The API reference documentation is generated by [apiDoc](https://apidocjs.com/)
The output is written to the `docs/` directory and served by the running server at its root URL.
To regenerate API docs plus discovery artifacts (`openapi.json`, `swagger.json`, `llms.txt`, and `agent.json` payload source):
`npm run docs:all`
This runs apiDoc first, then generates `docs/discovery-artifacts.json` from the same annotation source.
A live version can be found at [bch.fullstack.cash](https://bch.fullstack.cash/).
## Production (Docker)