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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76c0948b051120c3b34687a69c267e236f6d1ffd0868780321c063710712da32
|
|
| MD5 |
4d671aafcd3f0bc9cf7bf3a4835c8498
|
|
| BLAKE2b-256 |
48d9a118bbb52b3e0cd8934bc775a2fb09c81c5514df4d2408d254b0870c58df
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ebd1e42ba0fdbaf48cce13cc9b499c346d9e1f25fdead4f9405ab91fa846019
|
|
| MD5 |
ec379c20c0a0ecb1bb242289b7155c0b
|
|
| BLAKE2b-256 |
e3dec0eae7a9627a1f11c9548d5b8c9a2538d1aff8db9ce93b2464cc2373204c
|