TypeSpec
Describe APIs
Describe your data up front and generate schemas, API specifications, client / server code,
docs, and more.
Why TypeSpec
API-First for developers
With TypeSpec, remove the handwritten files that slow you down, and generate
standards-compliant API schemas in seconds.
Lightweight language for defining APIs
Inspired by TypeScript, TypeSpec is a minimal language that helps developers describe API shapes in a familiar way.
Learn more →
Easy integration with your toolchain
Write TypeSpec, emit to various formats and integrate with their ecosystems.
Multi-protocol support
TypeSpec's standard library includes support for OpenAPI 3.0, JSON Schema 2020-12 and Protobuf.
Learn more →
~ /my-project tsp init? Select a templateEmpty project> REST API
Productivity
Streamline your OpenAPI workflow
Benefit from a huge ecosystem of OpenAPI tools for configuring API gateways, generating code, and validating your data.
Generate OpenAPI from TypeSpec
Learn more →
Ecosystem
Ensure data consistency
Define common models to use across your APIs, use the JSON schema emitter to get the JSON schema for your types and use them to validate your data.
JSON schema emitter reference
Learn more →
Tooling
Full language support in VS Code and Visual Studio
TypeSpec provides built-in support for many common editor features such as syntax highlighting, code completion, and more.
Check out our available tooling
Learn more →
Extensibility
Generate assets in many formats
TypeSpec is built around extensibility - you can write your own emitter or add custom metadata using a new decorator.
Getting started with writing a library
Learn more →
Start your TypeSpec journey
Install the TypeSpec CLI or check out the playground to get started.