Add AI-friendly API discovery endpoints

- Add /llms.txt for LLM/AI agent documentation
- Add /openapi.json for OpenAPI spec
- Update server.js to serve new endpoints
- Document all API endpoints with examples and payment info

These endpoints help AI agents discover and use the API correctly,
including x402 payment requirements.
This commit is contained in:
Ben Troutner
2026-03-23 12:02:15 -07:00
parent 6879046b5a
commit ed02fa4027
3 changed files with 580 additions and 0 deletions
+13
View File
@@ -252,6 +252,19 @@ class Server {
res.sendFile(docsPath)
})
// AI-friendly discovery endpoints
app.get('/llms.txt', (req, res) => {
const llmsPath = join(__dirname, '..', 'public', 'llms.txt')
res.setHeader('Content-Type', 'text/plain')
res.sendFile(llmsPath)
})
app.get('/openapi.json', (req, res) => {
const openapiPath = join(__dirname, '..', 'public', 'openapi.json')
res.setHeader('Content-Type', 'application/json')
res.sendFile(openapiPath)
})
// MIDDLEWARE END
console.log(`Running server in environment: ${this.config.env}`)