Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

TypeSpec

typespec.io

  • Free plan
  • Windows
  • macOS
  • Linux
  • Web
  • Browser extension
8.1 Club score Visit typespec.io

What TypeSpec is

TypeSpec is a language for defining APIs and data models, then generating schemas, API specifications, code, and documentation. Inspired by TypeScript, it offers a lightweight way to describe API shapes. Its standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf. OpenAPI output can feed tools for API gateways, code generation, and data validation; JSON Schema output can validate data against shared models. TypeSpec provides language support for Visual Studio Code and Visual Studio. The VS Code extension includes syntax highlighting, completion, formatting, diagnostics, quick fixes, refactoring, and API documentation preview. Developers can add custom decorators or build emitters. The CLI is available through npm for Node.js, with a standalone executable marked experimental, and a browser playground is available. TypeSpec is a Microsoft-built, community-supported open-source project listed as free. Its emitter framework is experimental and under active development; documentation says TypeScript is the only well-supported language for it. Client emitters for JavaScript, Python, Java, and C# are in preview and subject to change.

Who it suits

TypeSpec suits developers who want to define API contracts and data models in one language, especially those using Visual Studio Code or Visual Studio. It may also suit teams seeking OpenAPI or JSON Schema output for downstream tools.

Good to know, and what to watch

  • Supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf
  • VS Code extension includes diagnostics and quick fixes
  • Browser playground allows trying TypeSpec online
  • Custom decorators and emitters extend the language
  • Emitter framework is experimental and under active development
  • Only TypeScript is described as well supported for emitters
  • Client emitters are in preview and subject to change
  • VS Code extension collects usage data sent to Microsoft

TypeSpec

Free

Open source

The verdict

TypeSpec offers a free, open-source path from API models to several common schema formats, with editor support and a browser playground. Treat emitter and client generation support as evolving, rather than settled.

What the maker publishes

Authentication modeling
The HTTP library's @useAuth decorator supports applying authentication schemes to a service namespace, sub-namespace, interface, or operation. source
Browser playground
The official site links to a TypeSpec Playground for trying TypeSpec in a browser. source
Built-in formats
Its standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protocol Buffers (Protobuf). source
Client generation
The client emitter guide lists JavaScript, Python, Java, and C# client emitters and says they are in preview and subject to change. source
Data validation
The JSON Schema emitter can produce schemas from shared models for validating data. source
Editor integrations
TypeSpec provides language support for VS Code and Visual Studio, including syntax highlighting and code completion. source
Editor support
TypeSpec provides extensions for Visual Studio Code and Visual Studio. source
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. source
Extensibility
Developers can write custom emitters or add metadata with custom decorators. source
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. source
Integrations
The VS Code extension can import TypeSpec from existing OpenAPI 3 definitions and emit code from TypeSpec. source
Language
TypeSpec is inspired by TypeScript and is described as a lightweight language for defining API shapes. source
Maker
TypeSpec describes itself as a Microsoft-built, community-supported project. source
Online access
The site provides an online playground for trying TypeSpec. source
OpenAPI workflow
TypeSpec can generate OpenAPI specifications for use with tools for API gateways, code generation, and data validation. source
Output formats
The standard library supports OpenAPI 3.0, JSON Schema 2020-12, and Protobuf. source
Pricing
The official homepage and documentation pages reviewed present TypeSpec as an installable project and do not list paid plans or prices. source
Publisher and support
TypeSpec is described as a Microsoft-built, community-supported project. source
Purpose
TypeSpec is a language for designing APIs and data models, then generating schemas, API specifications, code, and documentation. source
Supported auth schemes
Documented security scheme options include HTTP authentication, API keys, OAuth2, and OpenID Connect. source
Telemetry
The VS Code extension collects usage data and sends it to Microsoft; the page says it respects the telemetry.telemetryLevel setting. source
Telemetry privacy
The VS Code extension documentation says unknown customer emitters are masked and compiler location telemetry does not store the actual compiler path. source
VS Code features
The VS Code extension provides IntelliSense, syntax highlighting, completion, formatting, diagnostics, quick fixes, refactoring, and API documentation preview. source

Checked against the maker's pages on 3 Oct 2026.