api-testing

api-testing is a skill for Claude Code from sawrus/agent-guides. It costs 20 tokens per session (1,209 once invoked), scanned A, original, MIT.

A guide to testing web APIs and the boundaries between services. It covers integration tests, which exercise real application dependencies, and contract tests, which check that services agree on request and response formats.

In plain words
What is it for?
Use it to test authenticated endpoints, database-backed API flows, error responses, and consumer-driven contracts with Pact.
Why use it?
API tests can miss authentication failures, error cases, or changes that break another service. These patterns help verify both an API's behavior and its agreements with consumers.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to test authenticated endpoints, database-backed API flows, error responses, and consumer-driven contracts with Pact.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sawrus/agent-guides/api-testing
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.

Any agent
npx skills add sawrus/agent-guides --skill api-testing
Clone the repo
git clone --depth 1 https://github.com/sawrus/agent-guides

Made for: Claude Code.

Wrote 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.

agentmods badge for api-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/sawrus/agent-guides/api-testing.svg)](https://agentmods.dev/skills/sawrus/agent-guides/api-testing)
Your own site
<a href="https://agentmods.dev/skills/sawrus/agent-guides/api-testing"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/api-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,209 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00020 $0.01209
Opus 5 $0.00010 $0.00605
Sonnet 5 $0.00004 $0.00242
Haiku 4.5 $0.00002 $0.00121

Measured 4d ago against content hash c7b1ce2c31ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

api-testing 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 4d 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.

areas/software/qa/skills/api-testing/SKILL.md · 141 lines

How it starts

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

API Testing Patterns Skill

Expertise: API integration tests (supertest/httpx), contract testing (Pact), auth flows, error path coverage.

Integration Test Structure (FastAPI/httpx)

import pytest
import pytest_asyncio
from httpx import AsyncClient

# conftest.py — reusable fixtures
@pytest_asyncio.fixture
async def client(app, db_session) -> AsyncClient:
    async with AsyncClient(app=app, base_url="http://test") as c:
        yield c

@pytest_asyncio.fixture
async def auth_client(client, create_user) -> AsyncClient:
    user = await create_user(role="viewer")
    response = await client.post("/auth/token",
        data={"username": user.email, "password": "test_password"})
    token = response.json()["access_token"]
    client.headers["Authorization"] = f"Bearer {token}"
    return client

# Test — covers happy path + all error cases
class TestCreateOrder:
    async def test_creates_order_for_authenticated_user(self, auth_client, product_factory):
        product = await product_factory(price="29.99", stock=10)

        response = await auth_client.post("/api/v1/orders", json={
            "items": [{"product_id": product.id, "quantity": 2}]
        })

        assert response.status_code == 201
        body = response.json()
        assert body["status"] == "pending"
        assert body["total_amount"] == "59.98"
        assert body["id"].startswith("ord_")

    async def test_returns_401_without_auth(self, client):
        response = await client.post("/api/v1/orders", json={"items": []})
        assert response.status_code == 401

    async def test_returns_400_when_product_out_of_stock(self, auth_client, product_factory):
        product = await product_factory(stock=0)
        response = await auth_client.post("/api/v1/orders", json={
            "items": [{"product_id": product.id, "quantity": 1}]
        })
        assert response.status_code == 400
        assert response.json()["error"]["code"] == "PRODUCT_OUT_OF_STOCK"

    async def test_returns_404_for_nonexistent_product(self, auth_client):
        response = await auth_client.post("/api/v1/orders", json={
            "items": [{"product_id": "prod_nonexistent", "quantity": 1}]
        })
        assert response.status_code == 404

Read the full file on GitHub · 141 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. 4d ago First seen · 141 lines · 20 tokens per session scan A c7b1ce2c31ec

Subscribe to this mod's changes

api-testing is a skill published in the GitHub repository sawrus/agent-guides (17 stars, last pushed 7d ago), licensed MIT. It adds 20 tokens to every session and 1,209 once invoked, about $0.0001 per session on Opus 5. 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-09-03.

Related

Other skills, from other repositories