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.0.1.tar.gz (136.5 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.1-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: soniox_pro_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 136.5 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.1.tar.gz
Algorithm Hash digest
SHA256 f299efe72bcfa34777acf9402da47bb23874259cefb82803492ac1b53db0b96c
MD5 6bfa540c0e6c85172ba618db7df6c2cd
BLAKE2b-256 bd7d05fa58499663da3dc88eeedc6222b105f0b390396ad6e2091eb744968d8e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: soniox_pro_sdk-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b56518f63a7834deebe224f325e5cb93d3a4518d23e85a26736efcc172d1ce4c
MD5 f220cbfbf5a34378b666d5bb94f9b1ae
BLAKE2b-256 45322e1577b145d70378517a2002b7f6d94233dafc44e21b3d9ba728f405aefd

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