Skip to content
Introduction

Kubb vs orval, HeyAPI, and openapi-typescript

Compare Kubb with orval, HeyAPI, and openapi-typescript on speed, memory, generated outputs, OpenAPI 3.2 support, type safety, and client runtime.

Kubb, orval, HeyAPI, and openapi-typescript all generate code from OpenAPI specs. This page shows where they differ.

Switch to Kubb

Each guide replaces one output at a time.

Move from orval

Types, client, query hooks, Zod schemas, and MSW mocks.

Move from HeyAPI

Types, SDK and client, TanStack Query, and Zod schemas.

Move from openapi-typescript

Types, openapi-fetch, and openapi-react-query.
openapi-typescript is no longer maintained. In December 2025, its maintainers put openapi-fetch, openapi-react-query, and openapi-metadata into maintenance mode. In September 2026, openapi-typescript itself followed, with no more updates, security fixes included.

Where Kubb differs

DifferenceDetails
Full builds are the fastest of the three and use the least memory on every spec we measured, from 0.1 MB to 29.7 MB.Speed, CPU time, and memory
One config generates types, clients, query hooks, Zod, MSW, Faker, Cypress tests, an MCP server, and Redoc docs.Plugin and feature coverage
Clients return a result you narrow by status code, and each call picks whether errors throw.Type safety and response handling
The runtime follows the spec's parameter styles, encodes bodies per media type, and reads server-sent events.Client runtime
File review, pull request snapshots, and API skills for AI tools.Kubb Studio

We checked each cell in the tables below against each project's docs in October 2026, and the OpenAPI 3.2 row by generating from a 3.2 spec in November 2026.

Speed, CPU time, and memory

Each tool generates types, Zod schemas, and a fetch client. Switch between one file per generator or many, and between speed, CPU time, and memory.

With one file per generator, Kubb is the fastest and uses the least memory on every spec: 1.9 to 2.3ร— faster than HeyAPI and 1.3 to 5.9ร— faster than orval. With multiple files, Kubb still leads on speed and memory. HeyAPI and orval use less CPU time on the 1.1 MB spec, and HeyAPI also on the 10.6 MB spec.

up to 5.9ร—faster than the other generators
Small ยท 0.1 MB 10 resources 1.7โ€“2.0ร— faster
Kubb ยท 416 ms
HeyAPI ยท 829 ms
orval ยท 723 ms
Medium ยท 1.1 MB 100 resources 1.3โ€“1.9ร— faster
Kubb ยท 1.1 s
HeyAPI ยท 2.2 s
orval ยท 1.4 s
Large ยท 10.6 MB 1,000 resources 2.1โ€“2.9ร— faster
Kubb ยท 6.2 s
HeyAPI ยท 12.9 s
orval ยท 17.8 s
XL ยท 29.7 MB 2,800 resources 2.3โ€“5.9ร— faster
Kubb ยท 17.5 s
HeyAPI ยท 40.2 s
orval ยท 102.2 s
Median of five runs (three on the two largest specs) on Node 22, each tool writing types, Zod schemas, and a fetch client to disk with spec and runtime validation off. With multiple files, Kubb uses directory mode grouped by tag and orval uses tags-split. HeyAPI has no option to split its output.

How we measured, in November 2026:

  • The median of five runs (three on the 10.6 MB and 29.7 MB specs) on Node 22, Linux x64 with 4 cores.
  • kubb 5.20.1 (@kubb/plugin-ts 5.5.3, @kubb/plugin-zod 5.9.3, @kubb/plugin-fetch 6.0.3), @hey-api/openapi-ts 0.99.0, and orval 8.47.0.
  • Synthetic OpenAPI 3.0 specs with 10 to 2,800 resources, with spec and runtime validation off in every tool.
  • With multiple files, Kubb uses directory mode grouped by tag and orval uses tags-split. HeyAPI has no option to split its output.

Plugin and feature coverage

โœ… built in ยท ๐ŸŸ  partial ยท ๐ŸŸก community or separate package ยท ๐Ÿ”ถ needs extra user code ยท ๐Ÿ›‘ not supported

