fastapi

fastapi is a skill for Claude Code, Codex from G1Joshi/Agent-Skills. It costs 36 tokens per session (1,240 once invoked), scanned A, original, MIT.

A Python framework for building web APIs with typed data models and asynchronous request handling. It can also create interactive OpenAPI documentation, a standard description of an API.

In plain words
What is it for?
Use it to build Python APIs, including services that connect to machine-learning models and return validated JSON data.
Why use it?
It checks incoming data against declared models and generates API documentation, reducing repetitive validation and documentation work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build Python APIs, including services that connect to machine-learning models and return validated JSON data.

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

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/g1joshi/agent-skills/fastapi/github.svg)](https://agentmods.dev/skills/g1joshi/agent-skills/fastapi)
Your own site
<a href="https://agentmods.dev/skills/g1joshi/agent-skills/fastapi"><img src="https://agentmods.dev/badge/skills/g1joshi/agent-skills/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/g1joshi/agent-skills/fastapi"><img src="https://agentmods.dev/badge/skills/g1joshi/agent-skills/fastapi.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,240 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.
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.00036 $0.01240
Opus 5.5 $0.00014 $0.00496
Sonnet 5.5 $0.00007 $0.00248
Haiku 4.5 $0.00004 $0.00124

Measured 23d ago against content hash 7c84ec3fb9e2, 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 23d 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/frameworks/fastapi/SKILL.md · 164 lines

How it starts

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

FastAPI

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints. It is one of the fastest Python frameworks available.

When to Use

  • High-Performance Python Web APIs: Developing modern async APIs built on Starlette and Pydantic.
  • AI & Machine Learning Model Serving: Serving PyTorch, TensorFlow, Scikit-learn, and Hugging Face inference endpoints.
  • Automatic OpenAPI & Swagger Documentation: Generating interactive documentation with zero manual configuration.
  • Data Validation & Type-Safe Payloads: Validating query parameters, paths, headers, and request bodies with Pydantic v2.

Quick Start

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class Item(BaseModel):
    name: str
    price: float

@app.post("/items/")
async def create_item(item: Item):
    return {"name": item.name, "price": item.price}

Core Concepts

Async Route Handlers & Pydantic v2 Models

Strict payload parsing and serialization:

from fastapi import FastAPI, HTTPException, status, Depends
from pydantic import BaseModel, EmailStr, Field
from typing import List

app = FastAPI(title="Catalog API", version="2.0.0")

class ProductCreate(BaseModel):
    name: str = Field(min_length=2, max_length=100)
    price: float = Field(gt=0, description="Price in USD")
    tags: List[str] = []

class ProductResponse(ProductCreate):
    id: int
    is_active: bool = True

@app.post("/products", response_model=ProductResponse, status_code=status.HTTP_201_CREATED)
async def create_product(product: ProductCreate):
    # Process and persist product
    return {
        "id": 101,
        "name": product.name,
        "price": product.price,
        "tags": product.tags,
        "is_active": True
    }

Dependency Injection System with Depends

Reusing database sessions, authentication, and service clients:

from fastapi import Header, HTTPException

async def verify_api_key(x_api_key: str = Header(...)):
    if x_api_key != "secret-internal-key":
        raise HTTPException(
            status_code=status.HTTP_403_FORBIDDEN,
            detail="Invalid API Key"
        )
    return x_api_key

@app.get("/secure-metrics")
async def get_metrics(api_key: str = Depends(verify_api_key)):
    return {"status": "authorized", "system_load": 0.42}

Read the full file on GitHub · 164 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. 23d ago Changed · +5 lines 7c84ec3fb9e2
  2. 27d ago Changed · +96 lines · +14 tokens per session 827545f1f375
  3. 1mo ago First seen · 63 lines · 22 tokens per session scan A c5b2604a8a71

Subscribe to this mod's changes

fastapi is a skill published in the GitHub repository G1Joshi/Agent-Skills (15 stars, last pushed 23d ago), licensed MIT. It adds 36 tokens to every session and 1,240 once invoked, about $0.0001 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-09-03.

Related

Other skills, from other repositories

python-programming-expert

Expert-level skill for Python programming (Python 3.13/3.14+). Covers type safety, generic syntax (PEP 695), async/await TaskGroups, FastAPI 0.115+, Pydantic v2, uv package manager, Ruff, and pytest in English and Indonesian.

roedyrustam/vibes-plug · 68 tokens

fastapi-async-microservices

Design and develop production-grade asynchronous microservices using FastAPI, Python 3.12+, Pydantic v2 Settings and Schemas, SQLAlchemy 2.0 async sessions, dependency injection, lifespan state management, structured JSON logging, and connection pooling. Trigger when building async Python APIs, microservices, or…

hamzabellouch/agent-skills · 77 tokens

azure-mgmt-apicenter-py

Azure API Center Management SDK for Python. Use for managing API inventory, metadata, and governance across your organization.

tmolavi/mcp-agent-skills-hub · 31 tokens

python-fastapi-development

Python FastAPI backend development with async patterns, SQLAlchemy, Pydantic, authentication, and production API patterns.

tmolavi/mcp-agent-skills-hub · 28 tokens

dbos-python

Guide for building reliable, fault-tolerant Python applications with DBOS durable workflows. Use when adding DBOS to existing Python code, creating workflows and steps, or using queues for concurrency control.

tmolavi/mcp-agent-skills-hub · 43 tokens

fastapi-router-py

Create FastAPI routers following established patterns with proper authentication, response models, and HTTP status codes.

tmolavi/mcp-agent-skills-hub · 25 tokens