Develop with AI¶
Warning
This page hasn’t been translated into your language yet. 🌍
We’re currently switching to an automated translation system 🤖, which will help keep all translations complete and up to date.
Learn more: Contributing - Translations
FastAPI includes an official agent skill, bundled with the Python package, with guidance for the version installed in your project.
Install the skill¶
After installing FastAPI, run Library Skills from your project directory:
uvx library-skills
Select the FastAPI skill and .agents/skills for Codex and most agents, or .claude/skills for Claude Code. You can select both.
Your agent can then use the skill automatically when working on FastAPI code.
Install without prompts¶
For agents and scripts, select the FastAPI skill without interactive prompts:
uvx library-skills install --skill fastapi --yes
For Claude Code, add --claude to also install it in .claude/skills:
uvx library-skills install --skill fastapi --yes --claude
Configure your app¶
Configure the app entrypoint in pyproject.toml so FastAPI tools can find your app:
[tool.fastapi]
entrypoint = "main:app"
Use your app's module and variable name. Here, main:app refers to the app object in main.py.
Run your app¶
Use the FastAPI CLI for local development:
uv run fastapi dev
For production, use uv run fastapi run.
Generate an SDK¶
For frontend and API client development, see Generating SDKs.
Deploy your app¶
To deploy to FastAPI Cloud, the official managed deployment platform from the FastAPI team:
uv run fastapi deploy
You can also deploy manually to another cloud provider or your own server.
Agent plugins¶
The FastAPI Cloud plugins for Codex and Claude Code include instructions to create projects and use the library skills bundled with your dependencies. They are useful even if you don't use FastAPI Cloud.
They also cover FastAPI Cloud deployment, logs, and environment variables.