FeatureKubborvalHeyAPIopenapi-ts
OpenAPI 2.0 inputโœ…โœ…โœ…๐Ÿ›‘1
OpenAPI 3.0 inputโœ…โœ…โœ…โœ…
OpenAPI 3.1 inputโœ…โœ…โœ…โœ…
OpenAPI 3.2 inputโœ…2๐ŸŸ 3๐Ÿ›‘4๐Ÿ›‘4
TypeScript typesโœ…โœ…โœ…โœ…
HTTP client (Axios, Fetch)โœ…โœ…โœ…๐Ÿ”ถ5
React Query hooksโœ…โœ…โœ…๐ŸŸก5
Vue Query composablesโœ…โœ…โœ…๐Ÿ›‘
SWR hooksโœ…โœ…๐Ÿ›‘6๐ŸŸก
Zod validation schemasโœ…โœ…โœ…๐Ÿ›‘
MSW request handlersโœ…โœ…๐Ÿ›‘6๐Ÿ›‘
Faker.js mock dataโœ…โœ…๐Ÿ›‘6๐Ÿ›‘
Cypress E2E testsโœ…๐Ÿ›‘๐Ÿ›‘๐Ÿ›‘
MCP serverโœ…โœ…๐Ÿ›‘๐Ÿ›‘
Redoc API documentationโœ…๐Ÿ›‘๐Ÿ›‘๐Ÿ›‘
Barrel index filesโœ…โœ…โœ…๐Ÿ›‘
  1. openapi-typescript 7 reads 3.0 and 3.1 only. Convert Swagger 2.0 first, or use version 5.
  2. Kubb generates every OpenAPI 3.2 feature we tested: the QUERY method, additionalOperations, querystring parameters, itemSchema for server-sent events and JSON Lines, and components/mediaTypes.
  3. orval 8.48.0 generates QUERY operations. It skips additionalOperations and querystring parameters, and types itemSchema responses and media type references as unknown.
  4. HeyAPI 0.99.0 and openapi-typescript 7.13.0 read a 3.2 document without an error, but skip QUERY and additionalOperations operations, drop querystring parameters, and type the other 3.2 features as unknown.
  5. openapi-typescript generates types only. Clients and hooks come from the openapi-fetch and openapi-react-query runtimes, all in maintenance mode.
  6. HeyAPI lists SWR as planned and MSW and Faker as in progress.

Type safety and response handling

openapi-typescript ships no generated client, so this table and the next leave it out.

FeatureKubborvalHeyAPI
Status-discriminated response resultโœ…๐Ÿ”ถ1๐Ÿ”ถ2
Multiple success (2xx) responsesโœ…โœ…โœ…
Multiple content types per responseโœ…โœ…๐Ÿ›‘3
default and wildcard (4xx, 5xx) responsesโœ…โœ…โœ…
Typed error responsesโœ…๐Ÿ”ถ1โœ…
Throw or return the error per callโœ…๐Ÿ›‘โœ…
Zod v4 schemas tied to the typesโœ…โœ…โœ…
  1. Only orval's fetch client returns a status union and a typed error body. Its axios and query clients return the success type.
  2. HeyAPI returns { data, error } with no status to switch on.
  3. HeyAPI 0.99.0 keeps only the JSON shape when a response also offers XML.

Client runtime

Configure serialization has Kubb's runtime contract.

FeatureKubborvalHeyAPI
Parameter styles from the specโœ…๐Ÿ”ถ1๐Ÿ”ถ2
OpenAPI encoding object for form bodiesโœ…๐Ÿ›‘๐Ÿ›‘
Pluggable codecs per media type (XML, YAML)โœ…๐Ÿ›‘๐Ÿ›‘
Runtime request and response validationโœ…๐Ÿ”ถ3โœ…
Server-sent eventsโœ…๐Ÿ›‘โœ…
  1. Only orval's fetch client reads style and explode.
  2. HeyAPI uses one global query serializer and does not style header or cookie parameters.
  3. orval validates responses only, with Zod. Kubb accepts any Standard Schema validator (Zod, Valibot, ArkType).

Kubb Studio

Kubb Studio is the web IDE for Kubb. An agent on your machine runs Kubb and never uploads your spec. The other three tools have no equivalent for:

To try the others in the browser, orval has a playground and HeyAPI has a StackBlitz demo.

When not to use Kubb

  • You use only a few endpoints that rarely change.
  • You have no OpenAPI spec and won't write one.
  • You need a non-OpenAPI format now and won't write a custom adapter.