Deploy a FastAPI app

Get a FastAPI project from a working local server to a dependable production API without building the surrounding infrastructure yourself. Tokay detects the app and entry point, keeps the Python process running, and gives it an HTTPS URL.

Last updated

Start from the FastAPI code you have

You do not need to translate uvicorn main:app into a separate platform configuration. Push a repo, connect GitHub, or paste the files, and Tokay reads the imports and source to find FastAPI, its entry point, packages, and environment variables.

Before deployment, you review the detected setup and enter the private values only you know. If a key appears in the source, we flag it so you can move the value into encrypted storage.

The API and its background work stay together

You do not need a second platform for work that continues after an API request. Tokay runs a worker as its own long running Service beside the API, while scheduled jobs start when they are due. They share the same database and secrets.

Long lived connections, streaming responses, and WebSockets stay attached to the running server process on the Workspace's dedicated virtual machine.

Database setup follows the code

A FastAPI app that expects Postgres can reach it without a separate provisioning step. Tokay creates the database and supplies DATABASE_URL in the dialect expected by the application's driver.

Deployments use health checks and automatic rollback. Database migrations are rehearsed against a copy of production data before they run on the live database.

Your AI agent can return a live API

A coding agent like Claude Code or Codex can carry the project through deployment and endpoint verification instead of stopping after code generation. Through Tokay's GraphQL API, it can submit the source, review the detected setup, set the secrets you provide, deploy the Services, and check that the API responds.

Point your agent to app.tokay.io/llms.txt for the deployment protocol.

Tokay has a very generous free tier with no credit card. Get started.

Related guides