Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    api-client generator

    1

    Generates typed TypeScript API clients, React Query hooks, and MSW mocks from OpenAPI specs or route definitions.

    $6

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    api-client generator

    api-client generator

    Example session with this skill installed

    Generate a TypeScript API client from ./docs/openapi.yaml for the 'Teams' resource. Include TanStack Query v5 hooks and MSW mocks. Use src/api/teams for output.

    • Read your context and instructions
    • Compiled the api-client generator

    The API client for the Teams resource has been generated. This includes TypeScript interfaces, fetch wrappers with 401 refresh logic, TanStack Query hooks, and MSW handlers.

    API Client: Teams Resource

    // src/api/teams/types.ts
    export interface Team {
      id: string;
      name: string;
      memberCount: number;
    }
    
    export interface TeamPage {
      items: Team[];
      total: number;
    }
    
    // src/api/teams/client.ts
    import { fetcher } from '../base';
    import { Team, TeamPage } from './types';
    
    export const teamsApi = {
      listTeams: (page: number) => 
        fetcher<TeamPage>(`/teams?page=${page}`, { method: 'GET' }),
      getTeam: (id: string) => 
        fetcher<Team>(`/teams/${id}`, { method: 'GET' }),
    };
    
    // src/api/teams/hooks.ts
    import { useQuery } from '@tanstack/react-query';
    import { teamsApi } from './client';
    
    export const useTeams = (page: number) => {
      return useQuery({
        queryKey: ['teams', page],
        queryFn: () => teamsApi.listTeams(page),
      });
    };
    
    // src/api/teams/mocks.ts
    import { http, HttpResponse } from 'msw';
    
    export const teamHandlers = [
      http.get('/teams', () => {
        return HttpResponse.json({
          items: [{ id: '1', name: 'Engineering', memberCount: 12 }],
          total: 1
        });
      }),
    ];
    

    Operation Map

    OperationMethodPathInputResultAuth
    listTeamsGET/teamspage: numberTeamPageBearer
    getTeamGET/teams/:idid: stringTeamBearer

    Next steps

    1. Add teamHandlers to your global MSW worker setup.
    2. Export the new hooks from src/api/teams/index.ts.
    3. Run tsc --noEmit to verify type alignment with the base fetcher.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Manually writing API clients is a repetitive task prone to type mismatches and stale contracts. This skill automates the generation of fully typed TypeScript API clients directly from OpenAPI specs or backend route definitions.

    What it does

    • Type Generation creates TypeScript interfaces for request bodies, query parameters, and response schemas.
    • Transport Layer builds typed fetch wrappers with consistent error handling and serialization logic.
    • Hook Integration generates TanStack/React Query hooks for server state management.
    • Test Mocking produces MSW (Mock Service Worker) handlers for unit and integration testing.
    • Auth Handling implements interceptors for Bearer tokens, auto-refresh on 401s, and retry logic.

    How it works

    1. Analyze Contract by inspecting OpenAPI documents or repository routes to map methods, status codes, and schemas.
    2. Audit Drift by comparing the current contract against existing client code to identify breaking changes.
    3. Generate Layers including types, transport wrappers, query hooks, and barrel exports.
    4. Verify Implementation by running typechecks and contract tests to ensure alignment with the source of truth.

    Frameworks & tools

    TypeScript, OpenAPI/Swagger, TanStack Query (React Query), MSW (Mock Service Worker), and native Fetch API or Axios.

    Why this beats prompting it yourself

    Generic prompts often ignore project-specific auth flows or pagination patterns. This skill enforces strict adherence to your repository's existing error shapes, retry policies, and nullability constraints without inventing fields.

    Use cases

    • Generating a client from a new OpenAPI/Swagger specification file.
    • Updating an existing API client after backend contract changes.
    • Replacing untyped fetch calls with a structured, hook-based architecture.
    • Scaffolding test mocks that stay in sync with production API types.

    Known limitations

    Does not infer endpoints from UI labels or backend assumptions. Requires an explicit OpenAPI document or accessible route files as a source of truth.

    Requires explicit OpenAPI docs or route files. Will not infer endpoints from UI. Retries are restricted to idempotent requests unless project policy explicitly allows otherwise.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    Permissions

    Read Files
    Write Files
    Listed2 days ago

    What's inside

    Frequently Asked Questions

    This skill is designed for AI agents that have access to your codebase or local file system, such as VS Code Copilots or CLI-based agents, allowing it to read your specifications and write code directly to your project structure.

    No, it requires a formal source of truth such as an OpenAPI/Swagger document or defined backend route files to ensure the generated types are 100% accurate and free of hallucinations.

    Yes, the skill is designed to analyze existing code for 'contract drift,' allowing it to update specific endpoints, types, and hooks without overwriting your custom authentication logic or manual configurations.

    While it defaults to the native Fetch API for zero-dependency projects, it can be configured to generate Axios-based clients if your project requires advanced features like progress tracking or custom interceptors.

    The skill automatically generates MSW (Mock Service Worker) handlers based on your API schemas, providing you with a production-ready mock layer for unit testing and local development.

    New in APIs & Backend