Skip to content
These docs describe v4, which is in beta: install it with @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.

  • 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.

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.

GitHub REST API (1,272 operations)
openapi-react-query-codegen0.46 s
openapi-typescript2.10 s
Kubb2.98 s
@hey-api/openapi-ts2.98 s
Orval4.31 s
Stripe API (612 operations)
openapi-react-query-codegen0.31 s
openapi-typescript1.37 s
Kubb2.11 s
@hey-api/openapi-ts6.60 s
Orval2.47 s
Petstore (19 operations)
openapi-react-query-codegen0.07 s
openapi-typescript0.27 s
Kubb0.99 s
@hey-api/openapi-ts0.37 s
Orval0.24 s

What installing the generator adds to a project that already has React, TanStack Query and TypeScript.

Packages added
openapi-react-query-codegen9 packages
openapi-typescript35 packages
Kubb91 packages
@hey-api/openapi-ts51 packages
Orval89 packages

tsc --noEmit over the generated directory with strict on, TypeScript 7.

ToolPetstoreStripeGitHub
openapi-react-query-codegen000
openapi-typescript000
Kubb000
@hey-api/openapi-ts02740
Orval02191

@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.

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.

ModelSetupPassedTokens sent to the modelTurns
Sonnet 5.5nothing added10 of 10234,1098.5
Sonnet 5.5--agentsMd10 of 10174,8796
Haiku 5.5nothing added10 of 10379,28510
Haiku 5.5--agentsMd10 of 10247,7788.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.
  • --agentsMd saves the searching around. With the lookup instructions in the project's AGENTS.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 grep never loads it. A lookup command, an index file and an MCP server did no better than the grep instructions, so the generator ships none of them.

The setups that were tried and every run are in benchmarks/agent.

  • The tools do not generate the same thing. This library and Kubb generate hooks, @hey-api/openapi-ts generates options factories, and openapi-typescript generates 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.
Terminal window
node benchmarks/run.mjs \
--work /tmp/orqc-bench \
--spec petstore=./examples/petstore.yaml \
--spec github=/path/to/github.json

benchmarks/README.md describes the options.