terminals
Client for the Terminals endpoints.
Reverse proxy for admin-configured terminal servers. Provides access to terminal server listings and HTTP proxy forwarding.
The WebSocket proxy endpoint (/{server_id}/api/terminals/{session_id})
is not supported by this HTTP client — WebSocket connections cannot be
wrapped by httpx.
Classes
TerminalsClient
TerminalsClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Terminals endpoints.
Terminals is a reverse-proxy feature that forwards HTTP requests to admin-configured terminal servers. Only the HTTP endpoints are implemented; the interactive WebSocket proxy is not supported.
- Code Reference client Classes OpenWebUI Attributes terminals
Source code in src/owui_client/client_base.py
Functions
list_servers
List terminal servers the authenticated user has access to.
Returns only servers that are enabled and for which the user's
group membership grants access. Each entry contains id,
url, and name.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of terminal server dicts, each with keys |
list[dict[str, Any]]
|
|
Source code in src/owui_client/routers/terminals.py
proxy
proxy(
server_id: str,
path: str,
method: str = "GET",
json: Optional[Any] = None,
data: Optional[Any] = None,
params: Optional[dict[str, Any]] = None,
) -> Any
Proxy a request to a terminal server.
Forwards an HTTP request through the Open WebUI backend to the terminal server identified by server_id. The backend handles authentication, path sanitization, and access control.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server_id
|
str
|
ID of the terminal server to proxy to. |
required |
path
|
str
|
URL path to append after the server base URL. |
required |
method
|
str
|
HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD,
OPTIONS). Defaults to |
'GET'
|
json
|
Optional[Any]
|
JSON body to forward with the request. |
None
|
data
|
Optional[Any]
|
Form or raw body to forward with the request. |
None
|
params
|
Optional[dict[str, Any]]
|
Query parameters to forward with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The proxied response from the terminal server. May be a dict, |
Any
|
list, bytes, or other type depending on the upstream response. |
Raises:
| Type | Description |
|---|---|
HTTPStatusError
|
If the backend returns 403 (access denied), 404 (server not found), 400 (invalid path), 502 (proxy error), or 503 (server URL not configured). |