api-test

An HTTP API tester for sending requests to web services and examining their replies. An API is an interface that lets software exchange data or trigger actions.

In plain words
What is it for?
Use it to send GET, POST, PUT, or DELETE requests, add headers and request bodies, inspect response details, and verify expected status codes.
Why use it?
It helps check whether an endpoint responds correctly without needing to build a separate test program.

Command for Claude Code

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 commands/fatihkan/badi/api-test
Clone the repo
git clone --depth 1 https://github.com/fatihkan/badi

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.00527
Opus 5 $0.00000 $0.00264
Sonnet 5 $0.00000 $0.00105
Haiku 4.5 $0.00000 $0.00053

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

Security

Grade A, and why

api-test scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/api-test.md · 85 lines

What it actually says

HTTP API endpoint testing. Send GET/POST/PUT/DELETE requests, analyze status + response, assertions.

Required Tools

  • Bash (badi dev api-test)

Procedure

Step 1: Simple GET

badi dev api-test https://api.example.com/users

Step 2: Advanced Usage

# POST with a body
badi dev api-test https://api.example.com/users \
  --method POST \
  --body '{"name":"Ali","email":"[email protected]"}'

# Auth header
badi dev api-test https://api.example.com/me \
  --header "Authorization: Bearer $TOKEN"

# Status assertion
badi dev api-test https://api.example.com/health \
  --expect 200

# Multiple headers
badi dev api-test https://api.example.com/data \
  --header "Authorization: Bearer X" \
  --header "X-Custom: Y"

Step 3: Output

  • Status + Duration (ms)
  • Size (KB)
  • Content-Type
  • All response headers
  • Body (JSON pretty print or text)
  • Assertion result (if --expect was used)

Step 4: Usage Scenarios

Health check:

badi dev api-test https://app.com/health --expect 200

New endpoint test:

badi dev api-test http://localhost:3000/api/users/1

Production smoke test:

for endpoint in /health /api/v1/status /api/v1/metrics; do
  badi dev api-test https://app.com$endpoint --expect 200 || exit 1
done

Auth flow test:

# Login
badi dev api-test https://api.com/login --method POST --body '{"u":"x","p":"y"}'
# Take the token, use it
badi dev api-test https://api.com/me --header "Authorization: Bearer $TOKEN"

Step 5: CI Integration

- name: API Smoke Test
  run: |
    badi dev api-test ${{ env.API_URL }}/health --expect 200
    badi dev api-test ${{ env.API_URL }}/api/v1/version --expect 200

Example

/api-test https://api.github.com/users/octocat --expect 200
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 · 85 lines · 0 tokens per session scan A 596380492fb1

Subscribe to this mod's changes

api-test is a command published in the GitHub repository fatihkan/badi (7 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 527 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.