openapi-fetch

Generate strongly-typed API clients from OpenAPI schemas for TypeScript.

1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/prescottprue/agent-skills --skill openapi-fetch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi-fetch
Source: https://github.com/prescottprue/agent-skills/tree/main/skills/openapi-fetch
Command: npx skills add https://github.com/prescottprue/agent-skills --skill openapi-fetch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates strongly-typed API clients from OpenAPI schemas for reliable, type-safe HTTP requests.

Core Features & Use Cases

  • Generate strongly-typed API clients from OpenAPI schemas using a single generic client.
  • Perform type-safe HTTP requests (GET, POST, PUT, DELETE, PATCH, etc.) with predictable typings.
  • Supports middleware for auth, logging, caching, error handling, and per-request overrides.

Quick Start

Install the library and instantiate a typed client with createClient<paths> to auto-generate types from your OpenAPI schema.

Frequently Asked Questions about openapi-fetch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a type-safe API client from an OpenAPI schema?

To generate a type-safe API client from an OpenAPI schema, instantiate a typed client using createClient<paths> to auto-generate types directly from your schema definitions. This enables strongly-typed HTTP requests across your TypeScript or JavaScript projects.

What are type-safe HTTP requests and when do I need them?

Type-safe HTTP requests ensure that your GET, POST, PUT, DELETE, and PATCH calls have predictable typings for paths, queries, and headers. You need them in TypeScript projects to prevent runtime errors by validating API request and response structures at compile time.

Can I add middleware for auth and logging to a generated API client?

Yes, the generated API client supports middleware for authentication, logging, caching, and error handling. You can also apply per-request overrides and customizations via its flexible client API to handle specific HTTP request scenarios.

Does this approach work for both frontend and backend TypeScript projects?

Yes, generating strongly-typed API clients from OpenAPI schemas works across both frontend and backend TypeScript and JavaScript projects. It provides reliable, type-safe HTTP requests wherever you need to communicate with APIs using a schema-driven client.

What is the best way to handle typed path and query serialization in TypeScript?

The best way to handle typed path and query serialization is by using a single generic API client generated from your OpenAPI schema. This approach automatically applies predictable typings to URL paths, query parameters, and headers during HTTP requests.

Do I need a specific framework to use schema-driven API clients?

No specific framework is required to use schema-driven API clients. You only need an OpenAPI schema and a TypeScript or JavaScript environment to instantiate the generic client and start making type-safe HTTP requests with path and query typings.