docs operation generates and serves interactive API documentation for your Conductor project. It auto-generates OpenAPI 3.1 specifications from your ensembles and agents, and serves them through multiple documentation UIs.
Features
- Auto-generated OpenAPI specs - Scans your ensembles and agents to create accurate API docs
- Multiple UI frameworks - Stoplight Elements, Redoc, Swagger UI, Scalar, RapiDoc
- Custom branding - Add your logo, colors, and styling
- Built-in caching - Fast documentation serving with optional KV caching
- Authentication - Public, authenticated, or admin-only documentation
- Multiple formats - Serve docs as HTML, YAML, or JSON
New to docs agents? Check out Your First Documentation for a comprehensive step-by-step guide to setting up interactive API documentation.
Basic Usage
Create a docs agent configuration:Configuration Options
UI Framework
Choose your preferred documentation UI:stoplight(default) - Modern, interactive Stoplight Elementsredoc- Clean, mobile-friendly Redocswagger- Classic Swagger UIscalar- Beautiful, customizable Scalarrapidoc- Fast, lightweight RapiDoc
Authentication
Control who can access your docs:Custom Branding
Add your brand identity:OpenAPI Specification
Customize your OpenAPI spec:Custom OpenAPI Spec
Provide your own OpenAPI specification:Auto-Generation
Control automatic spec generation:Caching
Enable caching for better performance:DOCS_CACHE in your wrangler.toml:
Multiple Documentation Paths
Serve specs at different paths:Complete Example
Template Examples
The Conductor template includes pre-configured docs agents:docs-simple.yaml
Basic documentation with defaults:docs-public.yaml
Public-facing API documentation:docs-authenticated.yaml
Documentation for logged-in users:docs-admin.yaml
Admin-only documentation:How It Works
- Auto-Discovery - Docs agent scans your ensembles and agents
- OpenAPI Generation - Creates OpenAPI 3.1 specification
- UI Rendering - Serves interactive HTML documentation
- Multiple Formats - Provides YAML and JSON spec downloads
Request Routing
The docs agent handles three types of requests:Advanced Usage
AI-Enhanced Documentation
Combine with AI to generate better descriptions:Searchable Documentation
Add vector search to your docs:Documentation Pipeline
Create an ensemble to auto-generate docs:Best Practices
Organization
Keep docs agents in theagents/docs/ directory:
Security
- Use authentication - Protect sensitive endpoints
- Separate docs - Different docs for different audiences
- Filter endpoints - Don’t expose internal APIs
Performance
- Enable caching - Reduce generation overhead
- Use CDN - Serve docs through Cloudflare CDN
- Optimize assets - Minimize custom CSS
Maintenance
- Version your docs - Separate docs for each API version
- Update regularly - Keep docs in sync with code
- Test examples - Ensure code samples work
Troubleshooting
Docs Not Showing
- Check agent is registered:
- Verify path matches agent name:
- Check logs for errors:
Authentication Issues
- Verify auth configuration in conductor.config.ts
- Test with correct authentication headers:
Caching Problems
- Ensure KV namespace is bound:
- Clear cache if needed:

