fastapi-routes

fastapi-routes is a skill for Claude Code, Codex from tedivm/robs_awesome_python_template. It costs 44 tokens per session (1,311 once invoked), scanned A, original, MIT.

A set of guidelines for building FastAPI web API routes, including request and response data models. FastAPI is a Python framework for creating web APIs.

In plain words
What is it for?
Adding or changing API endpoints, defining Pydantic models, registering routers, and designing REST APIs. REST APIs use standard actions such as reading, creating, updating, and deleting resources.
Why use it?
It keeps endpoints, HTTP actions, and data validation consistent across a project. It also avoids unclear or unchecked request and response data.

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/tedivm/robs_awesome_python_template/fastapi-routes
Any agent
npx skills add tedivm/robs_awesome_python_template --skill fastapi-routes
Clone the repo
git clone --depth 1 https://github.com/tedivm/robs_awesome_python_template

Made for: Claude Code, Codex.

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 fastapi-routes

README.md
[![agentmods](https://agentmods.dev/badge/skills/tedivm/robs_awesome_python_template/fastapi-routes.svg)](https://agentmods.dev/skills/tedivm/robs_awesome_python_template/fastapi-routes)
Your own site
<a href="https://agentmods.dev/skills/tedivm/robs_awesome_python_template/fastapi-routes"><img src="https://agentmods.dev/badge/skills/tedivm/robs_awesome_python_template/fastapi-routes.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,311 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.00044 $0.01311
Opus 5 $0.00022 $0.00656
Sonnet 5 $0.00009 $0.00262
Haiku 4.5 $0.00004 $0.00131

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

Security

Grade A, and why

fastapi-routes 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 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.

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.

{{cookiecutter.__package_slug}}/.agents/skills/fastapi-routes/SKILL.md · 200 lines

How it starts

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

FastAPI Routes

context7: If the context7_query-docs tool is available, resolve and load the full fastapi documentation before proceeding:

context7_resolve-library-id: "fastapi"
context7_query-docs: /fastapi/fastapi "<your query>"

Guidelines and patterns for writing FastAPI routes in this codebase.


REST Principles

APIs must adhere as closely as possible to REST principles, including appropriate use of HTTP verbs:

Verb Usage
GET Read one or many resources
POST Create a new resource
PUT Replace / fully update a resource
PATCH Partial update (use sparingly)
DELETE Remove a resource

Pydantic Models

  • Always use Pydantic models for both input and output — never use plain dict or Any.
  • Never reuse the same model for input and output. Use separate models:
    • PostCreate — user input for creating a resource
    • PostUpdate — user input for updating (optional fields)
    • PostRead — response shape returned to the client
  • Parameters in input models must use Field() with validation constraints and a description.
  • Output models do not require Field() unless you need aliases or serialization control.
from uuid import UUID
from pydantic import BaseModel, Field


class PostCreate(BaseModel):
    title: str = Field(min_length=1, max_length=200, description="Post title")
    content: str = Field(min_length=1, description="Post content")


class PostRead(BaseModel):
    id: UUID
    title: str
    content: str
    created_at: str


class PostUpdate(BaseModel):
    title: str | None = Field(default=None, max_length=200, description="Post title")
    content: str | None = Field(default=None, description="Post content")

Router Pattern

Use APIRouter for all routes. Register the router in {{cookiecutter.__package_slug}}/www.py.

Read the full file on GitHub · 200 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. 3d ago First seen · 200 lines · 44 tokens per session scan A 65fc767f0a44

Subscribe to this mod's changes

fastapi-routes is a skill published in the GitHub repository tedivm/robs_awesome_python_template (309 stars, last pushed 3mo ago), licensed MIT. It adds 44 tokens to every session and 1,311 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

html-preview

使用 Markdown html:preview 围栏输出轻量静态 HTML/CSS 可视化。当普通 Markdown 难以清晰表达数值对比、层级关系、流程、时间线、关键指标或布局示意,或用户明确要求可视化 HTML 预览时使用。询问 HTML 源码、教程示例或可复制代码时不要使用。.

xerrors/Yuxi · 86 tokens

deep-research

深度研究编排方法论:澄清范围、拆解规划、并行调度子智能体调研、对抗式核验、综合成带引用的结构化报告。当任务需要多来源、可追溯、需事实核查的深度研究时使用此技能。.

xerrors/Yuxi · 69 tokens

mysql reporter

生成 MySQL 查询报表并生成可视化图表。当用户需要查询 MySQL 数据库并以报表形式展示结果时使用此技能,包括:统计销售数据、分析用户行为、生成业务报表、查询业务指标等。.

xerrors/Yuxi · 55 tokens

knowledge-base

使用 Yuxi 知识库进行检索、打开文档、文档内定位和查看思维导图。当用户需要基于已配置知识库回答问题、核验资料或引用文档内容时使用此技能。.

xerrors/Yuxi · 54 tokens

background-task

Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.

vstorm-co/full-stack-ai-agent-template · 62 tokens

agent-tool

Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.aiframework }}.

vstorm-co/full-stack-ai-agent-template · 66 tokens