API Client Generator

A tool-assisted method for creating a typed software client from an OpenAPI or Swagger document, which describes how a web API works. Generated request methods and data types are kept separate from a custom network layer for timeouts, authentication, headers, and errors.

In plain words
What is it for?
Use it to generate or regenerate a typed client from a versioned API specification, configure shared request handling, or hand-write a small typed wrapper when no suitable specification exists.
Why use it?
It reduces drift between an API and the code that calls it, while keeping generated files safe to recreate when the specification changes. The custom wrapper lets shared request behavior be controlled in one place.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/skillmedev/skills/api-client-generator
Any agent
npx skills add SkillMedev/skills --skill api-client-generator
Clone the repo
git clone --depth 1 https://github.com/SkillMedev/skills

Made for: Claude Code, Codex.

Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,259 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00116 $0.01259
Opus 5 $0.00058 $0.00629
Sonnet 5 $0.00023 $0.00252
Haiku 4.5 $0.00012 $0.00126

Measured 2d ago against content hash 4263c65a5f80, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

API Client Generator scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const res = await fetch(url, {
skills/api-client-generator/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Client Generator

Generate the API surface from the spec so types stay honest, then wrap the generated code in a transport layer you own for resilience.

Workflow

  1. Confirm a spec exists. If the API ships an OpenAPI/Swagger document, generate from it. If there is no spec, or the integration is a single endpoint, hand-write a small typed wrapper with the same transport in step 4 - skip codegen.
  2. Generate the client. Run a codegen tool (openapi-typescript-codegen, openapi-generator, oapi-codegen, or equivalent) to produce request methods plus request/response types. Pin the spec by version or hash so an upstream change surfaces as a reviewable diff, not a silent runtime surprise.
  3. Treat generated code as a build artifact. Commit it, regenerate it from the pinned spec, and never hand-edit it - edits get clobbered on the next regen.
  4. Wrap, don't modify. Inject a custom HTTP transport (the client's configurable fetch/http layer) instead of editing generated files. Put timeouts, auth, default headers, and logging in that one wrapper so every generated call inherits them and the generated layer stays regenerable.
  5. Set an explicit per-request timeout in the transport - generated clients usually default to none.
  6. Make errors typed. Map non-2xx responses to a discriminated error type - auth (401/403), not-found (404), validation (422), rate-limit (429), server (5xx) - and parse the API's structured error body into a typed shape so callers branch on a tag, not on parsed strings. Never let a non-2xx return a half-empty success object.
  7. Centralize config. Hold base URL, auth token refresh, and default headers in one configured instance; don't scatter raw fetch calls across the codebase.
  8. Optionally validate critical responses against the schema at runtime so spec drift fails loudly. Generated types describe the contract, not reality.
  9. Defer cross-cutting policy. Add the retry/backoff hook point in the transport, but get the backoff policy (exponential backoff, full jitter, Retry-After, retriable status codes, idempotency) from rate-limit-handler. Get cursor pagination and incremental sync from pagination-and-sync-engineer. This skill owns the generated surface and the transport seam, not those policies.

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 116 tokens per session scan A 4263c65a5f80

Subscribe to this mod's changes

API Client Generator is a skill published in the GitHub repository SkillMedev/skills (11 stars, last pushed 1mo ago), licensed MIT. It adds 116 tokens to every session and 1,259 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

webinar-funnel-builder

Designs a complete webinar funnel - registration page promise, reminder email sequence timed against typical 35-45 percent show-up rates, webinar structure with a 70 percent teach / 30 percent offer split and the pivot script, replay window and urgency rules, and the post-webinar email sequence - with a funnel-metrics…

SkillMedev/creator-studio · 180 tokens

Creator Content Calendar

Designs a sustainable publishing system for a solo creator - 3-4 content pillars, a cadence set at the creator's consistent floor, a fixed pillar rotation, a 30-day idea bank, and a monthly audit loop - delivered as a weekly calendar skeleton. Use when someone says "help me plan my content", "I keep falling off my…

SkillMedev/creator-studio · 167 tokens

Show Notes Writer

Produces complete podcast show notes from a transcript or episode outline - a standalone summary block, timestamped chapters that name what happens, screenshot-worthy key takeaways, guest bio, curated links, and keyword placement for search. Use when someone says "write show notes for this episode", "turn this…

SkillMedev/creator-studio · 146 tokens

YouTube Script Writer

Writes retention-engineered long-form YouTube scripts on a hook/body/payoff architecture - a first-30-seconds hook that survives the retention cliff, a beat-sheet body with mini-hooks and bridges, timed pattern interrupts, and a payoff that over-delivers - with B-roll and editing cues marked inline. Use when someone…

SkillMedev/creator-studio · 180 tokens

Systematic Review

Runs a PRISMA-compliant systematic review from PICO question and pre-registered protocol through search strings, two-stage screening, risk-of-bias appraisal, and GRADE-rated synthesis. Use when someone asks "run a systematic review", "build my search strategy and inclusion criteria", "screen these studies against a…

SkillMedev/academic-researcher · 123 tokens

Policy Brief

Writes a concise, evidence-based policy brief - problem, options compared on consistent criteria, and a recommendation - that a decision-maker can act on in minutes. Use when someone asks "write a policy brief", "summarize the evidence and options for this decision", "brief the minister/board/council on X", or needs a…

SkillMedev/academic-researcher · 121 tokens