Setup
Route priority
Custom routes follow this priority order:| Priority | Routes | Behavior |
|---|---|---|
| 1 | /health, /ready, /live, /docs, /openapi.json | Always accessible, cannot be overridden |
| 2 | Your custom routes | Take precedence over shadowable routes |
| 3 | /, /info | Can be overridden by custom routes |
| 4 | /assistants, /threads, /runs, /store | Core Agent Protocol routes, cannot be overridden |
/ 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.
Configuration reference
| Option | Type | Default | Description |
|---|---|---|---|
http.app | string | None | Import path to custom FastAPI app (./file.py:variable) |
http.enable_custom_route_auth | bool | false | Apply Aegra auth to all custom routes |
http.cors.allow_origins | list[str] | ["*"] | Allowed CORS origins |
http.cors.allow_credentials | bool | false when origins is ["*"], true otherwise | Allow credentials in CORS requests |