Open-source project
openapi-ts/openapi-typescript avatar
openapi-ts/openapi-typescript

openapi-typescript and openapi-fetch: one schema, two packages

Generate TypeScript types from OpenAPI 3 specs

8,441 stars674 forksTypeScriptMIT

At a glance

What is it?
A pnpm and turbo monorepo that turns static OpenAPI schemas into TypeScript types, plus a fetching layer generated from the same schema. The interesting engineering is in the repo plumbing: a hard 7.5 kB size limit on the fetch bundle, an arethetypeswrong devDependency, and changesets driving releases.
Who is it for?
openapi-typescript fits teams with a checked-in OpenAPI document who want types and a thin fetch layer without hand-written clients, and openapi-fetch stays attractive while its 7.5 kB budget holds. Skip it if you need the generated client to carry heavy runtime behaviour, or if your spec is the source of truth in another repo and nobody will own the generated file.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 60 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • openapi-ts/openapi-typescript8,441 ★ · +63
Star history
Repository2026-09-222026-11-23
openapi-ts/openapi-typescript8.4k8.4k

63 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The repository is two published packages under one roof

The split is the design decision. `openapi-typescript` generates TypeScript types from static OpenAPI schemas. `openapi-fetch` is described as fetching for TypeScript, generated automatically from your OpenAPI schema. One repo, two packages, and a team can take the types without the fetcher, or both.

Everything else at the top level exists to serve those two. `packages/` holds them, `docs/` holds the site, `.changeset/` records what changed in each release, and `pnpm-workspace.yaml` declares the workspace shape. A contributor guide exists per package plus one for docs, which tells you the packages are versioned independently rather than as one artifact.

The three most recent releases, openapi-fetch 0.17.0, openapi-typescript-helpers 0.1.0 and openapi-react-query 0.5.4, were all published on 2026-02-11, and all three sit below 1.0, so their interfaces carry no stability promise.

The root README gives you no install command at all

Here is the gap worth knowing before you plan an adoption. The README on the repository root is 165 words, and it contains no shell command, no package manager invocation, and no configuration example. What it does contain is the package list, a sponsors section, contribution pointers, and credits for the docs toolchain.

So the answer to how to install is not in the repository root. The homepage openapi-ts.dev is where the project sends you for documentation, and the docs site is built with Vitepress, hosted on Cloudflare Pages, with Algolia providing search. Per-package CONTRIBUTING.md files are linked for anyone changing code, not for consumers wiring up a build.

Practical consequence: budget a trip to openapi-ts.dev before you can answer the first question a team asks, which is what the generated output looks like. Nothing here can be evaluated by reading the front page alone.

A 7.5 kB ceiling is enforced on the openapi-fetch bundle

The monorepo root package.json holds a size-limit entry pointing at the built fetch package with a hard ceiling and no compression applied:

json
"size-limit": [
  {
    "path": "packages/openapi-fetch/dist/index.mjs",
    "limit": "7.5 kB",
    "brotli": false
  }
]

`brotli: false` matters for interpretation: the limit is measured on the raw file, which is the harsher measure. The size check fails when the fetch bundle exceeds 7.5 kB, and `turbo run size-limit` is wired as the repo's `size` script.

That ceiling shapes the package. openapi-fetch is where schema-derived request and response typing meets runtime fetching, and it has to stay small enough that adding it to a frontend bundle is close to free. Expect features that would need their own runtime weight to be argued against, and expect the type layer to carry more of the load than you would design it to.

The build runs through turbo on pnpm, with version fixed by packageManager

The toolchain is pinned rather than left to whatever is installed. The root declares `"packageManager": "[email protected]"`, `"type": "module"`, and private with version 0.0.0, since the individual packages carry the real versions.

Every task fans out through turbo:

json
"scripts": {
  "build": "turbo run build",
  "lint": "turbo run lint",
  "test": "turbo run test",
  "test-e2e": "turbo run test-e2e",
  "size": "turbo run size-limit"
}

