Interactive renderers
hclapi embeds 4 interactive documentation UI renderers directly inside the single binary. Renderers are served by declaring an endpoint with an openapi {} block.
1. Scalar (Default)
A modern, fast, and clean interactive API reference featuring a dark/light mode toggle, integrated interactive request client, and code snippet generation in 15+ languages.
2. Stoplight Elements
A clean, responsive, Stripe-like documentation UI with a two-column layout, sidebar navigation, and integrated request testing.
3. Swagger UI
The classic, widely recognized interactive OpenAPI testing interface.
4. Redoc
A 3-column documentation layout designed for deep technical reading.
Custom HTML templates
To completely customize your documentation portal, omit ui and provide your own HTML template via an inline heredoc or an external file.
Inline heredoc:
External template file:
Template variables
All HTML templates (built-in and custom) have access to the following data context:
Protecting documentation with Basic Auth
Since documentation UIs are explicit endpoint blocks, you can restrict access to internal API portals using standard authentication guards: