Skip to content

root

Client for root/main endpoints.

Classes

RootClient

RootClient(client: OWUIClientBase)

Bases: ResourceBase

Client for root/main endpoints (version, config, models, etc.).

Source code in src/owui_client/client_base.py
def __init__(self, client: OWUIClientBase):
    self._client = client

Functions

get_version
get_version() -> Dict[str, Any]

Get the application version and deployment ID.

Returns:

Type Description
Dict[str, Any]

A dictionary containing:

Dict[str, Any]
  • version: The current application version.
Dict[str, Any]
  • deployment_id: The deployment ID.
Source code in src/owui_client/routers/root.py
async def get_version(self) -> Dict[str, Any]:
    """
    Get the application version and deployment ID.

    Returns:
        A dictionary containing:
        - `version`: The current application version.
        - `deployment_id`: The deployment ID.
    """
    return await self._request("GET", "/version", model=dict)
get_changelog
get_changelog() -> Dict[str, Any]

Get the application changelog.

Returns:

Type Description
Dict[str, Any]

A dictionary containing the latest 5 changelog entries.

Source code in src/owui_client/routers/root.py
async def get_changelog(self) -> Dict[str, Any]:
    """
    Get the application changelog.

    Returns:
        A dictionary containing the latest 5 changelog entries.
    """
    return await self._request("GET", "/changelog", model=dict)
health
health() -> Dict[str, bool]

Check the health of the application.

Returns:

Type Description
Dict[str, bool]

A dictionary with the health status: {"status": True}.

Source code in src/owui_client/routers/root.py
async def health(self) -> Dict[str, bool]:
    """
    Check the health of the application.

    Returns:
        A dictionary with the health status: `{"status": True}`.
    """
    # /health is at the root, not under /api
    # Use relative path "../health" to go up from /api base
    return await self._request("GET", "../health", model=dict)
get_config
get_config() -> Dict[str, Any]

Get the application configuration.

Returns:

Type Description
Dict[str, Any]

A dictionary containing configuration details such as:

Dict[str, Any]
  • status: Application status.
Dict[str, Any]
  • name: WebUI name.
Dict[str, Any]
  • version: Application version.
Dict[str, Any]
  • oauth: OAuth providers configuration.
Dict[str, Any]
  • features: Enabled features (auth, signup, etc.).
Dict[str, Any]
  • default_models: Default models configuration (if authenticated).
Source code in src/owui_client/routers/root.py
async def get_config(self) -> Dict[str, Any]:
    """
    Get the application configuration.

    Returns:
        A dictionary containing configuration details such as:
        - `status`: Application status.
        - `name`: WebUI name.
        - `version`: Application version.
        - `oauth`: OAuth providers configuration.
        - `features`: Enabled features (auth, signup, etc.).
        - `default_models`: Default models configuration (if authenticated).
    """
    return await self._request("GET", "/config", model=dict)
get_webhook_url
get_webhook_url() -> Dict[str, str]

Get the configured webhook URL.

Returns:

Type Description
Dict[str, str]

A dictionary containing the url.

Source code in src/owui_client/routers/root.py
async def get_webhook_url(self) -> Dict[str, str]:
    """
    Get the configured webhook URL.

    Returns:
        A dictionary containing the `url`.
    """
    return await self._request("GET", "/webhook", model=dict)
update_webhook_url
update_webhook_url(url: str) -> Dict[str, str]

Update the webhook URL.

Parameters:

Name Type Description Default
url str

The new webhook URL.

required

Returns:

Type Description
Dict[str, str]

A dictionary containing the updated url.

Source code in src/owui_client/routers/root.py
async def update_webhook_url(self, url: str) -> Dict[str, str]:
    """
    Update the webhook URL.

    Args:
        url: The new webhook URL.

    Returns:
        A dictionary containing the updated `url`.
    """
    return await self._request(
        "POST",
        "/webhook",
        model=dict,
        json=UrlForm(url=url).model_dump(),
    )
get_models
get_models() -> Dict[str, Any]

Get available models (unified list).

Returns:

Type Description
Dict[str, Any]

A dictionary with a data key containing a list of available models.

Source code in src/owui_client/routers/root.py
async def get_models(self) -> Dict[str, Any]:
    """
    Get available models (unified list).

    Returns:
        A dictionary with a `data` key containing a list of available models.
    """
    return await self._request("GET", "/models", model=dict)
chat_completions
chat_completions(
    form_data: Dict[str, Any],
) -> Dict[str, Any]

Generate chat completions (unified endpoint).

Parameters:

Name Type Description Default
form_data Dict[str, Any]

A dictionary containing the chat completion parameters. This typically includes model, messages, and optional fields like chat_id, stream, files, features, etc.

required

Returns:

Type Description
Dict[str, Any]

A dictionary containing the chat completion response.

Source code in src/owui_client/routers/root.py
async def chat_completions(self, form_data: Dict[str, Any]) -> Dict[str, Any]:
    """
    Generate chat completions (unified endpoint).

    Args:
        form_data: A dictionary containing the chat completion parameters.
                   This typically includes `model`, `messages`, and optional fields
                   like `chat_id`, `stream`, `files`, `features`, etc.

    Returns:
        A dictionary containing the chat completion response.
    """
    return await self._request(
        "POST", "/chat/completions", model=dict, json=form_data
    )
embeddings
embeddings(form_data: Dict[str, Any]) -> Dict[str, Any]

Generate embeddings (unified endpoint).

Parameters:

Name Type Description Default
form_data Dict[str, Any]

A dictionary containing the embeddings parameters. This typically includes model and input.

required

Returns:

Type Description
Dict[str, Any]

A dictionary containing the embeddings response.

Source code in src/owui_client/routers/root.py
async def embeddings(self, form_data: Dict[str, Any]) -> Dict[str, Any]:
    """
    Generate embeddings (unified endpoint).

    Args:
        form_data: A dictionary containing the embeddings parameters.
                   This typically includes `model` and `input`.

    Returns:
        A dictionary containing the embeddings response.
    """
    return await self._request("POST", "/embeddings", model=dict, json=form_data)