api

Guidance for designing REST API contracts: the agreed URLs, request and response fields, status codes, errors, and rules for change. A REST API is an interface that lets software communicate over web requests.

In plain words
What is it for?
Use it when adding or reviewing endpoints, fields, webhooks, authentication, pagination, rate limits, idempotency, OpenAPI, or JSON Schema.
Why use it?
It helps prevent clients from breaking when an API changes. It also makes empty results, errors, pagination, authentication failures, and repeated requests predictable.

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

Made for: Claude Code, Codex.

Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,818 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.00025 $0.01818
Opus 5 $0.00013 $0.00909
Sonnet 5 $0.00005 $0.00364
Haiku 4.5 $0.00003 $0.00182

Measured yesterday against content hash 35cf670c8610, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

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.

agents/.agents/skills/api/SKILL.md · 154 lines

How it starts

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

API

Iron Law

DESIGN THE CONTRACT FIRST. EVOLVE WITHOUT BREAKING. PICK STATUS BY ORIGIN.

When to Use

  • Adding, removing, renaming, or reviewing REST endpoints, fields, status codes, webhooks, auth, pagination, rate limits, or idempotency.
  • Writing or changing OpenAPI, JSON Schema, public SDK boundaries, or integration contracts external callers depend on.

When NOT to Use

  • Internal function signatures with no caller contract; use domain-modeling or refactoring.
  • Auth, secrets, or trust-boundary review beyond API shape; use security.
  • Database schema design; use database.
  • Non-REST API styles (gRPC, GraphQL, message queues): contract, error, and evolution conventions differ; use architecture for style-of-API decisions and the relevant ecosystem's conventions for shape.

Core Ideas

  1. Contract first. Sketch OpenAPI or the repo's API contract source before controller code; implement from the contract, not toward it. Every response shape is explicit, including errors, empty states, pagination, and auth failures. Durable API interfaces route through contract-first; error shape is part of the contract.
  2. Evolution: additive in place; breaking needs a path forward. Optional fields, query params, headers, methods, and endpoints evolve in place. Renames, removals, required additions, status-code changes, and semantic changes need a successor contract or deprecation path. Never break in place. See references/api-evolution.md.
  3. Versioning: one strategy per service. Pick URL path, media type, header, or date and apply it consistently. Major bumps for breaking changes only; compatible additions never re-version. Retire versions with an overlap window; route deprecation primitives through release. See references/api-evolution.md.
  4. Errors: status by origin, shape by contract. 4xx for consumer-request problems, 5xx for upstream or your-service problems; never mix origins in one response. Use the chosen data model's native error shape (JSON:API errors[], FHIR OperationOutcome, or RFC 9457 Problem Details). These are structurally distinct conventions, not interchangeable. Never leak raw upstream or internal errors. See references/rest-error-status-codes.md.
  5. Default to JSON:API; switch only when the domain has its own standard. JSON:API is the default for REST resource APIs (envelope with id/type/attributes/relationships, sparse fieldsets, includes, pagination conventions, error array). Switch to a domain-specific standard when one applies: FHIR for healthcare, HAL for hypermedia-centric APIs, JSON-LD when semantic-web interop matters. Document deviations from the chosen standard explicitly. See references/data-models.md.

Read the full file on GitHub · 154 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 154 lines · 25 tokens per session scan A 35cf670c8610

Subscribe to this mod's changes

api is a skill published in the GitHub repository kreek/consult (1 stars, last pushed 6d ago), licensed MIT. It adds 25 tokens to every session and 1,818 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-08-31.