Quickstart
1. Create Soniox Account
Create a free Soniox Account to obtain an API key. The API key gives you free access to Soniox API services. You can find your API key under API Keys tab for a given project in Soniox Console.
Soniox Account is free of charge and does not require credit card information. You get 300 minutes of free speech recognition AI services through Soniox API. If you require additional free usage, contact us, and we will assign you additional free minutes.
2. Download Examples
Clone our soniox_examples GitHub repository with all the code examples and test audio files. We will refer to these examples and audio files throughout our how-to guides.
git clone https://github.com/soniox/soniox_examples.git
3. Install Client Library
Choose any of our available client libraries to ease the integration of Soniox API into your application.
Requirements: Python 3.7 or higher.
Create and enter venv
python3 -m venv venv
source venv/bin/activate
Install packages
python3 -m pip install -U pip
python3 -m pip install -U setuptools wheel
python3 -m pip install -U soniox
4. Authenticate
To authenticate your requests, you have to specify the API key. You can find your API key under API Keys tab for a given project in Soniox Console.
You can set the API key via SONIOX_API_KEY
bash variable, which will be then automatically used by the client library.
export SONIOX_API_KEY=<YOUR_API_KEY>
Another way to set your API key is via set_api_key()
function.
from soniox.speech_service import Client, set_api_key
set_api_key("<YOUR-API-KEY>")
# When you create Client object, the set API key will be automatically used.
5. Transcribe
This example will transcribe a short audio file and print out the recognized words: transcribe_file_short.py
Run:
cd soniox_examples/python
python3 transcribe_file_short.py
Output
He 180 60
was 420 60
two 660 60
...
Requirements: Node.js v14 or higher.
Install packages
cd soniox_examples/node
npm install
4. Authenticate
To authenticate your requests, you have to specify the API key. You can find your API key under API Keys tab for a given project in Soniox Console.
You can set the API key via SONIOX_API_KEY
bash variable, which will be then automatically used by the client library.
export SONIOX_API_KEY=<YOUR_API_KEY>
Another way to set your API key is in the constructor of SpeechClient
object.
const { SpeechClient } = require("@soniox/soniox-node");
const speechClient = new SpeechClient({ api_key: "<YOUR-API-KEY>" });
5. Transcribe
This example will transcribe a short audio file and print out the recognized words: transcribe_file_short.js
Run
node transcribe_file_short.js
Output
He 180 60
was 420 60
two 660 60
...
Requirements: .NET 6 or newer.
4. Authenticate
To authenticate your requests, you have to specify the API key. You can find your API key under API Keys tab for a given project in Soniox Console.
You can set the API key via SONIOX_API_KEY
bash variable, which will be then automatically used by the client library.
export SONIOX_API_KEY=<YOUR_API_KEY>
Another way to set your API key is in the constructor of SpeechClient
object.
using var client = new SpeechClient(apiKey: "<YOUR-API-KEY>");
5. Transcribe
This example will transcribe a short audio file and print out the recognized words: TranscribeFileShort.cs
Run
cd soniox_examples/csharp/TranscribeFileShort
dotnet run
Output
He 180 60
was 420 60
two 660 60
...
6. Use in Your Project
The Soniox C# client library is published on NuGet: Soniox.Client.
To use the library in your project, add package references to the .csproj
file like in the examples:
<PackageReference Include="Google.Protobuf" Version="3.22.1" />
<PackageReference Include="Soniox.Client" Version="1.0.1" />
We provide a Javascript client library that enables you to integrate with Soniox API service directly from your web application. See Web Library section for more information.
We provide a WebSocket-based API for Soniox Speech Service. Please refer to the WebSocket section for more information.
We provide a gRPC-based API for Soniox Speech Service. Please refer to the gRPC section for more information.