Generate a Typed API Client from an OpenAPI Spec
Your OpenAPI spec is already the source of truth for your API — so let it generate your client code too. Claude reads the spec, understands the endpoint shapes, and produces a client that fits your existing codebase style.
Read openapi.yaml and generate a fully-typed TypeScript API client using
the native fetch API. Group methods by resource tag, export each group as
a named export, and infer all request/response types from the spec schemas.
Claude handles the parts that make hand-written clients tedious: translating schemas into TypeScript interfaces, building URL params correctly, handling authentication headers, and wiring up error types from the spec's error responses.
# PHP with Guzzle
Generate a PHP API client from openapi.yaml using Guzzle 7.
Create one class per resource tag, add PHPDoc blocks for each method,
and use typed DTOs for request bodies and responses.
# With a specific HTTP library
Read the Stripe OpenAPI spec at stripe-openapi.json and generate a typed
client using axios. Add retry logic on 429 responses and map all error
codes to typed exceptions.
# Minimal approach
From openapi.yaml, generate just the TypeScript types and a simple
fetch wrapper for the /users and /orders endpoints.
Your spec is already written — let Claude turn it into working, typed client code automatically.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.