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
  • AgenTaoClientConfig
  • Factory Helpers
  • Examples
  • AgenTaoClient
  • Methods
  • Context Manager
  • ActiveCall
  • Methods
  • Properties
  • Events
  • Next Steps
Reference

API Reference

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

Interactive Notifications

Next

Error Handling

Built with

AgenTaoClientConfig

The public 0.24.0 docs present AgenTaoClientConfig through factory helpers rather than direct constructor examples.

Factory Helpers

HelperUseParameters
AgenTaoClientConfig.sandbox(...)SANDBOX mode with API key authenticationapi_key, connector_uuid, sample_rate
AgenTaoClientConfig.production(...)PROD mode with mTLS authenticationcert_path, key_path, sample_rate

Examples

1sandbox_config = AgenTaoClientConfig.sandbox(
2 api_key="YOUR_API_KEY",
3 connector_uuid="YOUR_CONNECTOR_UUID",
4 sample_rate=24000,
5)
6
7production_config = AgenTaoClientConfig.production(
8 cert_path="/etc/certs/client.pem",
9 key_path="/etc/certs/client.key",
10 sample_rate=24000,
11)

AgenTaoClient

Main client class for managing the control connection and dispatching call events.

Methods

MethodDescription
run_forever()Run until the client is closed. Use this inside async with AgenTaoClient(config) as client: for long-lived apps
connect()Explicitly open the control connection
disconnect()Explicitly close the control connection
on(event)Decorator for client-level handlers such as events.INCOMING_CALL or ClientEvent.INCOMING_CALL
get_call(call_id)Get an active call by ID

Context Manager

1async with AgenTaoClient(config) as client:
2 @client.on(events.INCOMING_CALL)
3 async def on_call(call):
4 await call.answer()
5
6 await client.run_forever()

ActiveCall

Represents a call session with an attached media connection.

Methods

MethodParametersDescription
answer()Answer the incoming call
connect()ring_time_seconds=60Initiate a 3-way conference between the caller, callee, and agent
whisper()Route the agent’s audio to the callee only
barge()Route the agent’s audio to both caller and callee
spy()Put the agent in listen-only mode
disconnect()End the call for all parties
close()Close the call and release resources. After connect(), the agent leaves while caller and callee stay connected. After answer() without connect(), the call ends for both agent and caller
force_disconnect()Forcefully tear down the call from the client side
send_audio()audio_data: bytesQueue raw PCM audio for playback
clear_send_audio_buffer()Clear all queued outgoing audio
get_send_audio_buffer_size()Return the current queued buffer size
audio_stream()Async iterator for incoming audio chunks
on(event)handlerDecorator for call-level event handlers such as events.CALL_TERMINATED or CallEvent.CALL_TERMINATED

Properties

PropertyTypeDescription
call_idstrUnique call identifier
caller_numberstrCaller phone number
callee_numberstrCallee phone number
directionstrCall direction, such as "MT"

Events

All string event constants are available from agentao_sdk.events:

1import agentao_sdk.events as events

The public 0.24.0 package docs also describe ClientEvent and CallEvent enums as type-safe alternatives to these string constants.

EventLevelDescription
events.INCOMING_CALLClientA new call has arrived
events.CALL_TERMINATEDCallThe call has ended
events.CALL_ANSWEREDCallThe call was successfully answered
events.CALL_CONNECTEDCallThe connect operation succeeded
events.CALL_CONNECT_FAILEDCallThe connect operation failed
events.CALL_ANSWER_FAILEDCallThe answer attempt failed

Next Steps

  • Call States - See how these methods map to the call lifecycle
  • Error Handling - Review the exception hierarchy and recovery patterns
  • Advanced Topics - Logging, concurrency, and operational notes