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:

  • For a full build, it uses less memory than HeyAPI and orval on every spec we measured, and has the smallest install.
  • 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 a full build, Kubb is the fastest on the three smaller specs and ties HeyAPI on Cloudflare. In types only, Kubb does not lead every spec. openapi-typescript is the fastest on the three larger specs, and orval uses the least memory on three of the four.

up to 2.0×faster than the other generators
petStore 11 KB 1.3–1.5× faster
Kubb · 610 ms
HeyAPI · 791 ms
orval · 893 ms
twitter 383 KB 1.3–1.9× faster
Kubb · 1.1 s
HeyAPI · 1.4 s
orval · 2.0 s
bunq 1.9 MB 1.1–2.0× faster
Kubb · 2.5 s
HeyAPI · 2.6 s
orval · 4.8 s
Cloudflare 27.6 MB 1.0–1.4× faster
Kubb · 22.2 s
HeyAPI · 22.2 s
orval · 30.8 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.

The numbers are the median of five runs on Node 22, Linux x64 with 4 cores, in November 2026. The runs compared kubb 5.15.3 (@kubb/plugin-ts 5.4.0, @kubb/plugin-zod 5.8.0, @kubb/plugin-fetch 5.11.0) with @hey-api/openapi-ts 0.99.0, orval 8.46.0, and openapi-typescript 7.13.0. orval has no types-only mode, so it writes models only there. Install size is node_modules after a clean npm install of each tool's packages for that 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🛑3🛑3
TypeScript types✅✅✅✅
HTTP client (Axios, Fetch)✅✅✅🔶4
React Query hooks✅✅✅🟡4
Vue Query composables✅✅✅🛑
SWR hooks✅✅🛑5🟡
Zod validation schemas✅✅✅🛑
MSW request handlers✅✅🛑5🛑
Faker.js mock data✅✅🛑5🛑
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 reads the OpenAPI 3.2 fields that code generation uses into its AST, including itemSchema for streamed responses, $self and tag parent. A 3.2 document is not validated until @readme/openapi-parser supports 3.2.
  3. orval, HeyAPI, and openapi-typescript list no OpenAPI 3.2 support in their docs. An orval discussion asks for it.
  4. openapi-typescript generates types only. Clients and hooks come from the openapi-fetch and openapi-react-query runtimes, both in maintenance mode.
  5. 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.