Kubb vs orval, HeyAPI, and openapi-typescript
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.
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
| 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 | 🛑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 | ✅ | ✅ | ✅ | 🛑 |
- openapi-typescript 7 reads 3.0 and 3.1 only. Convert Swagger 2.0 first, or use version 5.
- Kubb reads the OpenAPI 3.2 fields that code generation uses into its AST, including
itemSchemafor streamed responses,$selfand tagparent. A 3.2 document is not validated until@readme/openapi-parsersupports 3.2. - orval, HeyAPI, and openapi-typescript list no OpenAPI 3.2 support in their docs. An orval discussion asks for it.
- openapi-typescript generates types only. Clients and hooks come from the
openapi-fetchandopenapi-react-queryruntimes, both 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 it is left out of this table and the next one.
| 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
See serialization for 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. 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.
- API skills for Claude Code, Cursor, and Codex, built from your spec, so AI tools call your generated clients instead of guessing endpoints (Pro plan).
- One AI plugin marketplace and shared agents for the whole 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 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.