API Tester
Agents write API calls; this proves the server answers what you expect.
Commands
python3 scripts/api_tester.py https://api.example.com/health
python3 scripts/api_tester.py URL --expect-status 200 --expect-json ok=true
python3 scripts/api_tester.py URL --expect-json data.user.id=42
python3 scripts/api_tester.py URL --method POST --body '{"x":1}' \
--header "Authorization: Bearer $TOKEN"
python3 scripts/api_tester.py URL --max-latency-ms 500 --json
Checks
| Check | Flag | Gate |
|---|---|---|
| Status code | --expect-status (default 200) |
exit 1 on mismatch |
| JSON fields | --expect-json key=value (repeatable, dot paths) |
exit 1 on mismatch or missing |
| Latency | --max-latency-ms |
exit 1 over budget |
| Reachability | — | exit 2 when the host is down |
Pairs with
env-gate (is the environment configured), verification-before-completion
(the discipline that makes you run this before claiming the endpoint works),
webapp-testing (when the surface is a page, not JSON).