Skip to content

configs

Classes

ConfigsClient

ConfigsClient(client: OWUIClientBase)

Bases: ResourceBase

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

Functions

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

Export the current system configuration.

This returns the full configuration dictionary including all settings, models, and other system-wide configurations.

Returns:

Type Description
Dict[str, Any]

The configuration dictionary.

Source code in src/owui_client/routers/configs.py
async def export_config(self) -> Dict[str, Any]:
    """
    Export the current system configuration.

    This returns the full configuration dictionary including all settings,
    models, and other system-wide configurations.

    Returns:
        The configuration dictionary.
    """
    return await self._request(
        "GET",
        "/v1/configs/export",
        model=dict,
    )
import_config
import_config(config: Dict[str, Any]) -> Dict[str, Any]

Import a system configuration.

Parameters:

Name Type Description Default
config Dict[str, Any]

The configuration dictionary to import.

required

Returns:

Type Description
Dict[str, Any]

The updated configuration dictionary.

Source code in src/owui_client/routers/configs.py
async def import_config(self, config: Dict[str, Any]) -> Dict[str, Any]:
    """
    Import a system configuration.

    Args:
        config: The configuration dictionary to import.

    Returns:
        The updated configuration dictionary.
    """
    return await self._request(
        "POST",
        "/v1/configs/import",
        model=dict,
        json=ImportConfigForm(config=config).model_dump(),
    )
get_connections_config
get_connections_config() -> ConnectionsConfigForm

Get the current connections configuration.

Returns:

Type Description
ConnectionsConfigForm

ConnectionsConfigForm with current settings for direct connections and model caching.

Source code in src/owui_client/routers/configs.py
async def get_connections_config(self) -> ConnectionsConfigForm:
    """
    Get the current connections configuration.

    Returns:
        `ConnectionsConfigForm` with current settings for direct connections and model caching.
    """
    return await self._request(
        "GET",
        "/v1/configs/connections",
        model=ConnectionsConfigForm,
    )
set_connections_config
set_connections_config(
    form_data: ConnectionsConfigForm,
) -> ConnectionsConfigForm

Set the connections configuration.

Parameters:

Name Type Description Default
form_data ConnectionsConfigForm

ConnectionsConfigForm with new settings.

required

Returns:

Type Description
ConnectionsConfigForm

Updated ConnectionsConfigForm.

Source code in src/owui_client/routers/configs.py
async def set_connections_config(
    self, form_data: ConnectionsConfigForm
) -> ConnectionsConfigForm:
    """
    Set the connections configuration.

    Args:
        form_data: `ConnectionsConfigForm` with new settings.

    Returns:
        Updated `ConnectionsConfigForm`.
    """
    return await self._request(
        "POST",
        "/v1/configs/connections",
        model=ConnectionsConfigForm,
        json=form_data.model_dump(),
    )
register_oauth_client
register_oauth_client(
    form_data: OAuthClientRegistrationForm,
    type: Optional[str] = None,
) -> Dict[str, Any]

Register an OAuth client.

Used for services like MCP Tool Servers that require OAuth 2.1 authentication/registration.

Parameters:

Name Type Description Default
form_data OAuthClientRegistrationForm

Registration details (url, client_id, client_name).

required
type Optional[str]

Optional type prefix for the client_id (e.g. 'mcp').

None

Returns:

Type Description
Dict[str, Any]

Dictionary containing status and encrypted oauth_client_info.

Source code in src/owui_client/routers/configs.py
async def register_oauth_client(
    self, form_data: OAuthClientRegistrationForm, type: Optional[str] = None
) -> Dict[str, Any]:
    """
    Register an OAuth client.

    Used for services like MCP Tool Servers that require OAuth 2.1 authentication/registration.

    Args:
        form_data: Registration details (url, client_id, client_name).
        type: Optional type prefix for the client_id (e.g. 'mcp').

    Returns:
        Dictionary containing status and encrypted oauth_client_info.
    """
    params = {}
    if type:
        params["type"] = type

    return await self._request(
        "POST",
        "/v1/configs/oauth/clients/register",
        model=dict,
        json=form_data.model_dump(),
        params=params,
    )
get_tool_servers_config
get_tool_servers_config() -> ToolServersConfigForm

Get the current tool servers configuration.

Returns:

Type Description
ToolServersConfigForm

