Skip to main content
AgentOS is built on FastAPI, which means you can easily integrate your existing FastAPI applications or add custom routes and routers to extend your agent’s capabilities.

Quick Start

The simplest way to bring your own FastAPI app is to pass it to the AgentOS constructor:
Your custom FastAPI app can have its own middleware and dependencies.If you have your own CORS middleware, it will be updated to include the AgentOS allowed origins, to make the AgentOS instance compatible with the Control Plane. Otherwise, the appropriate CORS middleware will be added to the app.

Adding Middleware

You can add any FastAPI middleware to your custom FastAPI app and it will be respected by AgentOS. Agno also provides some built-in middleware for common use cases, including authentication. See the Middleware page for more details.

Running with FastAPI CLI

AgentOS applications are compatible with the FastAPI CLI for development. First, install the FastAPI CLI:
Install FastAPI CLI
Then run the app:

Running in Production

For production deployments, you can use any ASGI server:

Adding Custom Routers

For better organization, use FastAPI routers to group related endpoints:
custom_fastapi_app.py

Middleware and Dependencies

You can add middleware and dependencies to your custom FastAPI app:

Access AgentOS Routes

You can programmatically access and inspect the routes added by AgentOS:

Developer Resources