Official agent skill

Fastapi Router Py

by microsoft in microsoft/skills

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models.

OfficialMITAuto-check passedBackend & APIs

Install Fastapi Router Py

skills CLI
$ npx skills add microsoft/skills --skill fastapi-router-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills fastapi-router-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/fastapi-router-py .claude/skills/fastapi-router-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fastapi-router-py
GitHub stars
3.1k
Used in
1 other repo
Token cost
~568 tokens
SKILL.md length
136 words
Files
3 (incl. references, assets)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models.

  • Works in 5 steps: Create router in src/backend/app/routers/ → Mount in src/backend/app/main.py → Create corresponding Pydantic models → …
  • Building REST API endpoints
  • SKILL.md covers Quick Start, Authentication Patterns, Response Models and HTTP Status Codes, plus 3 more sections
  • Runs Python scripts from its folder

What it does

Fastapi Router Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

Its SKILL.md is about 570 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files and assets (for example `assets/template.py` and `references/capabilities.md`).

It sits in Backend & APIs, covering Backend development. It works with FastAPI. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Building REST API endpoints
  • Creating new routes
  • Implementing CRUD operations
  • Adding authenticated endpoints in FastAPI applications

Example prompts

  • “/fastapi-router-py”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Create router in src/backend/app/routers/
  2. Mount in src/backend/app/main.py
  3. Create corresponding Pydantic models
  4. Create service layer if needed
  5. Add frontend API functions

What it can do on your machine

Read from SKILL.md and the folder at commit 354361d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fastapi Router Py loads about 568 tokens when it runs, and up to ~802 if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 136 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~568
With references · SKILL.md plus every file in references/, read only if the agent opens them
~802

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 354361d, republished under its MIT licence (© microsoft). 136 words, ~568 tokens.

Download SKILL.mdSave it as .claude/skills/fastapi-router-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
fastapi-router-py
description
Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0

FastAPI Router

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

Quick Start

Copy the template from assets/template.py and replace placeholders:

  • {{ResourceName}} → PascalCase name (e.g., Project)
  • {{resource_name}} → snake_case name (e.g., project)
  • {{resource_plural}} → plural form (e.g., projects)

Authentication Patterns

python
# Optional auth - returns None if not authenticated
current_user: Optional[User] = Depends(get_current_user)

# Required auth - raises 401 if not authenticated
current_user: User = Depends(get_current_user_required)

Response Models

python
@router.get("/items/{item_id}", response_model=Item)
async def get_item(item_id: str) -> Item:
    ...

@router.get("/items", response_model=list[Item])
async def list_items() -> list[Item]:
    ...

HTTP Status Codes

python
@router.post("/items", status_code=status.HTTP_201_CREATED)
async def create_item(item: ItemCreate) -> Item:
  ...

@router.delete("/items/{id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_item(id: str) -> None:
  ...

Integration Steps

  1. Create router in src/backend/app/routers/
  2. Mount in src/backend/app/main.py
  3. Create corresponding Pydantic models
  4. Create service layer if needed
  5. Add frontend API functions

Best Practices

  1. Pick def or async def per endpoint based on whether you call async I/O; do not call blocking I/O from an async def handler.
  2. Manage long-lived resources (DB pools, HTTP clients) in lifespan and inject via Depends; use with/async with for per-request resources.

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references, assets) in .github/plugins/azure-sdk-python/skills/fastapi-router-py of microsoft/skills.

  • SKILL.md
  • assets/template.py
  • references/capabilities.md

Open the folder on GitHubat commit 354361d

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in microsoft/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Fastapi Router Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fastapi Router Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fastapi Router Py this skillmicrosoft/skills3.1k1 repos~568Automated safety check: PassMIT
Fastcrudbenavlabs/fastcrud1.6k—~5kAutomated safety check: PassMIT
FastapiOpen-TutorAi/open-tutor-ai-CE1082 repos~2.6kAutomated safety check: PassBSD-3-Clause
API Surface Reviewpolarsource/polar10k—~1.3kAutomated safety check: PassMIT
FastAPI-Redis SDK Developmentredis/fastapi-redis-sdk404—~2.5kAutomated safety check: NotesMIT
Phoenix ServerArize-ai/phoenix12k—~1.6kAutomated safety check: PassCustom licence

