Hey API Codegen

Generate TypeScript clients from OpenAPI 3.0 specs with Zod validation.

88|11|Updated Apr 28, 2020
One-click install
npx skills add https://github.com/blockmatic/basilic --skill hey-api-codegen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Hey API Codegen
Source: https://github.com/blockmatic/basilic/tree/main/.cursor/skills/openapi-ts-v0
Command: npx skills add https://github.com/blockmatic/basilic --skill hey-api-codegen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Generating TypeScript API clients from OpenAPI specs can be error-prone and time-consuming; this skill automates the creation of type-safe clients using @hey-api/openapi-ts with Zod-based validation.

Core Features & Use Cases

  • Generates TypeScript clients from OpenAPI 3.0 specs with strong type safety
  • Uses Zod schemas for runtime validation
  • Configurable via openapi-ts.config.ts for input, output, and schema options
  • Useful for frontend apps and API consumers needing deterministic client code

Quick Start

Create an openapi-ts.config.ts that points to your OpenAPI spec and run the codegen to generate the client.

Frequently Asked Questions about Hey API Codegen

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

FAQPage Schema
How do I generate TypeScript API clients from OpenAPI specs?

You can generate TypeScript API clients from OpenAPI specs by configuring an openapi-ts.config.ts file to declare input, output, and schema settings, then running the @hey-api/openapi-ts codegen tool.

Does the generated TypeScript client support runtime validation?

Yes, the generated TypeScript client supports runtime validation by integrating Zod schemas, ensuring strong type safety alongside deterministic API consumer code.

Can I use this codegen approach for frontend applications?

Yes, this codegen approach is specifically useful for frontend applications and API consumers needing strongly typed, deterministic clients generated from OpenAPI 3.0 specs.

What is the best way to configure input and output for TypeScript client generation?

The best way to configure TypeScript client generation is by creating an openapi-ts.config.ts file that explicitly declares your OpenAPI spec input, output directory, and schema settings.