audio
Classes
AudioClient
AudioClient(client: OWUIClientBase)
Bases: ResourceBase
Client for Audio endpoints (TTS and STT).
- Code Reference client Classes OpenWebUI Attributes audio
Source code in src/owui_client/client_base.py
Functions
get_config
Get the current audio configuration.
This includes settings for both Text-to-Speech (TTS) and Speech-to-Text (STT) engines, such as API keys, base URLs, models, and voice settings.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The current configuration, with keys 'tts' and 'stt'. |
Source code in src/owui_client/routers/audio.py
update_config
update_config(form_data: AudioConfigUpdateForm) -> dict
Update the audio configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
AudioConfigUpdateForm
|
The configuration data to update. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated configuration. |
Source code in src/owui_client/routers/audio.py
transcribe
Transcribe an audio file to text.
Uses the configured STT engine (e.g. Whisper, OpenAI, Deepgram, Azure, Mistral). Automatically handles audio conversion and chunking if necessary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | Path
|
Path to the audio file to transcribe. |
required |
language
|
Optional[str]
|
Optional language code (e.g. "en") to guide transcription. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the transcription result, typically |
Source code in src/owui_client/routers/audio.py
speech
speech(
input_text: str,
model: Optional[str] = None,
voice: Optional[str] = None,
save_path: Optional[str | Path] = None,
) -> bytes
Generate speech from text (Text-to-Speech).
Uses the configured TTS engine (e.g. OpenAI, ElevenLabs, Azure, Transformers).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_text
|
str
|
The text to convert to speech. |
required |
model
|
Optional[str]
|
Optional model identifier to override the default configuration. |
None
|
voice
|
Optional[str]
|
Optional voice identifier to override the default configuration. |
None
|
save_path
|
Optional[str | Path]
|
Optional file path to save the generated audio to. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
The generated audio content in bytes. |
Source code in src/owui_client/routers/audio.py
get_models
Get available audio models for the configured TTS engine.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing a list of models, e.g. |
Source code in src/owui_client/routers/audio.py
get_voices
Get available voices for the configured TTS engine.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing a list of voices, e.g. |