Similar skills

  • Fastcrud

    benavlabs/fastcrud

    A skill your agent uses when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig…

    1.6k GitHub stars~5k tokensUpdated 12 days ago
    Backend & APIsAuto-check passed
  • Fastapi

    Open-TutorAi/open-tutor-ai-CE

    FastAPI best practices and conventions. An agent skill from Open-TutorAi/open-tutor-ai-CE.

    108 GitHub starsUsed in 2 repos~2.6k tokens
    Backend & APIsAuto-check passed
  • API Surface Review

    polarsource/polar

    Review changes to Polar's API contract — Pydantic schemas, FastAPI endpoints, OpenAPI output and the generated SDKs.

    10k GitHub stars~1.3k tokensUpdated today
    Backend & APIsAuto-check passed
  • FastAPI-Redis SDK Development

    redis/fastapi-redis-sdk

    Official

    Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.

    404 GitHub stars~2.5k tokensUpdated 6 days ago
    Backend & APIsAuto-check: notes
  • Phoenix Server

    Arize-ai/phoenix

    Backend development guide for the Phoenix AI observability platform (Strawberry GraphQL, SQLAlchemy async, FastAPI).

    12k GitHub stars~1.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Andrej Karpathy Perspective

    nazarli-shabnam/clevis

    Andrej Karpathy的思维框架与表达方式。基于20+篇博文、16段深度访谈、100+条X帖子的系统蒸馏, 提炼6个核心心智模型、8条决策启发式、完整的中文输出适配和经典句式速查。

    170 GitHub starsUsed in 3 repos~3.8k tokens
    Backend & APIsAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub starsUsed in 6 repos~2.8k tokens
    Auto-check passed
  • Official

    Python guidance for the Azure AI Search SDK covering vector, hybrid and semantic search, index management and indexers, with Entra ID authentication preferred over keys.

    3.1k GitHub starsUsed in 6 repos~4.4k tokens
    Auto-check passed
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 6 repos~496 tokens
    Auto-check passed
  • Official

    Builds podcast-style audio narration from text with Azure OpenAI's GPT Realtime Mini over WebSocket, from a Python FastAPI backend to a React player.

    3.1k GitHub starsUsed in 1 repo~947 tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed

Works with

Categories

Questions about Fastapi Router Py

What does Fastapi Router Py do?

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Fastapi Router Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models.

When should I use Fastapi Router Py?

Fastapi Router Py fits situations like: building REST API endpoints; creating new routes; implementing CRUD operations; adding authenticated endpoints in FastAPI applications.

How do I install Fastapi Router Py in Claude Code?

Run `npx skills add microsoft/skills --skill fastapi-router-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/fastapi-router-py in microsoft/skills) into .claude/skills/fastapi-router-py in your project. Claude Code loads it when a task matches its description.

How do I install Fastapi Router Py in Codex?

Run `npx skills add microsoft/skills --skill fastapi-router-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/fastapi-router-py in microsoft/skills) into .agents/skills/fastapi-router-py in your project. Codex loads it when a task matches its description.

Can I use Fastapi Router Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill fastapi-router-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fastapi-router-py, .gemini/skills/fastapi-router-py, .github/skills/fastapi-router-py and .opencode/skills/fastapi-router-py in your project.

What does Fastapi Router Py need to run?

Going by SKILL.md and its folder, Fastapi Router Py needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Fastapi Router Py access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Fastapi Router Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fastapi Router Py use?

Fastapi Router Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fastapi Router Py use?

About 568 tokens (SKILL.md is roughly 2.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 234 tokens, read only when the agent opens those files.

What are the alternatives to Fastapi Router Py?

Skills that share tags, products or a category with Fastapi Router Py: Fastcrud (benavlabs/fastcrud, 1.6k stars), Fastapi (Open-TutorAi/open-tutor-ai-CE, 108 stars), API Surface Review (polarsource/polar, 10k stars) and FastAPI-Redis SDK Development (redis/fastapi-redis-sdk, 404 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fastapi Router Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,086 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.