ToolServersConfigForm with current settings.

Source code in src/owui_client/routers/configs.py
async def get_tool_servers_config(self) -> ToolServersConfigForm:
    """
    Get the current tool servers configuration.

    Returns:
        `ToolServersConfigForm` with current settings.
    """
    return await self._request(
        "GET",
        "/v1/configs/tool_servers",
        model=ToolServersConfigForm,
    )
set_tool_servers_config
set_tool_servers_config(
    form_data: ToolServersConfigForm,
) -> ToolServersConfigForm

Set the tool servers configuration.

Parameters:

Name Type Description Default
form_data ToolServersConfigForm

ToolServersConfigForm with new settings.

required

Returns:

Type Description
ToolServersConfigForm

Updated ToolServersConfigForm.

Source code in src/owui_client/routers/configs.py
async def set_tool_servers_config(
    self, form_data: ToolServersConfigForm
) -> ToolServersConfigForm:
    """
    Set the tool servers configuration.

    Args:
        form_data: `ToolServersConfigForm` with new settings.

    Returns:
        Updated `ToolServersConfigForm`.
    """
    return await self._request(
        "POST",
        "/v1/configs/tool_servers",
        model=ToolServersConfigForm,
        json=form_data.model_dump(),
    )
verify_tool_servers_config
verify_tool_servers_config(
    form_data: ToolServerConnection,
) -> Dict[str, Any]

Verify a tool server connection.

This endpoint attempts to connect to the tool server using the provided configuration and returns the server specifications if successful.

Parameters:

Name Type Description Default
form_data ToolServerConnection

ToolServerConnection details to verify.

required

Returns:

Type Description
Dict[str, Any]

Response dictionary containing verification status and server specs (if successful).

Source code in src/owui_client/routers/configs.py
async def verify_tool_servers_config(
    self, form_data: ToolServerConnection
) -> Dict[str, Any]:
    """
    Verify a tool server connection.

    This endpoint attempts to connect to the tool server using the provided
    configuration and returns the server specifications if successful.

    Args:
        form_data: `ToolServerConnection` details to verify.

    Returns:
        Response dictionary containing verification status and server specs (if successful).
    """
    return await self._request(
        "POST",
        "/v1/configs/tool_servers/verify",
        model=dict,
        json=form_data.model_dump(),
    )
get_code_execution_config
get_code_execution_config() -> CodeInterpreterConfigForm

Get the current code execution configuration.

Returns:

Type Description
CodeInterpreterConfigForm

CodeInterpreterConfigForm with current settings.

Source code in src/owui_client/routers/configs.py
async def get_code_execution_config(self) -> CodeInterpreterConfigForm:
    """
    Get the current code execution configuration.

    Returns:
        `CodeInterpreterConfigForm` with current settings.
    """
    return await self._request(
        "GET",
        "/v1/configs/code_execution",
        model=CodeInterpreterConfigForm,
    )
set_code_execution_config
set_code_execution_config(
    form_data: CodeInterpreterConfigForm,
) -> CodeInterpreterConfigForm

Set the code execution configuration.

Parameters:

Name Type Description Default
form_data CodeInterpreterConfigForm

CodeInterpreterConfigForm with new settings.

required

Returns:

Type Description
CodeInterpreterConfigForm

Updated CodeInterpreterConfigForm.

Source code in src/owui_client/routers/configs.py
async def set_code_execution_config(
    self, form_data: CodeInterpreterConfigForm
) -> CodeInterpreterConfigForm:
    """
    Set the code execution configuration.

    Args:
        form_data: `CodeInterpreterConfigForm` with new settings.

    Returns:
        Updated `CodeInterpreterConfigForm`.
    """
    return await self._request(
        "POST",
        "/v1/configs/code_execution",
        model=CodeInterpreterConfigForm,
        json=form_data.model_dump(),
    )
get_models_config
get_models_config() -> ModelsConfigForm

Get the current models configuration.

Returns:

Type Description
ModelsConfigForm

ModelsConfigForm with current settings.

Source code in src/owui_client/routers/configs.py
async def get_models_config(self) -> ModelsConfigForm:
    """
    Get the current models configuration.

    Returns:
        `ModelsConfigForm` with current settings.
    """
    return await self._request(
        "GET",
        "/v1/configs/models",
        model=ModelsConfigForm,
    )
