Soniox
Docs

Get started

Learn how to use Soniox Speech-to-Text API.

Learn how to use Soniox API in minutes

Soniox Speech-to-Text is a universal speech AI that lets you transcribe and translate speech in 60+ languages — from recorded files (async) or live audio streams (real-time). Languages can be freely mixed within the same conversation, and Soniox will handle them seamlessly with high accuracy and low latency.

In just a few steps, you can run your first transcription or translation. The examples also cover advanced features such as speaker diarization, real-time translation, context customization, and automatic language identification — all through the same simple API.

Get API key

Create a free Soniox account and log in to the Console to get your API key.

API keys are created per project. In the Console, go to My First Project and click API Keys to generate one.

Export it as an environment variable (replace with your key):

Terminal
export SONIOX_API_KEY=<YOUR_API_KEY>

Get examples

Clone the official examples repo:

Terminal
git clone https://github.com/soniox/soniox_examples
cd soniox_examples/speech_to_text

Run examples

Choose your language and run the ready-to-use examples below.

Example
What it doesOutput
Real-time
transcription
Transcribes speech in any language in
real-time.
Transcript streamed to console.
Real-time
one-way translation
Transcribes speech in any language and translates it into Spanish in real-time.Transcript + Spanish translation streamed together.
Real-time
two-way translation
Transcribes speech in any language and translates English ↔ Spanish in real-time. Spanish → English, English → Spanish.Transcript + bidirectional translations streamed together.
Transcribe file from URLTranscribes an audio file directly from a public URL.Transcript printed to console.
Transcribe local fileUploads and transcribes an audio file from your computer.Transcript printed to console.
Terminal
cd python

# Set up environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Real-time examples
python soniox_realtime.py --audio_path ../assets/coffee_shop.mp3
python soniox_realtime.py --audio_path ../assets/coffee_shop.mp3 --translation one_way
python soniox_realtime.py --audio_path ../assets/two_way_translation.mp3 --translation two_way

# Async examples
python soniox_async.py --audio_url "https://soniox.com/media/examples/coffee_shop.mp3"
python soniox_async.py --audio_path ../assets/coffee_shop.mp3
Terminal
cd nodejs

# Install dependencies
npm install

# Real-time examples
node soniox_realtime.js --audio_path ../assets/coffee_shop.mp3
node soniox_realtime.js --audio_path ../assets/coffee_shop.mp3 --translation one_way
node soniox_realtime.js --audio_path ../assets/two_way_translation.mp3 --translation two_way

# Async examples
node soniox_async.js --audio_url "https://soniox.com/media/examples/coffee_shop.mp3"
node soniox_async.js --audio_path ../assets/coffee_shop.mp3

Next steps

  • Dive into the Real-time API → Run live transcription, translations, and endpoint detection.
  • Explore the Async API → Transcribe recorded files at scale and integrate with webhooks.