Soniox
SDKsPython

Sync vs async clients

Choose between SonioxClient and AsyncSonioxClient based on your app.

Soniox Python SDK provides two clients.

  • SonioxClient for synchronous code (scripts, CLIs, simple services)
  • AsyncSonioxClient for asyncio apps (FastAPI, aiohttp, background workers)

The files, models, auth, webhooks, transcriptions, and realtime APIs accept the same parameters and return the same types in both clients.

Sync client (SonioxClient)

from soniox import SonioxClient

client = SonioxClient()

file = client.files.upload("audio.mp3")
transcription = client.stt.transcribe(
    audio_url="https://soniox.com/media/examples/coffee_shop.mp3"
)

print(file.id, transcription.id)

Async client (AsyncSonioxClient)

import asyncio
from soniox import AsyncSonioxClient

async def main():
    client = AsyncSonioxClient()

    file = await client.files.upload("audio.mp3")
    transcription = await client.stt.transcribe(
        audio_url="https://soniox.com/media/examples/coffee_shop.mp3"
    )

    print(file.id, transcription.id)

asyncio.run(main())