set_models_config
set_models_config(
    form_data: ModelsConfigForm,
) -> ModelsConfigForm

Set the models configuration.

Parameters:

Name Type Description Default
form_data ModelsConfigForm

ModelsConfigForm with new settings.

required

Returns:

Type Description
ModelsConfigForm

Updated ModelsConfigForm.

Source code in src/owui_client/routers/configs.py
async def set_models_config(self, form_data: ModelsConfigForm) -> ModelsConfigForm:
    """
    Set the models configuration.

    Args:
        form_data: `ModelsConfigForm` with new settings.

    Returns:
        Updated `ModelsConfigForm`.
    """
    return await self._request(
        "POST",
        "/v1/configs/models",
        model=ModelsConfigForm,
        json=form_data.model_dump(),
    )
set_default_suggestions
set_default_suggestions(
    form_data: SetDefaultSuggestionsForm,
) -> List[PromptSuggestion]

Set default prompt suggestions.

Parameters:

Name Type Description Default
form_data SetDefaultSuggestionsForm

SetDefaultSuggestionsForm containing the suggestions list.

required

Returns:

Type Description
List[PromptSuggestion]

Updated list of PromptSuggestion.

Source code in src/owui_client/routers/configs.py
async def set_default_suggestions(
    self, form_data: SetDefaultSuggestionsForm
) -> List[PromptSuggestion]:
    """
    Set default prompt suggestions.

    Args:
        form_data: `SetDefaultSuggestionsForm` containing the suggestions list.

    Returns:
        Updated list of `PromptSuggestion`.
    """
    return await self._request(
        "POST",
        "/v1/configs/suggestions",
        model=List[PromptSuggestion],
        json=form_data.model_dump(),
    )
get_banners
get_banners() -> List[BannerModel]

Get the current banners.

Returns:

Type Description
List[BannerModel]

List of BannerModel.

Source code in src/owui_client/routers/configs.py
async def get_banners(self) -> List[BannerModel]:
    """
    Get the current banners.

    Returns:
        List of `BannerModel`.
    """
    return await self._request(
        "GET",
        "/v1/configs/banners",
        model=List[BannerModel],
    )
set_banners
set_banners(form_data: SetBannersForm) -> List[BannerModel]

Set the banners.

Parameters:

Name Type Description Default
form_data SetBannersForm

SetBannersForm containing the banners list.

required

Returns:

Type Description
List[BannerModel]

Updated list of BannerModel.

Source code in src/owui_client/routers/configs.py
async def set_banners(self, form_data: SetBannersForm) -> List[BannerModel]:
    """
    Set the banners.

    Args:
        form_data: `SetBannersForm` containing the banners list.

    Returns:
        Updated list of `BannerModel`.
    """
    return await self._request(
        "POST",
        "/v1/configs/banners",
        model=List[BannerModel],
        json=form_data.model_dump(),
    )
get_terminal_servers
get_terminal_servers() -> TerminalServersConfigForm

Get the current terminal servers configuration.

Returns:

Type Description
TerminalServersConfigForm

TerminalServersConfigForm with current settings.

Source code in src/owui_client/routers/configs.py
async def get_terminal_servers(self) -> TerminalServersConfigForm:
    """
    Get the current terminal servers configuration.

    Returns:
        `TerminalServersConfigForm` with current settings.
    """
    return await self._request(
        "GET",
        "/v1/configs/terminal_servers",
        model=TerminalServersConfigForm,
    )
set_terminal_servers
set_terminal_servers(
    form_data: TerminalServersConfigForm,
) -> TerminalServersConfigForm

Set the terminal servers configuration.

Parameters:

Name Type Description Default
form_data TerminalServersConfigForm

TerminalServersConfigForm with new settings.

required

Returns:

Type Description
TerminalServersConfigForm

Updated TerminalServersConfigForm.

Source code in src/owui_client/routers/configs.py
async def set_terminal_servers(
    self, form_data: TerminalServersConfigForm
) -> TerminalServersConfigForm:
    """
    Set the terminal servers configuration.

    Args:
        form_data: `TerminalServersConfigForm` with new settings.

    Returns:
        Updated `TerminalServersConfigForm`.
    """
    return await self._request(
        "POST",
        "/v1/configs/terminal_servers",
        model=TerminalServersConfigForm,
        json=form_data.model_dump(),
    )
