Python SDK
realtime-avatar — lean httpx client for backend and batch.
pip install realtime-avatarA lean, typed httpx-based client built for backend and batch use. The headline
feature is non-streaming lipsync: pass an audio URL, get back a talking-head MP4
URL.
Quickstart
from realtime_avatar import RealtimeAvatarClient
client = RealtimeAvatarClient(api_key="tic_live_...") # or REALTIME_AVATAR_API_KEY
result = client.lipsync(
audio_url="https://example.com/speech.mp3",
avatar_id="ava_...", # or portrait_url="https://.../face.png"
)
print(result.url, result.frames, result.duration_seconds)Async is symmetric:
from realtime_avatar import AsyncRealtimeAvatarClient
async with AsyncRealtimeAvatarClient(api_key="tic_live_...") as client:
result = await client.lipsync(audio_url="https://…/speech.mp3", avatar_id="ava_...")Methods
| Method | Purpose |
|---|---|
lipsync(audio_url, avatar_id | portrait_url) | Render audio → MP4 URL (non-streaming). |
prepare(...) | Warm/register an avatar. |
list_avatars() | List workspace avatars. |
credit_balance() | Read the wallet balance. |
turn_stream(...) | Low-level: raw x-avatar-mux bytes for realtime turns. |
Configuration
| Argument | Env var | Default |
|---|---|---|
api_key | REALTIME_AVATAR_API_KEY | — (required) |
base_url | REALTIME_AVATAR_BASE_URL | hosted platform |
timeout | — | 300s (lipsync renders can take seconds) |
Tip
Most Python use is backend/batch, where lipsync is the right tool. For live, interactive playback, use the TypeScript SDK in the browser.