FastAPI skill

The official FastAPI skill, bundled with the package, teaching agents to write code for the installed version

  • 104,278 ★ on the repository
  • Last commit
  • MIT
SkillEditors’ pick

Minimal access

Why this level

  • The skill consists only of instructions and references
All reasons and checks

fastapi/fastapi

Install

Manual install

uvx library-skills

Run in a project where FastAPI is already installed. For Claude Code choose .claude/skills.

Access and checks

How we review

Minimal accessThe tool runs nothing and makes no network calls.

  • The skill consists only of instructions and references

This is third-party code. Review the repository files before installing.

What it does

The skill lives inside the fastapi package, so its guidance matches the framework version in the project and updates with it. It gives the agent current patterns: parameters and dependencies via Annotated, response models via return types, APIRouter-level settings, JSON Lines and Server-Sent Events streaming, and serving a built frontend with app.frontend(). It also has the agent run the server with fastapi dev and fastapi run, declare the entrypoint in pyproject.toml, and use related tools: uv, Ruff, ty, SQLModel, HTTPX. Details sit in separate reference files the agent reads when needed.

Who it is for. For Python developers building APIs with FastAPI alongside a coding agent.

Good fit when

  • The agent writes FastAPI code from outdated examples
  • You need to add SSE or response streaming
  • You want dependencies and routers aligned with the current style

Not a fit when

  • The project uses Django, Flask or another framework
  • The project is pinned to an old FastAPI version without the bundled skill

Example request

Add an endpoint that streams task progress via Server-Sent Events

Limitations

The skill installs from the package already present in the project, so FastAPI must be installed first, and the install command needs uv. The skill contains coding guidance only and does not check the project automatically.

How to disable. Delete the fastapi folder from the agent's skills directory, for example .claude/skills/fastapi.

FAQ

Why install via library-skills rather than from GitHub?

Library Skills scans packages installed in the project and takes the skill from the FastAPI version you actually have.

Which agents does it work with?

The docs list Codex, Claude Code, Cursor, GitHub Copilot, Gemini CLI, Pi and OpenCode.

Discussion

No questions or reviews yet.

Skills

Node.js skills from a Fastify co-creator: Node and Fastify practices, TypeScript, OAuth, linting and documentation

SkillMinimal access2KRepository stars

Scalar API Reference skill for agents

Scalar API Reference skill

Official

A skill that adds a Scalar reference to an app from its OpenAPI description: integrations, authentication, themes, migration from Swagger UI

SkillMinimal access16.3KRepository stars

The official Payload CMS skill shipped inside the package: collections, fields, hooks, access control, queries and database adapters

SkillMinimal access45.6KRepository stars

Laravel API Architecture Skill

Laravel API Production-Ready Architecture Skill

A skill that keeps an agent within a layered Laravel API architecture: JSON:API v1.1, strict types, PHPStan level 8 and tests

SkillMinimal access22Repository stars

Better Auth skills

Better Auth Skills

Official Better Auth skills: scaffold authentication in JS and TS projects and guide a secure setup

SkillExtended access227Repository stars

README in short

The repository is the FastAPI framework itself; the skill is described in the tutorial docs: it ships in the package and installs with uvx library-skills once FastAPI is in the project. SKILL.md holds a quick reference and links to references on dependencies, responses, streaming, Pydantic, routing and tooling. Release notes show the skill updated regularly alongside new framework features. MIT licensed.

README badge

Original SKILL.md

---
name: fastapi
description: FastAPI best practices and conventions. Use when working with FastAPI APIs, Pydantic models, dependencies, streaming responses including Server-Sent Events (SSE), and serving frontend apps. Keeps FastAPI code clean and up to date with the latest features and patterns.
---

# FastAPI

Official FastAPI skill to write code with best practices, keeping up to date with new versions and features.

## Quick Reference

* Serve frontend apps: use `app.frontend()` or `router.frontend()` for built frontend assets; see [Serve Frontend Apps](#serve-frontend-apps).
* Server-Sent Events (SSE): use `response_class=EventSourceResponse` and `yield`; see [Streaming](#streaming-json-lines-sse-bytes) and [the streaming reference](references/streaming.md).
* JSON Lines and byte streaming: see [the streaming reference](references/streaming.md).
* Dependencies: use `Annotated[..., Depends(...)]`; see [Dependency Injection](#dependency-injection) and [the dependency injection reference](references/dependencies.md) for `yield`, scopes, and class dependencies.
* Response models: prefer return types; use `response_model` when the public response schema differs from the internal return value; see [the response reference](references/responses.md).
* Pydantic models: do not use ellipsis or `RootModel`; see [the Pydantic reference](references/pydantic.md).
* Routing: declare router-level prefix, tags, and shared dependencies on the `APIRouter`; see [the path operation reference](references/path-operations.md).
* Tooling and related libraries: use uv, Ruff, ty, Asyncer, SQLModel, and HTTPX when applicable; see [the other tools reference](references/other-tools.md).

## Use the `fastapi` CLI

Run the development server on localhost with reload:

```bash
fastapi dev
```

Run the production server:

```bash
fastapi run
```

Report a problem

Foxx AIFastAPI skill
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.