Generate TypeScript interfaces from an OpenAPI schema. Part of the DevTools Surf developer suite. Browse more tools in the Developer Utilities collection.
Use Cases
Frontend teams generating type-safe API client code
Backend developers ensuring API contracts match implementations
SDK authors automating client library generation from specs
Full-stack teams sharing types between server and client codebases
Tips
Generate interfaces for request bodies and response types
Use readonly modifiers for immutable response properties
Include enum types from OpenAPI string enumerations
Fun Facts
OpenAPI started as Swagger, created by Tony Tam at Wordnik in 2011 — SmartBear acquired it in 2015 and donated the specification to the Linux Foundation as OpenAPI.
The OpenAPI 3.1 specification, released in 2021, achieved full alignment with JSON Schema, resolving years of subtle incompatibilities between the two standards.
TypeScript's type system is Turing-complete — you can technically encode a full OpenAPI schema as a type-level program, which projects like ts-rest and zodios exploit.
FAQ
Does it support OpenAPI 3.x?
3.0 and 3.1 both. OpenAPI 2 (Swagger) needs conversion first — use the Swagger editor's built-in v2→v3 converter.
What does it generate?
TypeScript interfaces for every schema, plus optional API client types for fetch/axios. Operations become typed function signatures.
Fetch client or just types?
Toggle — types only (use with your own client) or a full fetch-based client. For Zod-validated clients, pair with the json-to-zod tool.
How does it handle allOf/oneOf?
allOf → intersection type. oneOf → union type. discriminator keys produce type guards automatically.