endpoint

A command for adding a FastAPI web endpoint, its service logic, and tests to an existing module.

In plain words
What is it for?
Use it when adding a new HTTP operation such as GET, POST, PUT, or DELETE to a FastAPI application.
Why use it?
It reduces the manual work of finding the right files and keeping the endpoint, business logic, data types, and tests consistent.

Command

Part of the fastapi plugin — 2 skills, 5 commands, 1 agent 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/ruslan-korneev/claude-plugins/endpoint
Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Or install fastapi, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 1 agent.

Per session 10 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,171 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.00010 $0.01171
Opus 5 $0.00005 $0.00585
Sonnet 5 $0.00002 $0.00234
Haiku 4.5 $0.00001 $0.00117

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

Security

Grade A, and why

endpoint 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 2d 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.

plugins/fastapi/commands/endpoint.md · 194 lines

How it starts

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

Command /fastapi:endpoint

Create a new endpoint with service and test.

Instructions

Step 1: Analyze existing module

Read module files:

  • src/modules/{{ module }}/routers.py
  • src/modules/{{ module }}/services.py
  • src/modules/{{ module }}/dto.py

Step 2: Determine what needs to be created

Based on {{ method }} {{ path }} determine:

  • Are new DTOs needed
  • Is a new service method needed
  • Is a new repository method needed

Step 3: Create components

Endpoint in routers.py
@router.{{ method | lower }}("{{ path }}")
@inject
async def {{ endpoint_name }}(
    # Path parameters from {{ path }}
    id: int,
    # Body for POST/PATCH/PUT
    data: {{ DTO }}DTO,
    # DI
    service: Annotated[
        {{ module | capitalize }}Service,
        Depends(Provide[Container.{{ module }}_service]),
    ],
) -> {{ ResponseDTO }}:
    """{{ description }}."""
    return await service.{{ method_name }}(id, data)
Method in services.py
async def {{ method_name }}(self, ...) -> {{ ReturnType }}:
    """{{ description }}."""
    # Business logic
    pass
Test in test_routers.py
class Test{{ endpoint_name | capitalize }}:
    """Tests for {{ method }} {{ path }}."""

    async def test_{{ endpoint_name }}_success(
        self,
        client: AsyncClient,
    ) -> None:
        """Successfully {{ description | lower }}."""
        response = await client.{{ method | lower }}(
            "{{ path }}",
            json={...} if "{{ method }}" in ["POST", "PATCH", "PUT"] else None,
        )

        assert response.status_code == {{ expected_status }}

    async def test_{{ endpoint_name }}_not_found(
        self,
        client: AsyncClient,
    ) -> None:
        """{{ endpoint_name }} returns 404 when resource not found."""
        response = await client.{{ method | lower }}("{{ path_with_invalid_id }}")

        assert response.status_code == 404

Examples

GET /users/{user_id}/orders

Read the full file on GitHub · 194 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. 2d ago First seen · 194 lines · 10 tokens per session scan A 323fe4165464

Subscribe to this mod's changes

endpoint is a command published in the GitHub repository ruslan-korneev/claude-plugins (4 stars, last pushed 6mo ago), licensed MIT. It adds 10 tokens to every session and 1,171 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.