Skip to content
Explanation

Kubb vs orval, HeyAPI, and openapi-typescript

Compare Kubb with orval, HeyAPI, and openapi-typescript on speed, memory, install size, generated outputs, type safety, client runtime, and Kubb Studio.

Kubb, orval, HeyAPI, and openapi-typescript all generate code from OpenAPI specs. We checked each cell against the project's own docs in October 2026.

Kubb differs from the others in five ways:

  • It generates faster and uses less memory than HeyAPI and orval at every spec size we measured.
  • One config generates types, clients, query hooks, Zod, MSW, Faker, Cypress tests, an MCP server, and Redoc docs. See plugin coverage.
  • Its clients return a result you narrow by status code, and you choose per call whether errors throw. See type safety.
  • Its runtime follows the spec's parameter styles, encodes bodies per media type, and reads server-sent events. See client runtime.
  • Kubb Studio adds file review, pull request snapshots, and API skills for AI tools.

Speed, memory, and install size

Switch between a full build (types, Zod schemas, and a fetch client) and types only, where openapi-typescript joins. In types only, openapi-typescript is faster than Kubb on the largest spec, but uses more memory.

up to 2.9ร—faster than the other generators
petStore 11 KB 2.5โ€“2.9ร— faster
Kubb ยท 347 ms
HeyAPI ยท 996 ms
orval ยท 880 ms
twitter 383 KB 1.6โ€“2.6ร— faster
Kubb ยท 1.1 s
HeyAPI ยท 1.8 s
orval ยท 2.9 s
bunq 1.9 MB 1.2โ€“1.9ร— faster
Kubb ยท 3.2 s
HeyAPI ยท 3.9 s
orval ยท 6.1 s
Cloudflare 27.6 MB 1.6โ€“2.7ร— faster
Kubb ยท 21.2 s
HeyAPI ยท 33.8 s
orval ยท 58.1 s
Median of five runs on Node 22, each tool writing to disk. Kubb runs with spec validation off; the other tools run on their defaults. orval has no types-only mode, so its types-only runs also write a fetch client. openapi-typescript only generates types.

Median of five runs on Node 22, Linux x64, October 2026. Kubb ran from the main branches of kubb-labs/kubb and kubb-labs/plugins on October 24 (the first build after kubb 5.12.8 without the TypeScript compiler). Compared with @hey-api/openapi-ts 0.99.0, orval 8.44.0, and openapi-typescript 7.13.0. Install size is node_modules after a clean npm install with the same features.

Plugin and feature coverage

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

FeatureKubborvalHeyAPIopenapi-ts
OpenAPI 2.0, 3.0, 3.1 inputโœ…โœ…โœ…๐Ÿ”ถ1
TypeScript typesโœ…โœ…โœ…โœ…
HTTP client (Axios, Fetch)โœ…โœ…โœ…๐Ÿ”ถ2
React Query hooksโœ…โœ…โœ…๐ŸŸก2
Vue Query composablesโœ…โœ…โœ…๐Ÿ›‘
SWR hooksโœ…โœ…๐Ÿ›‘3๐ŸŸก
Zod validation schemasโœ…โœ…โœ…๐Ÿ›‘
MSW request handlersโœ…โœ…๐Ÿ›‘3๐Ÿ›‘
Faker.js mock dataโœ…โœ…๐Ÿ›‘3๐Ÿ›‘
Cypress E2E testsโœ…๐Ÿ›‘๐Ÿ›‘๐Ÿ›‘
MCP serverโœ…โœ…๐Ÿ›‘๐Ÿ›‘
Redoc API documentationโœ…๐Ÿ›‘๐Ÿ›‘๐Ÿ›‘
Barrel index filesโœ…โœ…โœ…๐Ÿ›‘
  1. openapi-typescript reads 3.0 and 3.1 only. Convert Swagger 2.0 first.
  2. openapi-typescript generates types only. Clients and hooks come from the openapi-fetch and openapi-react-query runtimes, both in maintenance mode.
  3. HeyAPI lists SWR as planned and MSW and Faker as in progress.

Type safety and response handling

openapi-typescript ships no generated client, so it is left out of this table and the next one.

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

See serialization for 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. It runs the generator through an agent on your machine, and the agent never uploads your spec file. orval, HeyAPI, and openapi-typescript have no equivalent for the features below.

To try the others without installing them, 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.