> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # as_router > Get the agent's endpoints as a FastAPI APIRouter for mounting in larger applications. [agentserver]: /docs/server-sdks/reference/python/agents/agent-server Get a FastAPI `APIRouter` containing all of this agent's registered routes. This is the lowest-level integration point for embedding an agent's endpoints into an existing FastAPI application. Use this when you need fine-grained control over how the agent's routes are mounted, or when composing multiple agents into a custom application layout. For multi-agent hosting, consider [`AgentServer`][agentserver] instead. ## **Parameters** None. ## **Returns** `HostAppRouter` -- A FastAPI `APIRouter` subclass with all agent endpoints (SWML delivery, SWAIG function handling, post-prompt, debug events, etc.). It adds no behavior; the subclass exists to give the return type a stable name. ## **Example** ```python {9-10} from fastapi import FastAPI from signalwire import AgentBase app = FastAPI() support_agent = AgentBase(name="support", route="/support") sales_agent = AgentBase(name="sales", route="/sales") app.include_router(support_agent.as_router(), prefix="/support") app.include_router(sales_agent.as_router(), prefix="/sales") ``` > Get the agent's endpoints as a FastAPI APIRouter for mounting in larger applications.