verify_terminal_server
verify_terminal_server(
    form_data: TerminalServerConnection,
) -> Dict[str, Any]

Verify a terminal server connection by detecting its type.

Tries the orchestrator policies endpoint first, then falls back to the plain terminal config endpoint. Returns the detected server type.

Parameters:

Name Type Description Default
form_data TerminalServerConnection

TerminalServerConnection with at least url set.

required

Returns:

Type Description
Dict[str, Any]

Dictionary with status (bool) and type ('orchestrator' or 'terminal').

Source code in src/owui_client/routers/configs.py
async def verify_terminal_server(
    self, form_data: TerminalServerConnection
) -> Dict[str, Any]:
    """Verify a terminal server connection by detecting its type.

    Tries the orchestrator policies endpoint first, then falls back to the
    plain terminal config endpoint. Returns the detected server type.

    Args:
        form_data: `TerminalServerConnection` with at least `url` set.

    Returns:
        Dictionary with `status` (bool) and `type` ('orchestrator' or 'terminal').
    """
    return await self._request(
        "POST",
        "/v1/configs/terminal_servers/verify",
        model=dict,
        json=form_data.model_dump(),
    )
put_terminal_server_policy
put_terminal_server_policy(
    form_data: TerminalServerPolicyForm,
) -> Dict[str, Any]

Push a policy to an orchestrator terminal server.

Proxies a PUT request to the orchestrator's /api/v1/policies/{policy_id} endpoint.

Parameters:

Name Type Description Default
form_data TerminalServerPolicyForm

TerminalServerPolicyForm with the orchestrator URL, credentials, policy ID, and policy data.

required

Returns:

Type Description
Dict[str, Any]

The policy object returned by the orchestrator.

Source code in src/owui_client/routers/configs.py
async def put_terminal_server_policy(
    self, form_data: TerminalServerPolicyForm
) -> Dict[str, Any]:
    """Push a policy to an orchestrator terminal server.

    Proxies a PUT request to the orchestrator's /api/v1/policies/{policy_id}
    endpoint.

    Args:
        form_data: `TerminalServerPolicyForm` with the orchestrator URL,
            credentials, policy ID, and policy data.

    Returns:
        The policy object returned by the orchestrator.
    """
    return await self._request(
        "POST",
        "/v1/configs/terminal_servers/policy",
        model=dict,
        json=form_data.model_dump(),
    )
get_models_defaults
get_models_defaults() -> Dict[str, Any]

Get the default model metadata.

Returns only the DEFAULT_MODEL_METADATA setting, unlike get_models_config which returns the full models configuration. Available to all verified users.

Returns:

Type Description
Dict[str, Any]

Dictionary with DEFAULT_MODEL_METADATA key.

Source code in src/owui_client/routers/configs.py
async def get_models_defaults(self) -> Dict[str, Any]:
    """Get the default model metadata.

    Returns only the DEFAULT_MODEL_METADATA setting, unlike `get_models_config`
    which returns the full models configuration. Available to all verified users.

    Returns:
        Dictionary with `DEFAULT_MODEL_METADATA` key.
    """
    return await self._request(
        "GET",
        "/v1/configs/models/defaults",
        model=dict,
    )
get_config_namespace
get_config_namespace(namespace: str) -> Dict[str, Any]

Get all configuration key/value pairs under a dotted namespace.

Returns every config storage key that starts with {namespace}. (e.g. namespace "ui" returns ui.prompt_suggestions, ui.banners, etc.) along with its current value. Values come from both persisted DB overrides and built-in defaults.

Parameters:

Name Type Description Default
namespace str

Top-level config namespace (e.g. "ui", "models", "code_execution", "oauth", "terminal_server").

required

Returns:

Type Description
Dict[str, Any]

Dictionary mapping full storage keys ({namespace}.{rest}) to

Dict[str, Any]

their values.

Source code in src/owui_client/routers/configs.py
async def get_config_namespace(self, namespace: str) -> Dict[str, Any]:
    """Get all configuration key/value pairs under a dotted namespace.

    Returns every config storage key that starts with ``{namespace}.``
    (e.g. namespace ``"ui"`` returns ``ui.prompt_suggestions``,
    ``ui.banners``, etc.) along with its current value. Values come from
    both persisted DB overrides and built-in defaults.

    Args:
        namespace: Top-level config namespace (e.g. ``"ui"``, ``"models"``,
            ``"code_execution"``, ``"oauth"``, ``"terminal_server"``).

    Returns:
        Dictionary mapping full storage keys (``{namespace}.{rest}``) to
        their values.
    """
    return await self._request(
        "GET",
        f"/v1/configs/namespace/{namespace}",
        model=dict,
    )
