ScriptsMay 18, 2026·3 min read

Scalar — Open-Source API Platform with Beautiful References

Scalar is an open-source API platform that provides a modern REST API client, beautiful auto-generated API references, and first-class OpenAPI and Swagger support for developer teams.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Scalar API Platform
Universal CLI install command
npx tokrepo install acc51033-52b5-11f1-9bc6-00163e2b0d79

Introduction

Scalar provides a polished developer experience for creating, testing, and documenting APIs. It reads your OpenAPI or Swagger spec and generates interactive, beautifully styled API reference pages that let consumers try endpoints directly in the browser.

What Scalar Does

  • Generates interactive API reference documentation from OpenAPI 3.x and Swagger 2.0 specs
  • Provides a modern REST API client for testing endpoints with authentication handling
  • Offers embeddable components for React, Vue, Next.js, Nuxt, Express, Fastify, and more
  • Supports dark mode, custom theming, and full CSS control over the generated pages
  • Includes a CLI for serving, validating, and bundling OpenAPI documents

Architecture Overview

Scalar is built as a modular TypeScript monorepo. The core engine parses OpenAPI specs into an internal representation, then renders them through framework-specific adapters. The API client runs in-browser using fetch with proxy support for CORS-restricted endpoints. All rendering happens client-side, so the reference pages can be deployed as static assets or served from any backend.

Self-Hosting & Configuration

  • Install the CLI globally via npm install -g @scalar/cli or use npx for one-off usage
  • Integrate into Express with app.use('/docs', apiReference({ spec: { url: '/openapi.json' } })) middleware
  • Embed in React or Vue projects using @scalar/api-reference-react or @scalar/api-reference packages
  • Configure authentication defaults, server URLs, and theme via a scalar.config.json file
  • Deploy generated static HTML to any CDN or serve dynamically from your backend

Key Features

  • Zero-config rendering of OpenAPI specs into interactive documentation
  • Built-in request builder with support for Bearer, API Key, OAuth 2.0, and Basic auth
  • Framework integrations for all major Node.js and frontend frameworks
  • Markdown support in descriptions with syntax highlighting for code samples
  • MCP server support to expose OpenAPI documents to AI agents

Comparison with Similar Tools

  • Swagger UI — the original OpenAPI renderer; Scalar offers a more modern UI and built-in API client
  • Redoc — generates beautiful static docs but lacks an interactive request builder
  • Stoplight Elements — similar feature set but Scalar is fully open source with no vendor lock-in
  • RapiDoc — lightweight web component alternative; Scalar provides deeper framework integrations
  • Mintlify — managed documentation platform; Scalar is self-hostable with no SaaS dependency

FAQ

Q: Does Scalar support OpenAPI 3.1? A: Yes. Scalar supports OpenAPI 3.0.x, 3.1.x, and Swagger 2.0 specifications out of the box.

Q: Can I customize the look and feel of the generated docs? A: Yes. Scalar supports custom CSS, theme presets, dark and light mode, and full layout control via configuration.

Q: Is the API client a standalone tool or part of the docs? A: Both. The client is embedded in the reference pages and also available as a standalone desktop and web application.

Q: How do I integrate Scalar with my CI/CD pipeline? A: Use the CLI to validate and bundle your spec in CI. You can also generate static HTML output for deployment to any hosting platform.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets