api-client

A guide for making authenticated requests to a third-party REST API, which is a web service that programs can call.

In plain words
What is it for?
It covers setting API secrets in environment variables or a gitignored .env file, then using them in requests.
Why use it?
It helps keep access tokens out of source code and directs them only to your configured service address.

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/rtwsvj/skill-switch/api-client
Any agent
npx skills add rtwsvj/skill-switch --skill api-client
Clone the repo
git clone --depth 1 https://github.com/rtwsvj/skill-switch

Made for: Claude Code, Codex.

Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 118 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.00023 $0.00118
Opus 5 $0.00012 $0.00059
Sonnet 5 $0.00005 $0.00024
Haiku 4.5 $0.00002 $0.00012

Measured 2d ago against content hash 2c072ac0a146, 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 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.

curl -sS -H "Authorization: Bearer $API_TOKEN" "$API_BASE_URL/v1/users"
tests/fixtures/skills-benign/api-client/SKILL.md · 17 lines

What it actually says

API Client

Keep secrets in the environment, never hardcode them. Send requests to your own configured base URL:

curl -sS -H "Authorization: Bearer $API_TOKEN" "$API_BASE_URL/v1/users"

Store API_TOKEN and API_BASE_URL in your shell profile or a local .env that is gitignored. The token only goes to your own configured host.

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 · 17 lines · 23 tokens per session scan A 2c072ac0a146

Subscribe to this mod's changes

api-client is a skill published in the GitHub repository rtwsvj/skill-switch (1 stars, last pushed 9d ago), licensed MIT. It adds 23 tokens to every session and 118 once invoked, about $0.0001 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-31.