OpenAPI to Type-Safe React Query Hooks
Transform your Swagger and OpenAPI contracts into production-grade TanStack React Query v5 hooks, type definitions, and API clients in seconds — with zero runtime dependencies and zero schema drift.
Full OpenAPI 3.x Parsing
Import OpenAPI 3.0 and 3.1 JSON or YAML specs via URL or file upload. Reex resolves circular references, nested schemas, and path parameters seamlessly.
TanStack React Query v5
Generates idiomatic useQuery and useMutation hooks complete with hierarchical query key factories and automated cache invalidation.
AST-Powered Generation
Code is synthesized using ts-morph and written directly to your disk under src/api-services/. No opaque wrapper libraries or runtime performance hit.
Live In-Browser Testing
Test OpenAPI endpoints directly in Reex Studio before generating code. Connect to your local development server with Chrome Private Network Access.
Smart Schema Diffing
When backend schemas update, Reex detects added, modified, or removed endpoints so you can review and accept changes selectively without breaking your frontend.
Zero-Config CLI Bridge
Run npx reex-cli start in your repository root to sync generated types and hooks straight into your Next.js or React codebase in real time.
From OpenAPI Schema to Typed React Query Hook
No handwritten fetch calls. No outdated types. Reex parses your specification and writes clean, maintainable TypeScript files to your repository.
// 1. Your OpenAPI Specification (YAML / JSON)
paths:
/api/v1/users/{userId}:
get:
summary: Retrieve a user profile
parameters:
- name: userId
in: path
required: true
schema: { type: string }
responses:
'200':
content:
application/json:
schema: { $ref: '#/components/schemas/UserProfile' }
// 2. Output Generated by Reex (written to src/api-services/)
export interface UserProfile {
id: string;
name: string;
email: string;
role: "admin" | "member";
}
export const useGetUserProfileQuery = (userId: string) => {
return useQuery({
queryKey: usersQueryKeys.detail(userId),
queryFn: () => usersApi.getUserProfile(userId),
enabled: Boolean(userId),
});
};How It Works in 3 Simple Steps
Import Your OpenAPI or Swagger Spec
Drag and drop your OpenAPI JSON/YAML file into Reex API Studio or paste a live schema URL. Reex parses every path, method, and schema definition instantly.
Test & Inspect Endpoints
Verify request payloads, test localhost or staging responses, and customize auth strategies (Bearer JWT or HTTP-only cookies) directly in the interactive UI.
Generate Production Code
Run reex start in your project directory to sync type definitions, query key factories, and React Query hooks directly into src/api-services/.