Customize
Customize AgentOS application routes, middleware, dependencies, lifecycle, and response handling.
Customize the FastAPI application, lifecycle, routes, and response handling around AgentOS.
| Example | Purpose |
|---|---|
| Basic | Supply a custom FastAPI application. |
| CORS and security key | Configure browser origins and a shared security key. |
| Custom events | Emit application events from a tool. |
| Middleware | Add request middleware. |
| Dependencies | Pass per-request values into agent instruction templates. |
| Lifespan | Combine application startup and shutdown with AgentOS. |
| Response middleware | Observe JSON and SSE response bodies. |
| Route conflicts | Choose precedence for overlapping routes. |