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(),
    )