api

An agent for designing and building web APIs, which are interfaces that let software systems exchange requests and data. It applies shared rules for URLs, input checks, responses, errors, API documentation, and live connections.

In plain words
What is it for?
It is for creating REST endpoints, checking incoming data, formatting success and error responses, documenting APIs with OpenAPI, and handling authentication, logging, rate limits, and WebSocket protocols.
Why use it?
It reduces inconsistency between endpoints, such as different response shapes, validation methods, or status codes, making the API easier to maintain.

Agent

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 agents/nxtg-ai/forge-plugin/api
Clone the repo
git clone --depth 1 https://github.com/nxtg-ai/forge-plugin
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 1,845 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.01845
Opus 5 $0.00000 $0.00923
Sonnet 5 $0.00000 $0.00369
Haiku 4.5 $0.00000 $0.00185

Measured yesterday against content hash 903e271236ea, 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.

docs/agents/api.md · 131 lines

How it starts

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

API

Designs and implements clean REST endpoints with Zod validation, consistent error handling, OpenAPI specs, and WebSocket protocols -- so every endpoint follows the same conventions.

Level L1 Vibe Coder
Category Domain Specialist
Model Sonnet

What It Does

The API agent is a specialist in HTTP endpoint design and implementation. It encodes the conventions that make APIs consistent, predictable, and maintainable: RESTful URL structures, Zod schema validation at every boundary, structured error responses (never stack traces), proper status codes, and middleware patterns for cross-cutting concerns like authentication, logging, and rate limiting.

Without this agent, API endpoints accumulate inconsistencies over time. One endpoint returns { data: user }, another returns the user object directly. One validates with Zod, another uses manual if-checks. One returns 400 for validation errors, another returns 422. The API agent eliminates this drift by applying the same conventions to every endpoint: success responses wrapped in { data: T, meta?: {...} }, errors in { error: { code, message, details? } }, input validated with Zod schemas, and proper HTTP status codes (200 for reads, 201 for creates, 204 for deletes, 400 for validation, 404 for not found, 500 for server errors).

The agent also handles WebSocket protocol design for real-time features. It defines message formats with typed payloads ({ type: string, payload: unknown, timestamp: string }), connection lifecycle management, and reconnection strategies. For external API integrations (GitHub, Sentry, monitoring services), it implements proper HTTP clients with error handling, retry logic, and rate limit awareness.

When to Use It

  • Adding a new endpoint: When you need a new REST endpoint with proper validation, error handling, and response formatting that matches your existing API conventions.
  • Integrating an external API: When you need to connect to GitHub, Sentry, or any third-party service with proper error handling, retries, and rate limit management.
  • Designing a WebSocket protocol: When you need real-time communication with typed message formats, connection lifecycle management, and reconnection logic.
  • Standardizing existing endpoints: When your API has inconsistent response formats, error handling, or validation patterns and needs to be brought into alignment.

Read the full file on GitHub · 131 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. yesterday First seen · 131 lines · 0 tokens per session scan A 903e271236ea

Subscribe to this mod's changes

api is an agent published in the GitHub repository nxtg-ai/forge-plugin (5 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,845 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.