Setup
1
Create a FastAPI app
2
Register it in aegra.json
3
Start the server
Route priority
Custom routes follow this priority order:
You can override the root route
/ and /info, but you cannot override the Agent Protocol endpoints or health checks.
Authentication on custom routes
By default, custom routes do not have Aegra’s authentication applied. You have two options:Option 1: Apply auth to all custom routes
Setenable_custom_route_auth in your config:
Option 2: Apply auth to specific routes
Use therequire_auth dependency on individual routes:
CORS configuration
Configure CORS for your custom routes inaegra.json:
allow_origins: ["*"] with allow_credentials: false. When you specify concrete origins, allow_credentials defaults to true automatically. You can always set allow_credentials explicitly to override the default.