Openapi Ts

screenshot of Openapi Ts

OpenAPI to TypeScript codegen. Production-ready SDKs, Zod schemas, TanStack Query hooks, and 20+ plugins. Used by Vercel, OpenCode, and PayPal.

Overview:

The @hey-api/openapi-ts is a powerful tool for generating TypeScript interfaces and SDKs from OpenAPI specifications. It supports various features like working with CLI, Node.js, and npx, supporting different OpenAPI versions, input file formats, and client options. The tool also offers a plugin ecosystem to reduce third-party boilerplate, with GitHub integration and quick start guides for easy usage.

Features:

  • Works with CLI, Node.js 18+, or npx: Provides flexibility in how you generate TypeScript interfaces and SDKs.
  • Supports OpenAPI 2.0, 3.0, and 3.1 specifications: Ensures compatibility with different OpenAPI versions.
  • Supports JSON and YAML input files: Allows users to input files in multiple formats for convenience.
  • Generates TypeScript interfaces and SDKs: Automatically creates necessary code for TypeScript projects.
  • Multiple client options available: Supports Fetch API, Axios, Nuxt, Angular, Node.js, and XHR clients for API requests.
  • Plugin ecosystem to reduce third-party boilerplate: Offers the ability to customize plugins for tailored solutions.
  • GitHub Integration (coming 2025): Planned feature to update code automatically when APIs change.

Summary:

The @hey-api/openapi-ts tool is a versatile solution for developers working with OpenAPI specifications in TypeScript projects. With support for various features and versions, the tool simplifies the process of generating interfaces and SDKs, while offering customization through plugins. Developers can easily set up the tool via CLI, Node.js, or npx, making it a valuable asset for API integration and development workflows.