• Pricing
  • Blog
Sign InGet Started

OpenAPI → TypeScript (2026)

Generate TypeScript interfaces and types from your OpenAPI / Swagger components.schemas. Handles enums, $refs, oneOf/anyOf/allOf, nullable, and arrays. Copy the result straight into your project.

OpenAPI / Swagger spec
/**
 * Generated by Specway — https://specway.com/tools/openapi-to-typescript
 * Edit your OpenAPI spec, not this file.
 */

export interface User {
  id: number;
  email: string;
  name?: string;
  role?: "admin" | "member" | "guest";
  tags?: string[];
  team?: Team;
}

export interface Team {
  id: string;
  name: string;
  memberCount?: number;
}

Types for your client. Docs for everyone else.

Specway generates the developer portal from the same spec: reference docs, a playground and code samples in five languages.

Publish this spec freeSee pricing

Free plan: 1 API, 1,000 views a month, no credit card, no time limit.

  • Code samples in cURL, Node, Python, Ruby and PHP for every endpoint
  • Interactive reference docs generated from your OpenAPI spec
  • A try-it playground that sends real requests to your API

What gets generated

  • One interface per object schema in components.schemas (or definitions for Swagger 2.0).
  • type aliases for enums and primitive schemas.
  • Optional fields (?:) for anything not in required.
  • Union types for oneOf and anyOf; intersection types for allOf.
  • $ref references resolve to the named interface.
  • nullable: true appends | null.

When to use this vs openapi-typescript

This widget is for the one-off: someone sent you a spec in Slack, you need types in your editor right now. Paste, copy, done.

For production: openapi-typescript

For ongoing projects, install openapi-typescript as a dev dep:

npm i -D openapi-typescript
npx openapi-typescript spec.yaml -o src/api.d.ts

Pair with openapi-fetch for fully-typed request/response handling.

Related tools

OpenAPI Validator
Validate the spec before generating types.
OpenAPI Viewer
Browse the operations the types will cover.
JSON Schema Validator
Validate runtime data against a schema.
OpenAPI → Postman
Generate a Postman collection from the same spec.

Frequently asked questions

Ship API docs that stay this clean

Specway turns one OpenAPI spec into a hosted developer portal with llms.txt and an mcp.json tool manifest. When the spec changes, re-sync in one click.

Try Specway free

Free plan: 1 API, 1,000 views a month, no credit card, no time limit.

API docs that developers and AI agents can use.

Features

  • AI-Generated Docs
  • Interactive Playground
  • Spec URL Sync
  • AI Chatbot
  • Spec Changes
  • Code Samples
  • Custom Branding
  • Analytics

Compare

  • vs ReadMe
  • vs Swagger UI
  • vs Mintlify
  • vs Postman
  • vs Scalar

Product

  • Pricing
  • API Directory
  • Live Demo
  • About
  • Contact

Free Tools

  • JSON Formatter
  • JSON Validator
  • JWT Decoder
  • OpenAPI Validator
  • cURL → Code
  • YAML ↔ JSON
  • All free tools →

Resources

  • Free Developer Tools
  • Blog
  • Guides
  • API Glossary
  • Help Center
  • Support

© 2026 Modlific. All rights reserved.

Privacy PolicyTerms of Service