Scalar
Beautiful, interactive OpenAPI documentation with a built-in offline-first API client and multi-language code generation — all in one open-source platform.
Scalar is a comprehensive open-source API platform built around OpenAPI and AsyncAPI specifications. It transforms raw API spec files into visually polished, interactive documentation that developers actually want to use, replacing the default Swagger UI with a modern, themeable reference that renders in any framework via a single script tag or npm package.
At its core, Scalar ships two flagship tools: an API reference renderer that integrates natively with Express, FastAPI, NestJS, Hono, Django, Laravel, Spring Boot, and 30+ other frameworks, and an offline-first API client that serves as a Postman alternative with first-class OpenAPI support, environment variables, Watch Mode sync, and a cross-platform desktop app for Windows, macOS, and Linux.
Beyond documentation and testing, Scalar includes snippetz, a client-side code generation library that produces ready-to-run HTTP snippets in 40+ language and library combinations — curl, Python requests, Go, Rust, Node.js fetch, PHP Guzzle, Ruby, Swift, and many more — all computed in the browser without a server round-trip.
The project is organized as a pnpm monorepo of independently versioned packages. Each core capability — OpenAPI parsing, schema validation, diff computation, code generation, workspace state management, and UI rendering — lives in its own package, making Scalar usable as a complete platform or as individual focused libraries.
What You Get
- Interactive OpenAPI/AsyncAPI API reference renderer with search, authentication pickers, and live try-it-out requests — deployable via CDN script tag or npm package
- Offline-first API client desktop app (Windows, macOS, Linux) with environment variables, dynamic parameters, OpenAPI document sync, and request history
- Snippetz code generation library producing HTTP request snippets for 40+ languages and libraries (curl, Python requests, Go, Node.js fetch, Rust reqwest, PHP Guzzle, Ruby, Swift, and more)
- Watch Mode that automatically synchronizes your API client with changes in your server framework’s OpenAPI output — no manual refresh required
- OpenAPI parser, validator, upgrader (Swagger 2.0 → OpenAPI 3.0 → 3.1), and bundler available as standalone npm packages for build pipelines
- A mock server that serves HTTP responses from an OpenAPI document and a void server that mirrors incoming requests — both useful for testing without a real backend
- Plugin system for extending the reference renderer with custom authentication flows, PostHog analytics, and domain-specific rendering behaviors
- First-class framework integrations for ASP.NET Core, Astro, Django, Docusaurus, Express, FastAPI, Fastify, Hono, Laravel, NestJS, Next.js, Nuxt, Rails, Rust, SvelteKit, and more
Common Use Cases
- Replacing Swagger UI with a modern, themeable API reference — embed with a single HTML snippet or use the framework middleware for automatic spec serving
- Running API testing workflows offline without Postman — the desktop client stores requests locally, reads your OpenAPI spec, and syncs with Watch Mode as you develop
- Generating multi-language code snippets directly in the browser — add curl, Python, Node.js, Go, or Rust examples to your documentation automatically from the OpenAPI spec
- Publishing hosted API documentation on Scalar’s managed cloud with GitHub Sync, custom domains, and team collaboration without running your own infrastructure
- Embedding Scalar inside documentation sites (Docusaurus, Astro, Nuxt) as a fully interactive API explorer alongside written guides and tutorials
- Mocking API endpoints during frontend development using the Scalar mock server driven by an OpenAPI document before the backend is complete
Under The Hood
Architecture Scalar is organized as a monorepo of highly decoupled packages orchestrated by Turborepo, where the core abstraction is a reactive, proxy-based workspace store that handles OpenAPI and AsyncAPI document loading, diffing, bundling, and normalization as composable plugins. The API reference renderer and API client are separate packages that share the workspace store as their data layer but maintain independent rendering pipelines, allowing them to be versioned and published independently. The plugin system enables extending document processing — auth scheme normalization, external value resolution, $ref bundling — without modifying core logic. Separation of concerns is strong: parsing, code generation, rendering, request execution, and workspace state management each live in independently publishable packages. The use of Vue 3’s reactivity primitives as a state management foundation rather than a dedicated store is a deliberate architectural choice that keeps the data layer framework-agnostic while remaining reactive and observable.
Tech Stack
The entire codebase is TypeScript using Vue 3 with the Composition API for all rendering components. The workspace store exploits Vue reactive primitives and custom Proxy-based magic objects for change detection and deep observation without polling or manual watchers. Build tooling is Vite with Turborepo for monorepo orchestration and pnpm workspaces for dependency management. OpenAPI document parsing handles JSON and YAML with a purpose-built parser, JSON Schema validation uses TypeBox with a custom validation layer, and diff and bundle operations are powered by an internal json-magic library purpose-built for deeply nested API specification objects. Code generation covers 40+ language and client library combinations through a plugin-based snippetz system. The desktop API client wraps the web client via Electron, and CI infrastructure runs GitHub Actions with both Vitest for unit tests and Playwright for end-to-end browser automation. Biome handles linting and formatting across the monorepo. Deployment targets span CDN standalone JavaScript bundles, npm packages, Docker images, and a Cloudflare Pages edge variant.
Code Quality The project has extensive test coverage approaching a thousand test files spanning unit tests with Vitest and end-to-end browser tests with Playwright. Core packages including the OpenAPI parser, workspace store, and code generation library have comprehensive test suites covering document edge cases, reference resolution, circular $refs, and language-specific code generation output. Type safety is enforced via strict TypeScript configuration with TypeBox providing runtime schema validation for OpenAPI documents. Biome enforces consistent linting and formatting, and Lefthook runs pre-commit checks. Named exports, explicit return types, and JSDoc comments on public APIs are consistent across packages. Error handling in the parser and workspace store uses explicit result types and structured error objects rather than uncaught exceptions. The changeset-based release workflow ensures all package version bumps are independently traceable with linked changelogs.
What Makes It Unique
Scalar’s most technically distinctive contribution is snippetz, a client-side code generation system producing runnable HTTP snippets for an unusually broad set of targets — where most OpenAPI tools still rely on server-side generation requiring build pipelines, Scalar computes all examples in the browser from HAR-format request objects. The workspace store’s Proxy-based magic diffing system enables Watch Mode, where server framework changes are reflected immediately in the API client without manual refresh — a workflow that elsewhere requires external file watchers or manual re-imports. First-class AsyncAPI 3.1 support alongside OpenAPI 3.x is rare in the API tooling space, and the json-magic bundle engine resolves circular $refs and external URLs in the browser with a lazy evaluation strategy that avoids the memory issues plaguing alternative approaches. The CDN-deployable standalone bundle requiring only a <script> tag and a spec URL for a fully interactive API reference is meaningfully lower friction than alternatives that require build steps or dedicated documentation site generators.
Self-Hosting
Scalar is released under the MIT License, the most permissive of the mainstream open-source licenses. This means you can use it commercially, modify the source, redistribute it in proprietary products, and embed it in closed-source documentation tooling without any obligation to publish your changes. There are no copyleft requirements, no CLA beyond what GitHub requires for contributions, and no distinction between commercial and non-commercial use in the license terms.
Self-hosting Scalar is operationally lightweight compared to full application platforms. The API reference renderer and API client are client-side applications: you serve static assets (the standalone bundle or the npm package output) and your OpenAPI document — no database, no backend process, no persistent state. For teams that want the hosted editor and GitHub Sync features, they would need to run the galaxy-scalar-com project or accept that those features require the managed cloud. The desktop API client distributes as a standard Electron application with no server-side component. The mock server and void server packages are simple Node.js processes with minimal dependencies, suitable for running in Docker with a small memory footprint.
Scalar’s managed cloud (scalar.com) offers free hosting with a custom subdomain, team collaboration, GitHub Sync, and free-form documentation pages that go beyond what the self-hosted reference renderer provides. The paid tiers add custom domains, priority support, and higher usage limits. Self-hosters give up the hosted editor UI, automatic GitHub Sync, and managed SSL termination, but retain full control of their data and specification files. There are no phone-home requirements or license checks in the open-source packages — the entire API reference and client functionality runs fully offline once assets are deployed.
Related Apps
Ollama
AI Development · Developer Tools
Run Llama, Gemma, DeepSeek, and other open LLMs on your own machine with one command and an OpenAI-compatible API.
Ollama
MITDify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.
Dify
OtherFirecrawl
AI Development · Developer Tools
Turn any website into clean, LLM-ready data with a single API call — no proxy headaches, no scraping complexity.