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.
npx skills add saajunaid/caddis-plugin --skill api-client-patternsgit clone --depth 1 https://github.com/saajunaid/caddis-pluginWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/saajunaid/caddis-plugin/api-client-patterns)<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/api-client-patterns"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/api-client-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/api-client-patterns"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/api-client-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00053 | $0.02835 |
| Opus 5.5 | $0.00021 | $0.01134 |
| Sonnet 5.5 | $0.00011 | $0.00567 |
| Haiku 4.5 | $0.00005 | $0.00283 |
Grade A, and why
api-client-patterns 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 2mo 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.
response = await fetch(url, { ...init, headers: { 'Content-Type': 'application/json', ...init?.headers } }) How it starts
The opening of the file, as written. The whole thing — 368 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Client Patterns Skill
Typed, maintainable API clients — from simple fetch wrappers to full TanStack Query integration and tRPC.
1. Typed Fetch Wrapper with Zod Validation
// lib/api/fetcher.ts
import { z } from 'zod'
export type ApiError = { type: 'network'; message: string }
| { type: 'validation'; issues: z.ZodIssue[] }
| { type: 'http'; status: number; body: unknown }
export type ApiResult<T> = { ok: true; data: T } | { ok: false; error: ApiError }
async function fetchJson<T>(
url: string,
schema: z.ZodSchema<T>,
init?: RequestInit,
): Promise<ApiResult<T>> {
let response: Response
try {
response = await fetch(url, { ...init, headers: { 'Content-Type': 'application/json', ...init?.headers } })
} catch (e) {
return { ok: false, error: { type: 'network', message: String(e) } }
}
if (!response.ok) {
return { ok: false, error: { type: 'http', status: response.status, body: await response.json().catch(() => null) } }
}
const raw = await response.json()
const parsed = schema.safeParse(raw)
if (!parsed.success) {
return { ok: false, error: { type: 'validation', issues: parsed.error.issues } }
}
return { ok: true, data: parsed.data }
}
2. API Client Factory Pattern
// lib/api/client.ts
import { z } from 'zod'
function createApiClient(baseUrl: string, getAuth: () => string | null) {
async function request<T>(
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
path: string,
schema: z.ZodSchema<T>,
body?: unknown,
) {
const token = getAuth()
return fetchJson(`${baseUrl}${path}`, schema, {
method,
headers: { ...(token ? { Authorization: `Bearer ${token}` } : {}) },
...(body !== undefined ? { body: JSON.stringify(body) } : {}),
})
}
return {
get: <T>(path: string, schema: z.ZodSchema<T>) => request('GET', path, schema),
post: <T>(path: string, schema: z.ZodSchema<T>, body: unknown) => request('POST', path, schema, body),
put: <T>(path: string, schema: z.ZodSchema<T>, body: unknown) => request('PUT', path, schema, body),
patch: <T>(path: string, schema: z.ZodSchema<T>, body: unknown) => request('PATCH', path, schema, body),
delete: <T>(path: string, schema: z.ZodSchema<T>) => request('DELETE', path, schema),
}
}
// Usage
import { getAccessToken } from '@/lib/auth'
export const api = createApiClient(process.env.NEXT_PUBLIC_API_URL!, getAccessToken)
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.
- 2mo ago Changed · -36 tokens per session dead98f9379e
- 2mo ago First seen · 368 lines · 89 tokens per session scan A 971aa818c1b0
api-client-patterns is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 3d ago), licensed MIT. It adds 53 tokens to every session and 2,835 once invoked, about $0.0002 per session on Opus 5.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-09-03.
api-client-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| api-client-patternssaajunaid/caddis-plugin | Skill | 0 | 3d ago | MIT | A | 53 | Claude Code, Codex |
| agent-raft-managerruvnet/ruflo | Skill | 83k | today | MIT | A | 18 | Claude Code |
| moai-ref-api-patternsmodu-ai/moai-adk | Skill | 1.3k | today | Apache-2.0 | A | 85 | Claude Code |
| continuum-tools-mcpshyftlabs/continuum | Skill | 86 | 3d ago | Apache-2.0 | A | 94 | Claude Code |
| goga-define-challengeqarium/goga | Skill | 46 | 8d ago | BSD-3-Clause | A | 6 | Claude Code, Codex |
| goga-define-goalsqarium/goga | Skill | 46 | 8d ago | BSD-3-Clause | A | 6 | Claude Code, Codex |
| skill-creatoreigent-ai/eigent | Skill | 16k | yesterday | Apache-2.0 | A | 35 | Claude Code, Codex |