Skip to main content

Official Python SDK for the Sayd Speech API — Voice Interface for AI Agents

Project description

sayd-ai

Voice Interface for AI Agents. You said it. Agents did it.

Official Python SDK for the Sayd Speech API.

Installation

pip install sayd-ai

Quick Start

from sayd_ai import Sayd

client = Sayd(api_key="sk-your-key")

# Create a talk session and transcribe audio
session = client.talk.create(language="zh", cleaning_level="standard")

# Stream audio from file
for event in session.stream_file("recording.wav"):
    if event.type == "sentence":
        print(f"[live] {event.text}")
    elif event.type == "cleaned":
        print(f"[clean] {event.cleaned_text}")

print(f"Duration: {session.duration_minutes:.1f} min")
print(f"Cost: ${session.cost_usd:.4f}")

Real-time Microphone Streaming

from sayd_ai import Sayd

client = Sayd(api_key="sk-your-key")
session = client.talk.create(language="en")

# Stream from microphone (requires pyaudio)
for event in session.stream_microphone():
    if event.type == "partial":
        print(f"\r  {event.text}", end="", flush=True)
    elif event.type == "sentence":
        print(f"\n[final] {event.text}")
    elif event.type == "cleaned":
        print(f"\n\n--- Cleaned Transcript ---")
        print(event.cleaned_text)

Async Support

import asyncio
from sayd_ai import AsyncSayd

async def main():
    client = AsyncSayd(api_key="sk-your-key")
    session = await client.talk.create(language="multi")

    async for event in session.stream_file("audio.wav"):
        if event.type == "cleaned":
            print(event.cleaned_text)

asyncio.run(main())

cURL Examples

Want to test the API directly without the SDK? Check out our cURL examples for all endpoints.

Configuration

client = Sayd(
    api_key="sk-your-key",
    base_url="https://api.sayd.dev",  # default
    timeout=30,                    # request timeout in seconds
)

Talk Session Options

Parameter Type Default Description
language str "multi" Language: en, zh, multi
sample_rate int 16000 Audio sample rate: 8000 or 16000
codec str "pcm16" Codec: pcm16, opus
cleaning_level str "standard" light, standard, aggressive
output_format str "paragraph" paragraph, bullets, raw

License

MIT

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

sayd_ai-0.2.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

sayd_ai-0.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file sayd_ai-0.2.0.tar.gz.

File metadata

  • Download URL: sayd_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sayd_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 40b030b80ab5ea600511f32724844978601cecb5bd5b87ae3bfd2b0753b97a74
MD5 2212051fa9a0a3d8a01a0948796c1538
BLAKE2b-256 98afd06b179c450d7312d38341f49788aaa03cfc4c6b2542de25fe4775289195

See more details on using hashes here.

File details

Details for the file sayd_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sayd_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sayd_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8322c29970d15695f3959c41803b7d07acf74941241cd1413f9554e0ed1d3cb0
MD5 d2b738f95588688d4a7672ed2e97c629
BLAKE2b-256 870db79ade51cde31ac0612173ea25d796f1f7a3b1e724aca1ca2db0e4848df2

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