For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Introduction
    • Overview
    • Installation
    • Developer Onboarding
    • Quick Start
  • Concepts
    • Architecture
    • Call States and Lifecycle
    • Call Commands
    • Audio Streaming
    • Event Handling
  • Integrations
    • Google GenAI SDK (Gemini Live)
    • Google ADK (Agent Development Kit)
  • Use Cases
    • After-hours Voicemail
    • Appointment Booking
    • Call Monitoring and Coaching
    • Database Lookup
    • Human Escalation
    • Interactive Notifications
  • Reference
    • API Reference
    • Error Handling
    • Advanced Topics
LogoLogo
On this page
  • SANDBOX Mode (API Key Authentication)
  • Separate Receive and Send Pipelines
  • PROD Mode (mTLS Authentication)
  • Next Steps
Introduction

Quick Start

||View as Markdown|
Was this page helpful?
Previous

Developer Onboarding

Next

Architecture

Built with

For 0.24.0, the recommended pattern is to create the client config with a factory helper, start the client with async with AgenTaoClient(config), register event handlers, and then call run_forever().

SANDBOX Mode (API Key Authentication)

1import asyncio
2import os
3
4from agentao_sdk import ActiveCall, AgenTaoClient, AgenTaoClientConfig
5import agentao_sdk.events as events
6
7async def handle_call(call: ActiveCall):
8 @call.on(events.CALL_TERMINATED)
9 def on_terminated():
10 print("Call terminated")
11
12 await call.answer()
13
14 async for audio_chunk in call.audio_stream():
15 response_audio = await ai_model.process(audio_chunk)
16 await call.send_audio(response_audio)
17
18 # Because this flow never calls connect(), close() ends the call.
19 await call.close()
20
21async def main():
22 config = AgenTaoClientConfig.sandbox(
23 api_key=os.getenv("WSS_API_KEY"),
24 connector_uuid=os.getenv("WSS_CONNECTOR_UUID"),
25 sample_rate=24000,
26 )
27
28 async with AgenTaoClient(config) as client:
29 @client.on(events.INCOMING_CALL)
30 async def on_incoming_call(call: ActiveCall):
31 await handle_call(call)
32
33 await client.run_forever()
34
35if __name__ == "__main__":
36 asyncio.run(main())

Separate Receive and Send Pipelines

If your application needs to read from audio_stream() and write with send_audio() independently, use asyncio.TaskGroup and a queue so neither side blocks the other.

PROD Mode (mTLS Authentication)

1from agentao_sdk import AgenTaoClientConfig
2
3config = AgenTaoClientConfig.production(
4 cert_path="/etc/certs/client.pem",
5 key_path="/etc/certs/client.key",
6 sample_rate=24000,
7)

Next Steps

  • Architecture - Understand the dual-connection model
  • Call Commands - Learn the core commands used by ActiveCall
  • Call States - Understand the call lifecycle
  • API Reference - Review the full public surface