api-debug

A troubleshooting guide for REST, GraphQL, webhook and OAuth or API-key integrations. It checks the connection, authentication, request format, response parsing and behaviours such as retries, timeouts and rate limits in separate stages.

In plain words
What is it for?
Use it when requests return unexpected results, authentication fails, webhooks do not arrive, GraphQL reports errors, pagination looks wrong or an integration behaves differently between clients.
Why use it?
It helps isolate the layer causing an API problem before code changes make the diagnosis harder to follow.

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

Made for: Claude Code, Codex.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 651 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.00028 $0.00651
Opus 5 $0.00014 $0.00326
Sonnet 5 $0.00006 $0.00130
Haiku 4.5 $0.00003 $0.00065

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

Security

Grade A, and why

api-debug 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.

metadata: {"cybara":{"requires":{"anyBins":["curl","python3"]}}}
skills/api-debug/SKILL.md · 88 lines

How it starts

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

API Debug

Use this when an API returns the wrong status/body, auth fails, a webhook does not arrive, pagination is suspicious, GraphQL returns errors, or code works in one client but not another.

Principle

Isolate the failing layer before changing code:

  1. Connectivity
  2. TLS and proxy behavior
  3. Authentication
  4. Request shape
  5. Response parsing
  6. Semantic correctness
  7. Retry, timeout, and rate-limit behavior

REST Checks

Use curl for the smallest repro. Keep tokens in environment variables and never paste full secrets into chat or logs.

curl -v --connect-timeout 5 https://api.example.com/health
curl -sS -D /tmp/headers.txt -o /tmp/body.json https://api.example.com/resource
python3 -m json.tool /tmp/body.json

For JSON POSTs:

curl -sS -v -X POST "$URL" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  --data '{"key":"value"}'

GraphQL Checks

GraphQL failures often return HTTP 200. Always inspect errors.

curl -sS -X POST "$GRAPHQL_URL" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  --data '{"query":"{ viewer { id } }"}' | python3 -m json.tool

If errors exists, debug query shape and permissions even when the HTTP status is 200.

Auth Checks

  • Confirm scheme: Bearer, Basic, Token, X-Api-Key, signed request, OAuth cookie.
  • Confirm environment: staging token against staging host.
  • Confirm expiry for JWTs without printing the full token:
python3 - <<'PY'
import base64, json, os, time
tok = os.environ["TOKEN"]
payload = tok.split(".")[1]
payload += "=" * (-len(payload) % 4)
data = json.loads(base64.urlsafe_b64decode(payload))
print({k: data.get(k) for k in ("iss", "aud", "sub", "exp")})
print("expired:", data.get("exp", 0) < time.time())
PY

Webhooks

  • Capture raw request body and headers before parsing.
  • Verify signature over the exact raw bytes, not a reserialized JSON object.
  • Check timestamp skew and replay windows.
  • Store a failing fixture and make a regression test for signature parsing.

Read the full file on GitHub · 88 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 · 88 lines · 28 tokens per session scan A 9303ace45320

Subscribe to this mod's changes

api-debug is a skill published in the GitHub repository metaspartan/cybara (23 stars, last pushed 3d ago), licensed MIT. It adds 28 tokens to every session and 651 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-30.