put_terminal_server_lifecycle
put_terminal_server_lifecycle(
    form_data: TerminalServerLifecycleForm,
) -> Dict[str, Any]

Push a session-lifecycle policy update to an orchestrator terminal server.

Proxies a PUT to the orchestrator's /api/v1/policies/{policy_id}/lifecycle endpoint with the supplied lifecycle_data. Used to configure how running terminal sessions are managed (e.g. idle timeouts, max lifetime) for a policy.

Parameters:

Name Type Description Default
form_data TerminalServerLifecycleForm

TerminalServerLifecycleForm carrying the orchestrator URL, credentials, target policy ID, and the opaque lifecycle body.

required

Returns:

Type Description
Dict[str, Any]

The JSON response returned by the orchestrator (shape defined by the

Dict[str, Any]

orchestrator's API).

Raises:

Type Description
HTTPStatusError

400 if the URL is empty or the orchestrator is unreachable / returns an error.

Source code in src/owui_client/routers/configs.py
async def put_terminal_server_lifecycle(
    self, form_data: TerminalServerLifecycleForm
) -> Dict[str, Any]:
    """Push a session-lifecycle policy update to an orchestrator terminal server.

    Proxies a PUT to the orchestrator's
    ``/api/v1/policies/{policy_id}/lifecycle`` endpoint with the supplied
    ``lifecycle_data``. Used to configure how running terminal sessions are
    managed (e.g. idle timeouts, max lifetime) for a policy.

    Args:
        form_data: `TerminalServerLifecycleForm` carrying the orchestrator
            URL, credentials, target policy ID, and the opaque lifecycle body.

    Returns:
        The JSON response returned by the orchestrator (shape defined by the
        orchestrator's API).

    Raises:
        HTTPStatusError: 400 if the URL is empty or the orchestrator is
            unreachable / returns an error.
    """
    return await self._request(
        "POST",
        "/v1/configs/terminal_servers/lifecycle",
        model=dict,
        json=form_data.model_dump(),
    )
refresh_terminal_server_terminals
refresh_terminal_server_terminals(
    form_data: TerminalServerRefreshForm,
) -> Dict[str, Any]

Refresh or reset running terminal sessions on an orchestrator terminal server.

Proxies a POST to the orchestrator's /api/v1/terminals/refresh endpoint. Optionally restricts the operation to idle sessions, a specific user, or a specific policy, and can reset sessions instead of just refreshing them.

Parameters:

Name Type Description Default
form_data TerminalServerRefreshForm

TerminalServerRefreshForm carrying the orchestrator URL, credentials, and targeting options (only_idle, reset, user_id, policy_id).

required

Returns:

Type Description
Dict[str, Any]

The JSON response returned by the orchestrator (shape defined by the

Dict[str, Any]

orchestrator's API).

Raises:

Type Description
HTTPStatusError

400 if the URL is empty or the orchestrator is unreachable / returns an error.

Source code in src/owui_client/routers/configs.py
async def refresh_terminal_server_terminals(
    self, form_data: TerminalServerRefreshForm
) -> Dict[str, Any]:
    """Refresh or reset running terminal sessions on an orchestrator terminal server.

    Proxies a POST to the orchestrator's ``/api/v1/terminals/refresh``
    endpoint. Optionally restricts the operation to idle sessions, a
    specific user, or a specific policy, and can reset sessions instead of
    just refreshing them.

    Args:
        form_data: `TerminalServerRefreshForm` carrying the orchestrator URL,
            credentials, and targeting options (``only_idle``, ``reset``,
            ``user_id``, ``policy_id``).

    Returns:
        The JSON response returned by the orchestrator (shape defined by the
        orchestrator's API).

    Raises:
        HTTPStatusError: 400 if the URL is empty or the orchestrator is
            unreachable / returns an error.
    """
    return await self._request(
        "POST",
        "/v1/configs/terminal_servers/refresh",
        model=dict,
        json=form_data.model_dump(),
    )