@beta. For v3, read the docs in the v3 branch.Benchmarks
These numbers come from the scripts in benchmarks/ of the repository. Every tool was set up to produce TanStack Query v5 code on a fetch client and otherwise left at its defaults.
What was measured
Section titled “What was measured”- When and where: 2026-11-13, Node.js 24.22.0, Apple M2. Packages released in the seven days before the run were not installed.
- Specifications: Petstore (19 operations), the Stripe API (612) and the GitHub REST API (1,272).
- Versions:
- openapi-react-query-codegen: @7nohe/openapi-react-query-codegen 4.0.0-beta.4
- openapi-typescript: openapi-fetch 0.17.0, openapi-react-query 0.5.4, openapi-typescript 7.13.0
- Kubb: @kubb/plugin-fetch 5.12.0, @kubb/plugin-react-query 5.9.0, @kubb/plugin-ts 5.4.0, kubb 5.15.4
- @hey-api/openapi-ts: @hey-api/openapi-ts 0.99.0
- Orval: orval 8.46.0
Orval was run in its default single-file mode. openapi-typescript generates types only; its hooks are typed at the call site by openapi-react-query.
Generation time
Section titled “Generation time”Median wall-clock time of the command line tool over five runs, after one warm-up run. On a small specification most of it is the start of the process.
| openapi-react-query-codegen | 0.46 s |
|---|---|
| openapi-typescript | 2.10 s |
| Kubb | 2.98 s |
| @hey-api/openapi-ts | 2.98 s |
| Orval | 4.31 s |
| openapi-react-query-codegen | 0.31 s |
|---|---|
| openapi-typescript | 1.37 s |
| Kubb | 2.11 s |
| @hey-api/openapi-ts | 6.60 s |
| Orval | 2.47 s |
| openapi-react-query-codegen | 0.07 s |
|---|---|
| openapi-typescript | 0.27 s |
| Kubb | 0.99 s |
| @hey-api/openapi-ts | 0.37 s |
| Orval | 0.24 s |
Install size
Section titled “Install size”What installing the generator adds to a project that already has React, TanStack Query and TypeScript.
| openapi-react-query-codegen | 9 packages |
|---|---|
| openapi-typescript | 35 packages |
| Kubb | 91 packages |
| @hey-api/openapi-ts | 51 packages |
| Orval | 89 packages |
Type errors in the output
Section titled “Type errors in the output”tsc --noEmit over the generated directory with strict on, TypeScript 7.
| Tool | Petstore | Stripe | GitHub |
|---|---|---|---|
| openapi-react-query-codegen | 0 | 0 | 0 |
| openapi-typescript | 0 | 0 | 0 |
| Kubb | 0 | 0 | 0 |
| @hey-api/openapi-ts | 0 | 274 | 0 |
| Orval | 0 | 219 | 1 |
@hey-api/openapi-ts 0.99.0 does not run in a project with TypeScript 7, and openapi-typescript 7.13.0 declares TypeScript 5 as its peer, so each was run with the newest TypeScript it accepts. Their output was then checked with TypeScript 7 like the rest.
Coding agents
Section titled “Coding agents”The generated files are large: for the GitHub API, queries.ts alone is 1.5 MB. We gave Claude Code five small tasks in a project with that client ("write a component that lists a repository's open issues", and the like), ten runs per model and setup, and counted what it took.
| Model | Setup | Passed | Tokens sent to the model | Turns |
|---|---|---|---|---|
| Sonnet 5.5 | nothing added | 10 of 10 | 234,109 | 8.5 |
| Sonnet 5.5 | --agentsMd | 10 of 10 | 174,879 | 6 |
| Haiku 5.5 | nothing added | 10 of 10 | 379,285 | 10 |
| Haiku 5.5 | --agentsMd | 10 of 10 | 247,778 | 8.5 |
A run passes when the component exists, uses the right hook and the project type-checks. The numbers are medians.
- An agent does not read the files whole. It searches them, so every run passed, with or without help.
--agentsMdsaves the searching around. With the lookup instructions in the project'sAGENTS.md, the agent goes straight to the operation it needs.- Where the instructions are matters more than what they offer. The same guide inside the output directory changed nothing, because an agent that searches with
grepnever loads it. A lookup command, an index file and an MCP server did no better than thegrepinstructions, so the generator ships none of them.
The setups that were tried and every run are in benchmarks/agent.
Reading the numbers
Section titled “Reading the numbers”- The tools do not generate the same thing. This library and Kubb generate hooks,
@hey-api/openapi-tsgenerates options factories, andopenapi-typescriptgenerates types. - Times change from run to run by a few percent, and by more on a busy machine. Compare tools within one run.
- Ten agent runs per setup show a direction, not a precise saving.
Running them yourself
Section titled “Running them yourself”node benchmarks/run.mjs \ --work /tmp/orqc-bench \ --spec petstore=./examples/petstore.yaml \ --spec github=/path/to/github.jsonbenchmarks/README.md describes the options.