Kubb vs orval, HeyAPI, and openapi-typescript
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.
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
| Difference | Details |
|---|---|
| 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.
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-ts5.5.3,@kubb/plugin-zod5.9.3,@kubb/plugin-fetch6.0.3),@hey-api/openapi-ts0.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
| Feature | Kubb | orval | HeyAPI | openapi-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 | โ | โ | โ | ๐ |
- openapi-typescript 7 reads 3.0 and 3.1 only. Convert Swagger 2.0 first, or use version 5.
- Kubb generates every OpenAPI 3.2 feature we tested: the
QUERYmethod,additionalOperations,querystringparameters,itemSchemafor server-sent events and JSON Lines, andcomponents/mediaTypes. - orval 8.48.0 generates
QUERYoperations. It skipsadditionalOperationsandquerystringparameters, and typesitemSchemaresponses and media type references asunknown. - HeyAPI 0.99.0 and openapi-typescript 7.13.0 read a 3.2 document without an error, but skip
QUERYandadditionalOperationsoperations, dropquerystringparameters, and type the other 3.2 features asunknown. - openapi-typescript generates types only. Clients and hooks come from the
openapi-fetchandopenapi-react-queryruntimes, all in maintenance mode. - 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.
| Feature | Kubb | orval | HeyAPI |
|---|---|---|---|
| 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 | โ | โ | โ |
- Only orval's
fetchclient returns a status union and a typed error body. Its axios and query clients return the success type. - HeyAPI returns
{ data, error }with nostatusto switch on. - HeyAPI 0.99.0 keeps only the JSON shape when a response also offers XML.
Client runtime
Configure serialization has Kubb's runtime contract.
| Feature | Kubb | orval | HeyAPI |
|---|---|---|---|
| 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 | โ | ๐ | โ |
- Only orval's
fetchclient readsstyleandexplode. - HeyAPI uses one global query serializer and does not style header or cookie parameters.
- 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:
- API skills for Claude Code, Cursor, and Codex, built from your spec, so AI tools call your generated clients (Pro plan).
- One AI plugin marketplace and shared agents for the team.
- Review added, changed, and removed files before you save them.
- Edit
kubb.config.tsfrom the browser. - An installable snapshot for every pull request.
- Try it in the browser without installing anything.
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.
