TypeSpec
typespec.io
What it is
TypeSpec is a language for defining API shapes and data models, then producing schemas, API specifications, code, and documentation. Its standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf. OpenAPI output can feed tools for API gateways, code generation, and validation; JSON Schema output can be used to validate data built from shared models. The HTTP library’s `@useAuth` decorator lets authors attach documented security schemes—including HTTP authentication, API keys, OAuth2, and OpenID Connect—to services, interfaces, or operations. Editor support for Visual Studio Code and Visual Studio includes syntax help and completion; the VS Code extension adds diagnostics, formatting, quick fixes, refactoring, and documentation preview. Users can extend TypeSpec with emitters and decorators. The CLI is available through npm for Node.js or as an experimental standalone executable, and a browser playground is available. TypeSpec is open source and free: free. Its emitter framework is experimental, and client emitters for JavaScript, Python, Java, and C# are in preview.
Spec sheet
- Purpose
- TypeSpec is a language for designing APIs and data models, then generating schemas, API specifications, code, and documentation.Read 3 Oct 2026 · typespec.io
- Integrations
- The VS Code extension can import TypeSpec from existing OpenAPI 3 definitions and emit code from TypeSpec.Read 3 Oct 2026 · typespec.io
- Maker
- TypeSpec describes itself as a Microsoft-built, community-supported project.Read 3 Oct 2026 · typespec.io
- Authentication modeling
- The HTTP library's @useAuth decorator supports applying authentication schemes to a service namespace, sub-namespace, interface, or operation.Read 3 Oct 2026 · typespec.io
- Browser playground
- The official site links to a TypeSpec Playground for trying TypeSpec in a browser.Read 3 Oct 2026 · typespec.io
- Built-in formats
- Its standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protocol Buffers (Protobuf).Read 3 Oct 2026 · typespec.io
- Client generation
- The client emitter guide lists JavaScript, Python, Java, and C# client emitters and says they are in preview and subject to change.Read 3 Oct 2026 · typespec.io
- Data validation
- The JSON Schema emitter can produce schemas from shared models for validating data.Read 3 Oct 2026 · typespec.io
- Editor integrations
- TypeSpec provides language support for VS Code and Visual Studio, including syntax highlighting and code completion.Read 3 Oct 2026 · typespec.io
- Editor support
- TypeSpec provides extensions for Visual Studio Code and Visual Studio.Read 3 Oct 2026 · typespec.io
- Emitter status
- The emitter framework is experimental and under active development, and the documentation says only TypeScript is well supported at the time of that page.Read 3 Oct 2026 · typespec.io
- Extensibility
- Developers can write custom emitters or add metadata with custom decorators.Read 3 Oct 2026 · typespec.io
- Installation
- The CLI is available as an npm package for Node.js or as a standalone executable marked experimental; installation instructions cover macOS, Windows, and Linux.Read 3 Oct 2026 · typespec.io
- Language
- TypeSpec is inspired by TypeScript and is described as a lightweight language for defining API shapes.Read 3 Oct 2026 · typespec.io
- Online access
- The site provides an online playground for trying TypeSpec.Read 3 Oct 2026 · typespec.io
- OpenAPI workflow
- TypeSpec can generate OpenAPI specifications for use with tools for API gateways, code generation, and data validation.Read 3 Oct 2026 · typespec.io
- Output formats
- The standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf.Read 3 Oct 2026 · typespec.io
- Pricing
- The official homepage and documentation pages reviewed present TypeSpec as an installable project and do not list paid plans or prices.Read 3 Oct 2026 · typespec.io
- Publisher and support
- TypeSpec is described as a Microsoft-built, community-supported project.Read 3 Oct 2026 · typespec.io
- Supported auth schemes
- Documented security scheme options include HTTP authentication, API keys, OAuth2, and OpenID Connect.Read 3 Oct 2026 · typespec.io
- Telemetry
- The VS Code extension collects usage data and sends it to Microsoft; the page says it respects the telemetry.telemetryLevel setting.Read 3 Oct 2026 · typespec.io
- Telemetry privacy
- The VS Code extension documentation says unknown customer emitters are masked and compiler location telemetry does not store the actual compiler path.Read 3 Oct 2026 · typespec.io
- VS Code features
- The VS Code extension provides IntelliSense, syntax highlighting, completion, formatting, diagnostics, quick fixes, refactoring, and API documentation preview.Read 3 Oct 2026 · typespec.io
Plans and prices
Strong points and limits
Strong points
- Supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf.
- Models authentication schemes with `@useAuth`.
- VS Code extension includes diagnostics and refactoring.
- Free, open-source project with an online playground.
Limits
- Emitter framework is experimental and under active development.
- Client emitters are in preview and subject to change.
- Standalone executable is marked experimental.
- VS Code extension collects usage data sent to Microsoft.
Who it suits
TypeSpec suits API designers and developers who want shared models to generate specifications, schemas, code, or documentation. It is a fit for teams working in Visual Studio Code or Visual Studio, or those who want to try the browser playground.
Verdict
TypeSpec provides a free way to define API models and generate several common specification formats. The experimental emitter framework and preview client emitters are important limits for teams relying on those outputs.
Where Specifiction places it
- API Generation Software#4 of 258.2
- Code Generators#12 of 338.2
- API Design Tools#13 of 268.2