Wiki / Speech Input

Speech Input (Speech-to-Text)

Apis AI can turn your voice into text and send it to the chat. You can dictate a single message, or switch a chat into voice chat mode and talk freely with the AI: as soon as you stop speaking, your sentence is transcribed and sent automatically.

Disabled by default Speech input is off by default. Enable it under Settings → System → Speech Input and configure a backend before the microphone and voice chat buttons appear in the chat.

Choosing a Backend

Apis AI supports two speech-to-text backends:

BackendRunsCostNotes
Whisper.cpp (local) On your machine Free Private, works offline. Needs whisper.cpp and a model file.
OpenAI-compatible (remote) In the cloud Per use No installation. Needs an API key (e.g. OpenAI or Groq).

Local Setup (whisper.cpp)

The local backend talks to whisper-server from the whisper.cpp project. Apis AI can start and stop that server for you.

  1. Install whisper.cpp. Build it and make sure the whisper-server binary is available:
    git clone https://github.com/ggml-org/whisper.cpp
    cd whisper.cpp
    cmake -B build
    cmake --build build --config Release
    The binary is then at build/bin/whisper-server.
  2. Download a model. A good default is medium; use base or small on slower machines:
    ./models/download-ggml-model.sh medium
  3. Configure the paths in Apis AI. Open Settings → System → Speech Input, choose Whisper.cpp (local) and enter:
    • whisper-server path – full path to the binary, e.g. /home/you/whisper.cpp/build/bin/whisper-server (empty = search in PATH).
    • Whisper model path – full path to the model file, e.g. /home/you/whisper.cpp/models/ggml-medium.bin.
    • Server URL – http://127.0.0.1:8081 (default).
  4. Start the server. Either enable Start Whisper server automatically – Apis AI then launches whisper-server itself at every app start and again before transcribing, if it is no longer reachable – or click Start local server once. Apis AI starts whisper-server on the configured port and writes its output to ~/.local/state/apis-ai/whisper.log. A server you started yourself in a terminal is detected and reused instead of being started a second time.
  5. Test it. Click Test connection. A green Connection successful means you are ready.
Port conflict whisper-server defaults to port 8080, which is often already used by a local Llama server. Apis AI therefore defaults to 8081. Keep the Server URL and the local server port in sync.
GPU acceleration (optional) whisper.cpp can run on your GPU. For NVIDIA cards, build with Vulkan (install glslc first):
cmake -B build -DGGML_VULKAN=ON
cmake --build build --config Release
A larger model then stays fast, which improves accuracy noticeably.

Remote Setup (OpenAI-compatible)

Any service that exposes the OpenAI /audio/transcriptions endpoint works. Examples:

ServiceBase URLModel
OpenAIhttps://api.openai.com/v1whisper-1
Groqhttps://api.groq.com/openai/v1whisper-large-v3
  1. In Settings → System → Speech Input choose OpenAI-compatible (remote).
  2. Enter the Server URL including /v1.
  3. Paste your API key and the model name.
  4. Click Test connection.

Settings Reference

SettingMeaning
Enable speech inputShows the microphone (dictation) and voice chat buttons in the chat.
BackendWhisper.cpp (local) or OpenAI-compatible (remote).
Server URLAddress of the speech-to-text endpoint.
API keyOnly for remote services.
ModelOnly for remote services.
LanguageISO code (e.g. de, en). Empty = auto-detect.
Speech threshold (VAD)How loud a segment must be to count as speech in voice chat mode.
Silence until sendingHow long it must be quiet before a sentence is sent in voice chat mode.
whisper-server pathPath to the local whisper-server binary (empty = search in PATH). Local backend only.
Whisper model pathPath to the GGML/GGUF model file the local server loads. Local backend only.
Local server portPort Apis AI uses when it starts the local server itself.
Start Whisper server automaticallyLocal backend only. Apis AI starts whisper-server itself at app start and again before transcribing if it is no longer reachable, and stops the server it started when the option is switched off or the app closes. A server you started yourself is reused and never stopped. Requires the Whisper server path and Whisper model path.

Dictation

Click the microphone button:

Voice Chat Mode

Click the voice chat button (speaker icon) next to the microphone. Apis AI now listens continuously:

Background noise If the app reacts to noise, raise the Speech threshold (VAD). To wait longer before a sentence is sent, raise silence until sending.

Troubleshooting

The microphone button is missing

Speech input is disabled. Enable Settings → System → Speech Input; the microphone and voice chat buttons then appear in the chat input.

"Connection failed" when testing

No microphone / no recording

On Linux, check that the app can access your sound server (PipeWire/PulseAudio/ALSA) and that an input device exists:

arecord -l

If arecord lists no capture device, the problem is outside Apis AI.

Nothing is recognized

The local server does not start

Make sure the path to whisper-server is correct and executable, and that the model file exists. The log at ~/.local/state/apis-ai/whisper.log contains the exact error. With Start Whisper server automatically enabled Apis AI tries again before every transcription and shows the result in the speech settings; if it keeps failing, check the paths above or start the server manually in a terminal.