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:
- 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.
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
| Feature | Kubb | orval | HeyAPI | openapi-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 | โ | โ | โ | ๐ |
- openapi-typescript reads 3.0 and 3.1 only. Convert Swagger 2.0 first.
- 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.