# FastAPI

A FastAPI skill for your coding agent: routes, Pydantic models, async handlers, auth and tests. Useful when you are building a Python API.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 181 installs · ★ 7 repo stars
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-python/tree/HEAD/skills/fastapi/SKILL.md
- Updated: 2026-01-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/pluginagentmarketplace-fastapi

## What it does

The skill walks an agent through FastAPI app layout: route decorators, path and query parameters, request bodies, response models. A Pydantic section covers validation of incoming payloads, serialisation of responses, custom validators and settings.

Async gets its own block: endpoint handlers, background tasks, database calls, concurrent requests. Security material includes OAuth2, JWT, API-key auth, dependency injection and CORS setup. Advanced topics: WebSockets, uploads, streaming responses, middleware, testing.

Python fundamentals, async/await and HTTP basics are needed before any of it pays off. Skip that groundwork and the concurrency sections read as vocabulary — the skill teaches patterns, not the language. Its config switches on logging and a `request_latency` metric, with exponential backoff on retries.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill fastapi -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/fastapi/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/fastapi/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill fastapi -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/fastapi/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill fastapi -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/fastapi/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-python skills/fastapi
```

2. **Manually: put the files in place**
- File: `.github/skills/fastapi/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill fastapi -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-python --path skills/fastapi
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/fastapi/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill fastapi -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-python/tree/HEAD/skills/fastapi/SKILL.md

## When to use it
- scaffold an endpoint with Pydantic request and response models
- wire OAuth2 and JWT into an existing API
- stream a large file back to the client
- run a background task from an async handler
- write tests for a FastAPI app

## Example prompts
- Add a FastAPI endpoint `/items/{item_id}` with a Pydantic response model.
- Set up JWT auth with the OAuth2 password flow in this API.
- Write a test for the async upload handler.

## Similar
- [fastapi-development](https://affpapa.org/en/nevibecode/skills/fastapi-development.md) — skill · 627 installs
- [fastapi-python](https://affpapa.org/en/nevibecode/skills/fastapi-python.md) — skill · 14100 installs
- [fastapi-endpoint](https://affpapa.org/en/nevibecode/skills/fastapi-endpoint.md) — skill · 393 installs
- [python-fastapi-best-practices-cursorrules-prompt-f](https://affpapa.org/en/nevibecode/rules/python-fastapi-best-practices-cursorrules-prompt-f.md) — rule · ★ 41178 repo stars
- [fastapi-developer](https://affpapa.org/en/nevibecode/agents/fastapi-developer.md) — subagent · ★ 26718 repo stars
- [fastapi-patterns](https://affpapa.org/en/nevibecode/skills/fastapi-patterns.md) — skill · 6700 installs

## Other versions with the same name
- [fastapi · martinholovsky](https://affpapa.org/en/nevibecode/skills/fastapi.md) — 265 installs
- [fastapi · itechmeat](https://affpapa.org/en/nevibecode/skills/itechmeat-fastapi.md) — 100 installs

From the same set: [pluginagentmarketplace/custom-plugin-python](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-python.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
