Skip to main content

Official Speko Python SDK — one API, every voice provider

Project description

spekoai (Python SDK)

Official Python SDK for Speko — one API, every voice provider.

Speko is a voice AI gateway that benchmarks every STT, LLM, and TTS provider across languages, then routes each request to the best provider in real time. Failover is handled. You write one integration; Speko picks the right provider for every call.

Installation

pip install spekoai
# or
uv add spekoai

Quickstart

import os
from pathlib import Path

from spekoai import Speko

speko = Speko(api_key=os.environ["SPEKO_API_KEY"])

# Transcribe — best STT provider auto-routed for your language
audio = Path("call.wav").read_bytes()
result = speko.transcribe(
    audio,
    language="es-MX",
    region="us-east4",  # optional — rank streaming providers in this region
)
print(result.text, result.provider, result.confidence)

# Synthesize — best TTS provider auto-routed
speech = speko.synthesize(
    "Hello world",
    language="en",
)
ext = "mp3" if "mpeg" in speech.content_type else "pcm"
Path(f"out.{ext}").write_bytes(speech.audio)

# Complete — best LLM provider auto-routed
completion = speko.complete(
    messages=[{"role": "user", "content": "Hi!"}],
    intent={"language": "en"},
)
print(completion.text)

Async

import asyncio
from spekoai import AsyncSpeko

async def main():
    async with AsyncSpeko(api_key=os.environ["SPEKO_API_KEY"]) as speko:
        completion = await speko.complete(
            messages=[{"role": "user", "content": "Hi!"}],
            intent={"language": "en"},
        )
        print(completion.text)

asyncio.run(main())

Documentation

Full API reference and guides: https://docs.speko.dev/sdk-python

Contributing

See CONTRIBUTING.md.

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

spekoai-0.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

spekoai-0.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file spekoai-0.1.1.tar.gz.

File metadata

  • Download URL: spekoai-0.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for spekoai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 76c0948b051120c3b34687a69c267e236f6d1ffd0868780321c063710712da32
MD5 4d671aafcd3f0bc9cf7bf3a4835c8498
BLAKE2b-256 48d9a118bbb52b3e0cd8934bc775a2fb09c81c5514df4d2408d254b0870c58df

See more details on using hashes here.

File details

Details for the file spekoai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spekoai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for spekoai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ebd1e42ba0fdbaf48cce13cc9b499c346d9e1f25fdead4f9405ab91fa846019
MD5 ec379c20c0a0ecb1bb242289b7155c0b
BLAKE2b-256 e3dec0eae7a9627a1f11c9548d5b8c9a2538d1aff8db9ce93b2464cc2373204c

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