API documentation generator from OpenAPI

NPM Version NPM Downloads Discord

Turn the OpenAPI document you already have into interactive API documentation that developers can read, search, and send requests from, for free.

The Scalar API Reference is open source and MIT licensed. Point it at an OpenAPI or AsyncAPI document and it renders modern documentation with built-in request testing from just a few lines of code. Swagger 2.0 documents load too, so older APIs do not need a rewrite first.

It works from a single HTML page, a CDN script, or one of the many framework integrations for Express, Fastify, Hono, NestJS, Next.js, Nuxt, ASP.NET Core, FastAPI, and more.

Why developers already use it

  • 15.7k stars on GitHub. The reference is built in the open at github.com/scalar/scalar, next to the API client it ships with.
  • Documented by Microsoft. The ASP.NET Core OpenAPI guide on Microsoft Learn has a section called Use Scalar for interactive API documentation, built on the Scalar.AspNetCore package and app.MapScalarApiReference().
  • The default UI in eight frameworks. Effect, ElysiaJS, HappyX, Litestar, Nitro, oRPC, Platformatic, and Spry render their API documentation with Scalar out of the box.

Interactive documentation, not a static page

Every operation gets a Test Request button that opens the Scalar API Client in place. Developers fill in parameters, pick an authentication scheme, and see the real response without leaving your docs. Generated code samples cover cURL, JavaScript, Python, Go, and many more languages, so the first working call is a copy and paste away. Search, dark mode, and deep links to every operation and schema come built in.

OpenAPI, Swagger 2.0, and AsyncAPI

Scalar reads OpenAPI 3.0 and 3.1 in JSON or YAML. Swagger 2.0 is upgraded on load, and AsyncAPI documents render with channels, operations, and messages instead of paths and responses. Your API description stays the single source of truth; the documentation is generated from it every time it loads.

Themes that match your brand

Pick one of the built-in themes or override the CSS variables yourself. Layout, sidebar, and authentication defaults are all configurable, and plugins cover the cases configuration does not.

Drop it into your framework

Most teams never write the HTML by hand. There are integrations for more than 40 frameworks and platforms, and we wrote framework guides for the most common ones: .NET API documentation, FastAPI API documentation, and NestJS API documentation. If you are new to the format itself, the learn hub explains OpenAPI from the ground up.

When you outgrow a single page

The open-source reference is free forever. When you need hosting, custom domains, guides next to the reference, or several APIs in one portal, the same renderer powers Scalar Docs. Teams such as Thomson Reuters, Clerk, Lufthansa, Zoom, and PAR publish their developer documentation with it; read the PAR story or browse all customers.

Ready to render your first reference? Follow the Getting Started guide, start free on the hosted plan, or book a demo.

Go further

  • Configuration — customize behavior, authentication, and layout
  • Themes — match the reference to your brand
  • Plugins — extend the reference with custom features
  • AsyncAPI — render event-driven APIs described with AsyncAPI

Frequently asked questions

Is the Scalar API Reference free?

Yes. The API Reference is open source under the MIT license, and you can self-host it anywhere at no cost. Hosted documentation on Scalar also has a Free plan; paid plans add things like custom domains and Git Sync. See pricing for the details.

How do I generate API documentation from an OpenAPI document?

Load @scalar/api-reference from a CDN and call Scalar.createApiReference('#app', { url: '/openapi.json' }), or install the integration for your framework. The Getting Started guide has a complete HTML example you can paste into a file and open.

Does Scalar support Swagger 2.0?

Yes. Swagger 2.0 documents are upgraded to OpenAPI on load, so they render without a manual conversion. OpenAPI 3.0 and 3.1 are supported natively, in JSON or YAML.

Can I replace Swagger UI or Redoc with Scalar?

Yes, and it is usually a one-line change because Scalar reads the same OpenAPI document. The framework guides for .NET, FastAPI, and NestJS show the swap step by step.

Can developers send requests from the documentation?

Yes. Every operation has a Test Request button that opens the built-in API client with the parameters, servers, and authentication schemes from your document already filled in.

What is the difference between the API Reference and Scalar Docs?

The API Reference renders one API description, and you host it yourself. Scalar Docs is the hosted platform around it: guides in Markdown or MDX, several API references in one site, custom domains, Git Sync, and access control.