fastapi

fastapi is a skill for Claude Code from arbazkhan971/godmode. It costs 55 tokens per session (1,825 once invoked), scanned A, original, MIT.

A FastAPI development guide for building Python web APIs, including data models, dependency injection, asynchronous database access, background tasks, WebSockets, and testing.

In plain words
What is it for?
Use it to create or review FastAPI routes and services, define Pydantic data models, connect to databases asynchronously, add background work or WebSockets, and test the API.
Why use it?
It helps organize common FastAPI decisions and checks so backend work does not miss important application, database, or testing pieces.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the godmode plugin — 132 skills, 1 command, 7 agents, 3 MCP servers shipped together

Good fit Use it to create or review FastAPI routes and services, define Pydantic data models, connect to databases asynchronously, add background work or WebSockets, and test the API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arbazkhan971/godmode/fastapi
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.

Any agent
npx skills add arbazkhan971/godmode --skill fastapi
Clone the repo
git clone --depth 1 https://github.com/arbazkhan971/godmode

Made for: Claude Code.

Or install godmode, the plugin that ships this one along with the rest of its 132 skills, 1 command, 7 agents, 3 MCP servers.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/arbazkhan971/godmode/fastapi/github.svg)](https://agentmods.dev/skills/arbazkhan971/godmode/fastapi)
Your own site
<a href="https://agentmods.dev/skills/arbazkhan971/godmode/fastapi"><img src="https://agentmods.dev/badge/skills/arbazkhan971/godmode/fastapi/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fastapi

Your own site · 80×15
<a href="https://agentmods.dev/skills/arbazkhan971/godmode/fastapi"><img src="https://agentmods.dev/badge/skills/arbazkhan971/godmode/fastapi.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00055 $0.01825
Opus 5.5 $0.00022 $0.00730
Sonnet 5.5 $0.00011 $0.00365
Haiku 4.5 $0.00006 $0.00183

Measured 1mo ago against content hash 7a186a99500d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fastapi 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 1mo 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.

skills/fastapi/SKILL.md · 255 lines

How it starts

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

FastAPI — FastAPI Mastery

Activate When

  • User invokes /godmode:fastapi
  • User says "build a FastAPI app", "async API"
  • User asks about Pydantic, DI, async endpoints
  • When working with Python async backend services
  • User says "fastapi route", "FastAPI endpoint", "route for orders"

Workflow

Step 1: Project Assessment

# Detect FastAPI project
grep -l "fastapi" pyproject.toml requirements.txt \
  setup.py 2>/dev/null

# Check Python version
python3 --version

# Detect package manager
ls uv.lock poetry.lock Pipfile.lock 2>/dev/null
FASTAPI ASSESSMENT:
FastAPI version: <0.115.x>
Python: <3.12+ recommended>
ORM: SQLAlchemy 2.0 async | Tortoise | SQLModel
Auth: JWT | OAuth2 | API keys
Package manager: uv (preferred) | Poetry | pip

IF Python < 3.12: recommend upgrade for performance
IF using sync psycopg2: must migrate to asyncpg
IF no Alembic: add migration support immediately
PROJECT STRUCTURE:
app/
├── main.py           # FastAPI app factory
├── config.py         # pydantic-settings
├── dependencies.py   # Shared DI (DB, auth)
├── api/v1/
│   ├── router.py     # Aggregates all v1 routes
│   ├── orders.py     # Order endpoints
│   └── customers.py  # Customer endpoints
├── models/           # SQLAlchemy models
├── schemas/          # Pydantic schemas
├── services/         # Business logic
└── tests/

Step 2: Pydantic Model Design

PYDANTIC PATTERNS:
| Pattern                  | Usage               |
|--------------------------|---------------------|
| Separate Create/Update/Resp | Per-operation    |
| field_validator          | Single-field custom |
| model_validator          | Cross-field logic   |
| Field(gt=0, max_length)  | Declarative limits |
| from_attributes=True     | ORM → Pydantic     |
| Generic PaginatedResp[T] | Reusable pagination|

THRESHOLDS:
  max_length for strings: always set (default 255)
  gt=0 for IDs and counts: always set
  le=1000 for pagination page_size: prevent abuse
  IF no Field() constraints: validation is incomplete

Read the full file on GitHub · 255 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. 1mo ago First seen · 255 lines · 55 tokens per session scan A 7a186a99500d

Subscribe to this mod's changes

fastapi is a skill published in the GitHub repository arbazkhan971/godmode (27 stars, last pushed 1mo ago), licensed MIT. It adds 55 tokens to every session and 1,825 once invoked, about $0.0002 per session on Opus 5.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.