AgentsAgentBase

get_full_url

View as MarkdownOpen in Claude

Get the full URL for this agent’s endpoint. The URL is constructed from the agent’s host, port, and route. In serverless environments, the URL is derived from platform-specific environment variables. When behind a proxy, the SWML_PROXY_URL_BASE environment variable or manual_set_proxy_url() takes precedence.

Parameters

include_auth
boolDefaults to False

Whether to embed Basic Auth credentials in the URL (e.g., https://user:pass@host:port/route).

Returns

str — The fully constructed URL string.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support", port=3000)
4agent.set_prompt_text("You are a helpful assistant.")
5url = agent.get_full_url()
6print(url) # http://0.0.0.0:3000/support
7
8url_with_auth = agent.get_full_url(include_auth=True)
9print(url_with_auth) # http://user:pass@0.0.0.0:3000/support