fastapi
Skill by Open-TutorAi
Guides an AI assistant to write, refactor and update FastAPI code and its Pydantic models using current best practices. It is aimed at developers who build or maintain FastAPI APIs.
Install fastapi
Built from the published package, never by AI.
git clone --depth 1 https://github.com/Open-TutorAi/open-tutor-ai-CE /tmp/open-tutor-ai-CE && mkdir -p ~/.claude/skills && cp -r /tmp/open-tutor-ai-CE/.agents/skills/fastapi ~/.claude/skills/fastapiRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/Open-TutorAi/open-tutor-ai-CE /tmp/open-tutor-ai-CE && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/open-tutor-ai-CE/.agents/skills/fastapi ~/.gemini/antigravity-cli/skills/fastapiAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The FastAPI skill gives an AI assistant a set of best practices for writing and refactoring FastAPI APIs and the Pydantic models that go with them. It covers running the app with the fastapi CLI, including setting the entrypoint in pyproject.toml, and declaring parameters and dependencies with Annotated. It also explains when to use return types or response_model, how to organize routers, and when to write async or sync path operations.
The skill points to reference files for dependency injection, streaming with JSON Lines, Server-Sent Events and bytes, and tools such as uv, Ruff and ty. It recommends Asyncer, SQLModel and HTTPX over other libraries, and advises against Pydantic RootModels, ORJSONResponse and UJSONResponse. It is aimed at developers who write new FastAPI code or update older code to current patterns.
Written from the project's SKILL.md and checked against it.
What it can do
- Run the app with the fastapi CLIUses fastapi dev for a local reload server and fastapi run for production.
- Set the app entrypointReads the entrypoint from a [tool.fastapi] section in pyproject.toml, or accepts an app file path.
- Annotated parameter declarationsDeclares Path, Query, Header and similar parameters with the Annotated style.
- Reusable dependency type aliasesWraps Depends() in a reusable Annotated type alias for shared dependencies.
- Return types and response modelsUses return types or response_model to validate, filter and serialize responses.
- Router organizationSets prefix and tags on APIRouter and applies shared dependencies at the router level.
- Async vs sync path operationsExplains when to use async def and when to use plain def, and how dependencies follow the same rules.
- Streaming patternsPoints to reference guidance for JSON Lines, Server-Sent Events and StreamingResponse.
- Tooling and library guidancePoints to reference guidance for uv, Ruff, ty, Asyncer, SQLModel and HTTPX.
- One HTTP operation per functionSeparates each HTTP method into its own function instead of using api_route with multiple methods.
What you need
- Python
- FastAPI
Try asking
- Refactor this FastAPI route to use Annotated for its Query and Path parameters.
- Add a response_model to this FastAPI endpoint so it does not expose secret fields.
- Set up a pyproject.toml entrypoint for my FastAPI app and run it with fastapi dev.
Good to know
- The skill links to reference files for dependencies, streaming and other tools, which are not included in this source.
- Some recommendations, such as preferring Asyncer, SQLModel and HTTPX, are the skill's own guidance.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/fastapi/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to fastapi
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
fastapi: common questions
What does the FastAPI skill help with?
It helps an AI assistant write, refactor and update FastAPI code and Pydantic models following the best practices in the skill. It is meant to keep code aligned with current FastAPI features and patterns.
Does it recommend using Ellipsis for required parameters?
No. The skill says not to use ... as a default for required parameters, since it is not needed and not recommended. It shows examples without Ellipsis.
Should I use async or sync path operations?
Use async def only when the code called inside is fully async-compatible or non-blocking. In case of doubt, use regular def, which runs in a threadpool.
How do I install fastapi?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is fastapi free?
The code is published under the BSD-3-Clause licence. The service it connects to may have its own pricing.
Is fastapi safe to use?
It scores 66 of 100. Grades: maintenance C, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to fastapi?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
