> This page is for Server SDKs.

> 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.

# register

> Register an agent at a URL route on the server.

[agentbase]: /docs/server-sdks/reference/python/agents/agent-base

Register an [`AgentBase`][agentbase] instance at a URL route
on the server. The agent's FastAPI router is mounted at the specified prefix so all of its
endpoints (SWML, SWAIG, debug, post-prompt) become available under that path.

> **Warning**
>
> Registering a duplicate route raises `ValueError`. Each route can only host one agent.

## **Parameters**

**`agent`** `AgentBase` — required

The agent instance to register. Must be an [`AgentBase`][agentbase]
subclass.

---

**`route`** `str | None` — default: None

URL path prefix for this agent (e.g., `"/sales"`). If omitted, the agent's own `route`
property is used. Leading slashes are added and trailing slashes are stripped automatically.

---

## **Returns**

`None`

## **Example**

```python {10}
from signalwire import AgentServer
from signalwire import AgentBase

class SalesAgent(AgentBase):
    def __init__(self):
        super().__init__(name="sales-agent", route="/sales")
        self.prompt_add_section("Role", "You are a sales rep.")

server = AgentServer(port=3000)
server.register(SalesAgent(), "/sales")
server.run()
```