fastapi

fastapi is a skill for Claude Code, Codex from martinholovsky/claude-skills-generator. It costs 20 tokens per session (4,620 once invoked), scanned A, a copy of fastapi-martinholovsky, Unlicense.

Guidance for building FastAPI applications, a Python framework for REST APIs and WebSocket services. REST APIs serve standard web requests, while WebSockets support ongoing two-way connections.

In plain words
What is it for?
Use it to create secure REST endpoints and WebSocket services with Pydantic validation, dependency injection, OAuth2, JWTs, API keys, security headers, CORS, and rate limits.
Why use it?
It helps handle input validation, authentication, browser access rules, uploads, and denial-of-service risks consistently.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: model in frontmatter; positional $N argument.

Good fit Use it to create secure REST endpoints and WebSocket services with Pydantic validation, dependency injection, OAuth2, JWTs, API keys, security headers, CORS, and rate limits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/martinholovsky/claude-skills-generator/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 martinholovsky/claude-skills-generator --skill fastapi
Clone the repo
git clone --depth 1 https://github.com/martinholovsky/claude-skills-generator

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/martinholovsky/claude-skills-generator/fastapi.svg)](https://agentmods.dev/skills/martinholovsky/claude-skills-generator/fastapi)
Your own site
<a href="https://agentmods.dev/skills/martinholovsky/claude-skills-generator/fastapi"><img src="https://agentmods.dev/badge/skills/martinholovsky/claude-skills-generator/fastapi.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,620 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 97% copy Near-identical to another mod 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.00020 $0.04620
Opus 5 $0.00010 $0.02310
Sonnet 5 $0.00004 $0.00924
Haiku 4.5 $0.00002 $0.00462

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

Security

Grade A, and why

fastapi 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 8d 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.

rows = await db.fetch(query, *params)
Origin

This is a copy

97% identical to fastapi-martinholovsky — 18 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/fastapi/SKILL.md · 684 lines

How it starts

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

FastAPI Development Skill

File Organization

  • SKILL.md: Core principles, patterns, essential security (this file)
  • references/security-examples.md: CVE details and OWASP implementations
  • references/advanced-patterns.md: Advanced FastAPI patterns
  • references/threat-model.md: Attack scenarios and STRIDE analysis

Validation Gates

Gate 0.2: Vulnerability Research (BLOCKING for HIGH-RISK)

  • Status: PASSED (5+ CVEs documented)
  • Research Date: 2025-11-20
  • CVEs: CVE-2024-47874, CVE-2024-12868, CVE-2023-30798, Starlette DoS variants

1. Overview

Risk Level: HIGH

Justification: FastAPI applications handle authentication, database access, file uploads, and external API communication. DoS vulnerabilities in Starlette, injection risks, and improper validation can compromise availability and security.

You are an expert FastAPI developer creating secure, performant REST APIs and WebSocket services. You configure proper validation, authentication, and security headers.

Core Expertise Areas

  • Pydantic validation and dependency injection
  • Authentication: OAuth2, JWT, API keys
  • Security headers and CORS configuration
  • Rate limiting and DoS protection
  • Database integration with async ORMs
  • WebSocket security

2. Core Responsibilities

Fundamental Principles

  1. TDD First: Write tests before implementation code
  2. Performance Aware: Connection pooling, caching, async patterns
  3. Validate Everything: Use Pydantic models for all inputs
  4. Secure by Default: HTTPS, security headers, strict CORS
  5. Rate Limit: Protect all endpoints from abuse
  6. Authenticate & Authorize: Verify identity and permissions
  7. Handle Errors Safely: Never leak internal details

3. Technical Foundation

Version Recommendations

Component Version Notes
FastAPI 0.115.3+ CVE-2024-47874 fix
Starlette 0.40.0+ DoS vulnerability fix
Pydantic 2.0+ Better validation
Python 3.11+ Performance

Read the full file on GitHub · 684 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 684 lines · 20 tokens per session scan A 9af362d2e6cf

Subscribe to this mod's changes

fastapi is a skill published in the GitHub repository martinholovsky/claude-skills-generator (45 stars, last pushed 9mo ago), licensed Unlicense. It adds 20 tokens to every session and 4,620 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 97% identical to fastapi-martinholovsky, differing in 18 lines, and is treated as a copy.