> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aion.to/llms.txt
> Use this file to discover all available pages before exploring further.

# AppRegistry

> Register custom FastAPI routes in agent processes.

Use `app_registry` to mount custom FastAPI routers in the same process as your agent server.

## When to Use

* Add custom health or diagnostics endpoints.
* Expose supplemental API routes used by your integrations.
* Keep custom routes close to the agent module that is loaded by `aion.yaml`.

## Example

`aion.yaml`:

```yaml theme={null}
aion:
  agents:
    support:
      path: "./agent.py:build_graph"
```

`agent.py`:

```python theme={null}
from fastapi import APIRouter
from aion.server import app_registry

custom_router = APIRouter(prefix="/api/custom")


@custom_router.get("/health")
async def custom_health():
    return {"status": "ok"}


app_registry.add_router(custom_router)
```

## API

| Method                          | Description                     |
| ------------------------------- | ------------------------------- |
| `add_router(router: APIRouter)` | Registers a FastAPI router.     |
| `get_routers()`                 | Returns all registered routers. |
