generate-api-ref

A command that creates API reference documentation from application source code and route definitions. An API is a defined way for software systems to communicate.

In plain words
What is it for?
Use it to document HTTP routes, parameters, request and response formats, authentication, errors, pagination, rate limits, and caching in Markdown.
Why use it?
It avoids manually tracking endpoints, inputs, outputs, authentication, errors, and examples as the code changes.

Command

Part of the api-reference plugin — 1 command shipped together

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/rohitg00/awesome-claude-code-toolkit/generate-api-ref
Clone the repo
git clone --depth 1 https://github.com/rohitg00/awesome-claude-code-toolkit

Or install api-reference, the plugin that ships this one along with the rest of its 1 command.

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 316 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.00000 $0.00316
Opus 5 $0.00000 $0.00158
Sonnet 5 $0.00000 $0.00063
Haiku 4.5 $0.00000 $0.00032

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

Security

Grade A, and why

generate-api-ref 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 3d 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.

- Show curl examples for at least the primary endpoints
plugins/api-reference/commands/generate-api-ref.md · 29 lines

What it actually says

/generate-api-ref - Generate API Reference

Generate API reference documentation from source code and route definitions.

Steps

  1. Detect the API framework: Express, FastAPI, Django REST, Spring Boot, Gin, etc.
  2. Scan route definitions to find all API endpoints
  3. For each endpoint, extract: HTTP method, path, middleware, handler function
  4. Parse handler functions to identify request parameters (path, query, body, headers)
  5. Extract request/response schemas from TypeScript types, Pydantic models, or JSDoc
  6. Identify authentication requirements from middleware chains
  7. Find example request/response pairs from test files or inline documentation
  8. Detect rate limiting, pagination, and caching configurations
  9. Generate markdown documentation for each endpoint with: method, path, description, parameters, request body, response, errors
  10. Group endpoints by resource or router module
  11. Add a table of contents and overview section
  12. Save documentation to docs/api-reference.md or the specified output path

Rules

  • Include all HTTP methods (GET, POST, PUT, PATCH, DELETE) for each resource
  • Document error responses (400, 401, 403, 404, 500) with example payloads
  • Use the actual TypeScript/Python types, not simplified versions
  • Include authentication requirements for each endpoint
  • Show curl examples for at least the primary endpoints
  • Do not document internal or health-check endpoints unless requested
  • Keep parameter descriptions concise but include type and required status
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. 3d ago First seen · 29 lines · 0 tokens per session scan A 8f002c4a16f5

Subscribe to this mod's changes

generate-api-ref is a command published in the GitHub repository rohitg00/awesome-claude-code-toolkit (2,578 stars, last pushed 3mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 316 tokens. 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.