Skip to main content

Professional Python SDK for Soniox Speech-to-Text API - Blazing fast, production-ready, and fully-featured

Project description

Soniox Pro SDK

PyPI version Python Support License: MIT Code style: black

The most powerful, flexible, and blazing-fast Python SDK for the Soniox Speech-to-Text API.

Production-ready, fully-typed, and optimised for performance.

Features

Complete API Coverage

  • REST API (Files, Transcriptions, Models, Authentication)
  • WebSocket API (Real-time transcription and translation)
  • Synchronous and asynchronous interfaces
  • Full type safety with Pydantic models

Performance Optimised

  • Blazing fast with optional C extensions
  • Connection pooling for HTTP and WebSocket
  • Async I/O throughout
  • Memory-efficient streaming

Advanced Capabilities

  • 60+ languages supported
  • Real-time translation (one-way and two-way)
  • Speaker diarization (up to 15 speakers)
  • Language identification
  • Endpoint detection
  • Custom context and vocabulary
  • Word-level timestamps
  • Confidence scores

Developer Experience

  • Comprehensive documentation
  • Full IDE autocomplete support
  • 90%+ test coverage
  • Type-checked with mypy
  • Clean, Pythonic API

Installation

Basic Installation

# Using uv (recommended)
uv add soniox-pro-sdk

# Using pip
pip install soniox-pro-sdk

Optional Dependencies

# Async support
pip install soniox-pro-sdk[async]

# Performance optimisations (C extensions)
pip install soniox-pro-sdk[performance]

# Development tools
pip install soniox-pro-sdk[dev]

# Everything
pip install soniox-pro-sdk[all]

Quick Start

Async Transcription

from soniox import SonioxClient

# Initialise client
client = SonioxClient(api_key="your-api-key")

# Transcribe from URL
transcription = client.transcriptions.create(
    audio_url="https://example.com/audio.mp3",
    model="stt-async-v3",
    enable_speaker_diarization=True,
)

# Wait for completion
result = client.transcriptions.wait_for_completion(transcription.id)
print(result.transcript.text)

Real-time Transcription

from soniox import SonioxRealtimeClient

# Initialise real-time client
client = SonioxRealtimeClient(
    api_key="your-api-key",
    model="stt-rt-v3",
)

# Stream audio
with client.stream() as stream:
    with open("audio.mp3", "rb") as f:
        while chunk := f.read(4096):
            stream.send_audio(chunk)

    # Receive tokens
    for response in stream:
        for token in response.tokens:
            if token.is_final:
                print(token.text, end="")

Async/Await Support

import asyncio
from soniox import AsyncSonioxClient

async def transcribe():
    async with AsyncSonioxClient(api_key="your-api-key") as client:
        file = await client.files.upload("audio.mp3")
        transcription = await client.transcriptions.create(file_id=file.id)
        result = await client.transcriptions.wait_for_completion(transcription.id)
        return result.transcript.text

text = asyncio.run(transcribe())

Documentation

Full documentation available at: https://github.com/behnamebrahimi/soniox-pro-sdk

Testing

# Run tests
uv run pytest

# With coverage
uv run pytest --cov=soniox

# Type check
uv run mypy src/soniox

# Lint
uv run ruff check src/soniox

License

MIT License - see LICENSE for details.

Links


Built for the developer community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soniox_pro_sdk-1.0.0.tar.gz (136.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

soniox_pro_sdk-1.0.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file soniox_pro_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: soniox_pro_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 136.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for soniox_pro_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 483b0bed16098cc26ebb0e63690f97cc21efefa91b287bc954f09bd98347ae02
MD5 6b9e03ac95e07f23e57f79a218717faf
BLAKE2b-256 4ad4645b78b598fefdb5f8a25766c4daba5c41b122ff109c7a3bfdbfa3f989a9

See more details on using hashes here.

File details

Details for the file soniox_pro_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: soniox_pro_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for soniox_pro_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 421034418c529267b0a6594c157009fb45a3f157d411662d0cbde37836cd7e2c
MD5 e29d212c344e32d5f09c86989f66625f
BLAKE2b-256 f61510f01e0bd4fde89aa99e2ed377f9686b468a452f46519207a8a72133f71e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page