# SWAGENT > API documentation for the agent era. Transform OpenAPI specs into AI-readable, developer-friendly, and discoverable formats. Docs: [Full docs](https://swagent.dev/llms-full.txt) | [Website](https://swagent.dev) | [GitHub](https://github.com/X24Labs/SWAGENT) ## What it does SWAGENT takes an OpenAPI/Swagger spec and generates three outputs: - `llms.txt` - Token-optimized compact notation for AI agents (~75% fewer tokens than raw OpenAPI JSON) - `to-humans.md` - Full markdown reference with ToC, parameter tables, response schemas - `index.html` - Zero-JS semantic HTML landing page with dark theme ## Install ``` npm install swagent ``` ## Packages - `@swagent/core` - Pure generators, zero runtime deps - `@swagent/fastify` - Fastify plugin, reads from @fastify/swagger - `@swagent/express` - Express router middleware - `@swagent/hono` - Hono sub-app - `swagent` - CLI tool ## Quick start ```js import { swagentFastify } from '@swagent/fastify'; app.register(swagentFastify, { baseUrl: 'https://api.example.com' }); ``` Serves 4 endpoints: - GET / - HTML landing page - GET /llms.txt - AI-optimized docs - GET /to-humans.md - Markdown reference - GET /openapi.json - Raw OpenAPI spec ## Compact notation conventions - `*` after field name = required - `:type` after field name = non-string type (e.g. `age:number`, `active:boolean`) - `{...}` = object shape - Auth shorthands: JWT (Bearer token), KEY (API key), NONE (no auth) ## License MIT - X24Labs