Skip to main content
Aegra lets you mount a custom FastAPI app alongside the core Agent Protocol endpoints. Use this for webhooks, admin panels, health dashboards, or any other HTTP endpoints your application needs.

Setup

1

Create a FastAPI app

2

Register it in aegra.json

3

Start the server

Your custom routes are now available alongside the Agent Protocol API.

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

Set enable_custom_route_auth in your config:

Option 2: Apply auth to specific routes

Use the require_auth dependency on individual routes:

CORS configuration

Configure CORS for your custom routes in aegra.json:
The default is 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