# Source: https://heyapi.dev/openapi-ts/get-started.md

---
url: /openapi-ts/get-started.md
description: Get started with @hey-api/openapi-ts.
---

# Get Started

[@hey-api/openapi-ts](https://github.com/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

\<button class="buttonLink" @click="(event) => embedProject('hey-api-example')(event)">
Launch 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](/openapi-ts/integrations) 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 the [Output](/openapi-ts/output) page.

## Installation

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

::: code-group

```sh [npm]
npm install @hey-api/openapi-ts -D -E
```

```sh [pnpm]
pnpm add @hey-api/openapi-ts -D -E
```

```sh [yarn]
yarn add @hey-api/openapi-ts -D -E
```

```sh [bun]
bun add @hey-api/openapi-ts -D -E
```

:::

### Versioning

This package is in [initial development](https://semver.org/#spec-item-4). Please pin an exact version so you can safely upgrade when you're ready.

We publish [migration notes](/openapi-ts/migrating) 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 your `package.json` file which will make `openapi-ts` executable through script.

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

The above script can be executed by running `npm run openapi-ts` or equivalent command in other package managers. Next, we will create a [configuration](/openapi-ts/configuration) file and move our options from Quick Start to it.

### Node.js

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

::: code-group

```ts [script.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 the [Configuration](/openapi-ts/configuration) page.

## Examples

You can view live examples on [StackBlitz](https://stackblitz.com/orgs/github/hey-api/collections/openapi-ts-examples).

## Sponsors

Hey API is sponsor-funded. If you rely on Hey API in production, consider becoming a [sponsor](https://github.com/sponsors/hey-api) to accelerate the roadmap.