Releases are not manual. The `version` script runs the build, then changeset version, then a fresh install, and the changelog is formatted by `@changesets/changelog-github`.

Unit tests run on Vitest with a workspace file, and `@playwright/test` covers the e2e tier. `renovate.json` sits at the root for dependency updates.

@arethetypeswrong/cli is a dependency, so published types are checked for resolution

Among the root devDependencies sits `@arethetypeswrong/cli` at 0.18.5. It is the tool that reports whether a package's type declarations resolve correctly for consumers, across module formats and export conditions. Having it as a pinned devDependency suggests the project checks that the types it ships are usable from the outside.

That check matters more for a codegen tool than for a normal library. The output is types, so if the published entry points do not resolve the way a consumer's tsconfig expects, the package is broken in the only way it can be broken. The generator can emit perfect types into a package nobody can import.

TypeScript itself is pulled from the workspace catalog, referenced as `catalog:`, rather than as a fixed version. The same catalog mechanism, declared in pnpm-workspace.yaml, is how multiple packages agree on one TypeScript version without each pinning its own.

The last push is 2026-09-25 but the last release is from February

Those two dates describe different things. The last push to the repository was on 2026-09-25, which is recent activity on the main branch. The three most recent releases, openapi-fetch 0.17.0, openapi-typescript-helpers 0.1.0 and openapi-react-query 0.5.4, all carry 2026-02-11.

So work is landing in the repository while the published packages sit at February versions. If you pin one of those February releases you are pinning code that predates the 2026-09-25 push.

The version numbering splits the picture further. 0.17.0, 0.1.0 and 0.5.4 for the fetch, helpers and React Query packages all signal early interfaces. Anyone adopting the React Query layer should expect churn there and should check whether their project's React and TanStack Query versions match what those early releases were built against.

What the type generator does not cover

Scope is narrow on purpose, and the narrowness has consequences. `openapi-typescript` reads a static OpenAPI schema and emits types. It does not run your API, it does not validate responses at runtime on its own, and nothing in the repository root describes behaviour against a live endpoint.

The docs site carries the detail the README omits, and it is where you check how a given schema construct is handled, what output shape to expect for a specific keyword, and which OpenAPI versions are supported. Version support in particular is worth checking against your spec before you wire a build step around it.

If you need mocks, request validation, or a generated client with runtime behaviour beyond fetching, this repository does not describe providing those. openapi-fetch stays close to the wire on purpose, which is exactly why the size limit is set where it is.

Editorial conclusion

openapi-typescript fits teams with a checked-in OpenAPI document who want types and a thin fetch layer without hand-written clients, and openapi-fetch stays attractive while its 7.5 kB budget holds. Skip it if you need the generated client to carry heavy runtime behaviour, or if your spec is the source of truth in another repo and nobody will own the generated file. Verify first that the packages released on 2026-02-11 still match your spec's OpenAPI version, since the last push on 2026-09-25 came after those releases and unreleased changes sit in main.

Frequently asked questions

What is openapi-typescript used for?

It generates TypeScript types from static OpenAPI schemas, so a frontend can type its API calls against a checked-in spec. The repository root also ships openapi-fetch for fetching in TypeScript.

How do I use openapi-typescript codegen?

The repository root README names no install command and no codegen invocation; it is 165 words long and points to the docs site. Usage details live at openapi-ts.dev.

Is openapi-ts the same project as openapi-typescript?

The homepage is openapi-ts.dev while the repository is openapi-ts/openapi-typescript and the package is openapi-typescript. The project name covers two packages, openapi-typescript and openapi-fetch.

Does openapi-typescript support Python output?

Nothing in the repository describes a Python package. The two documented packages both target TypeScript, one for types and one for fetching.

Official sources

  1. License: MIT
  2. openapi-ts/openapi-typescript on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/openapi-ts-openapi-typescript.svg)](https://hysenlabs.com/projects/openapi-ts-openapi-typescript)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/openapi-ts-openapi-typescript.svg)](https://hysenlabs.com/projects/openapi-ts-openapi-typescript)

Was this useful?