Api-Typing (v1.19.1) is a TypeScript-first HTTP client built on top of Axios that generates fully typed API interfaces from OpenAPI specifications. It automatically syncs endpoint URLs, request parameters, and response types directly from your backend's OpenAPI document, eliminating manual type maintenance. Unlike generic Axios wrappers, it provides a CLI tool to pull live OpenAPI JSON and produce .d.ts files with field-level JSDoc comments. The package offers automatic URL hints, parameter type checking, and response typing. Supports custom Axios interceptors. Ideal for teams wanting type-safe HTTP calls without writing manual type definitions.
npm install api-typingNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup: add CLI script to package.json, run it, include generated types in tsconfig, then use createHTTPClient with type-safe requests.
Convert your Swagger 2.0 spec to OpenAPI 3.0 using a tool like swagger2openapi.
Add 'api-typing-meta.d.ts' to the 'include' field in tsconfig.json.
Use 'npx get-types ...' or add it as a npm script. Do not install globally.
Update your tsconfig include path to 'api-typing-meta.d.ts'.
Use the returned object as an Axios instance (e.g., for interceptors).
Add 'api-typing-meta.d.ts' to the 'include' array in tsconfig.json.
Run 'npx get-types ...' instead of just 'get-types'.
Ensure axios >= 1.0.0 is installed and use createHTTPClient from api-typing, which carries the correct response types.
Add 'type': 'module' to package.json or use dynamic import().