Movatterモバイル変換


[0]ホーム

URL:


Host your specs. Generate from anywhere.Get started
Skip to content

Appearance

Get Started

@hey-api/openapi-ts generates TypeScript code from OpenAPI specifications. Point it at your spec, pick your plugins, and get production-ready code in seconds.

Used by companies like Vercel, OpenCode, and PayPal.

“OpenAPI codegen that just works.”

— Guillermo Rauch, CEO of Vercel

Demo

Features

  • production-ready code that compiles
  • runs in any Node.js 20+ environment
  • accepts any OpenAPI specification
  • core plugins for SDKs, types, and schemas
  • HTTP clients for Fetch API, Angular, Axios, Next.js, Nuxt, and more
  • 20+ plugins to reduce third-party boilerplate
  • highly customizable via plugins
  • sync with Hey API Registry for spec management

Quick Start

The fastest way to use@hey-api/openapi-ts is via npx

sh
npx @hey-api/openapi-ts -i hey-api/backend -o src/client

Congratulations on creating your first client! 🎉 You can learn more about the generated files on theOutput page.

Installation

You can download@hey-api/openapi-ts from npm using your favorite package manager.

sh
npm install @hey-api/openapi-ts -D -E
sh
pnpm add @hey-api/openapi-ts -D -E
sh
yarn add @hey-api/openapi-ts -D -E
sh
bun add @hey-api/openapi-ts -D -E

Versioning

This package is ininitial development. Please pin an exact version so you can safely upgrade when you're ready.

We publishmigration notes for every breaking release. You might not be impacted by a breaking change if you don't use the affected features.

Usage

CLI

Most people run@hey-api/openapi-ts via CLI. To do that, add a script to yourpackage.json file which will makeopenapi-ts executable through script.

json
"scripts": {  "openapi-ts":"openapi-ts"}

The above script can be executed by runningnpm run openapi-ts or equivalent command in other package managers. Next, we will create aconfiguration file and move our options from Quick Start to it.

Node.js

You can also generate output programmatically by callingcreateClient() in a JavaScript/TypeScript file.

ts
import { createClient }from '@hey-api/openapi-ts';createClient({  input:'hey-api/backend',// sign up at app.heyapi.dev  output:'src/client',});

Configuration

It's a good practice to extract your configuration into a separate file. Learn how to do that and discover available options on theConfiguration page.

Examples

You can view live examples onStackBlitz.

Sponsors

Hey API is sponsor-funded. If you rely on Hey API in production, consider becoming asponsor to accelerate the roadmap.

Gold

Silver

Bronze

  • Kinde logo

Friends


[8]ページ先頭

©2009-2026 Movatter.jp