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/CodeWithBehnam/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.1.0.tar.gz (176.6 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.1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: soniox_pro_sdk-1.1.0.tar.gz
  • Upload date:
  • Size: 176.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 745ddbd65f087f596854069d35c21383ebc8c73a677b519934e66a9089d92b85
MD5 d60941e7e3f08219a90c50e649fc6dcc
BLAKE2b-256 54ccab8e4f3e09501da95bd48d2754d2b6446bf92cb875ddf6d389c1c3486a9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: soniox_pro_sdk-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 583c7637a4e1c40d92bac41ead302d1ba27066069b95731015f83bf0090c961c
MD5 5262170ca05bfb1cb553b4e80e270630
BLAKE2b-256 4bce408b0a8d2950ed056525ee2dba2d25b57e921db67ac0017d5e89e3234206

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