back
loading skill details...
FastAPI best practices and conventions. Use when working with FastAPI APIs, Pydantic models, dependencies, streaming responses including Server-Sent Events…
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. Server-Sent Events (SSE): use response_class=EventSourceResponse and yield; see Streaming and the streaming reference. JSON Lines and byte streaming: see the streaming reference. Dependencies: use Annotated[..., Depends(...)]; see Dependency Injection and the dependency injection reference 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. Pydantic models: do not use ellipsis or RootModel; see the Pydantic reference. Routing: declare router-level prefix, tags, and shared dependencies on the APIRouter; see the path operation reference. Tooling and related libraries: use uv, Ruff, ty, Asyncer, SQLModel, and HTTPX when applicable; see the other tools reference. Use the fastapi CLI Run the development server on localhost with reload:
don't have the plugin yet? install it then click "run inline in claude" again.