Skip to main content

Configuration

EstuaryConfig

The EstuaryConfig dataclass controls all client behavior. Pass it to the EstuaryClient constructor.

from estuary_sdk import EstuaryConfig

config = EstuaryConfig(
server_url="https://api.estuary-ai.com",
api_key="est_your_api_key",
character_id="your-character-uuid",
player_id="user-123",
)

Required Fields

FieldTypeDescription
server_urlstrEstuary server URL
api_keystrAPI key (starts with est_)
character_idstrUUID of the AI character to connect to
player_idstrUnique identifier for the current user

Optional Fields

FieldTypeDefaultDescription
voice_transportVoiceTransport"websocket"Voice transport: "websocket", "livekit", or "auto"
audio_sample_rateint24000Audio sample rate in Hz
auto_reconnectboolTrueAutomatically reconnect on disconnect
max_reconnect_attemptsint5Maximum number of reconnection attempts
reconnect_delayfloat1.0Base delay between reconnection attempts (seconds)
debugboolFalseEnable verbose debug logging
realtime_memoryboolFalseEnable memory_updated events during conversations
capabilitiesSessionCapabilities | NoneNoneDeclare what the device can physically do (see SessionCapabilities)
apm_echo_cancellationboolTrueAPM echo cancellation (LiveKit only)
apm_noise_suppressionboolTrueAPM noise suppression (LiveKit only)
apm_auto_gain_controlboolFalseAPM automatic gain control (LiveKit only)
apm_high_pass_filterboolTrueAPM high-pass filter (LiveKit only)

VoiceTransport

A string literal type controlling which voice transport to use:

ValueDescription
"websocket"WebSocket-based voice streaming (default)
"livekit"LiveKit WebRTC with AEC and audio processing
"auto"Prefer LiveKit if the livekit package is installed, fall back to WebSocket
from estuary_sdk import EstuaryConfig

# Explicit WebSocket
config = EstuaryConfig(..., voice_transport="websocket")

# Explicit LiveKit (requires livekit package)
config = EstuaryConfig(..., voice_transport="livekit")

# Auto-detect
config = EstuaryConfig(..., voice_transport="auto")

SessionCapabilities

Declares what the host device can physically do. The server hides tools that require a missing capability — for example, the character won't request a camera image when camera=False, so a headless integration is never asked to see something it can't.

FieldTypeDefaultDescription
versionstr"1"Schema version
cameraboolTrueA camera is available to answer camera_capture_request
microphoneboolTrueA microphone is available for voice capture
speakerboolTrueA speaker is available for voice playback
from estuary_sdk import EstuaryConfig, SessionCapabilities

config = EstuaryConfig(
server_url="https://api.estuary-ai.com",
api_key="est_your_api_key",
character_id="your-character-uuid",
player_id="user-123",
capabilities=SessionCapabilities(
camera=False, # Headless service with no camera
microphone=True,
speaker=True,
),
)

Declare device capability, not current usage mode — a voice-capable client sets microphone=True even while it is being used for text only.

note

Omitting capabilities is equivalent to declaring every field True, which is also what the server assumes for clients that send nothing. Existing code keeps working unchanged.

RetryConfig

Optional retry configuration for RestClient HTTP requests. Uses exponential backoff.

FieldTypeDefaultDescription
max_retriesint3Maximum number of retry attempts
backoff_factorfloat1.0Multiplier for exponential backoff (delay = factor * 2^attempt)
retry_on_statustuple[int, ...](500, 502, 503, 504)HTTP status codes that trigger a retry
from estuary_sdk import RetryConfig
from estuary_sdk.rest.rest_client import RestClient

retry = RetryConfig(max_retries=5, backoff_factor=0.5)
rest = RestClient(base_url="https://api.estuary-ai.com", api_key="est_...", retry_config=retry)
note

This is for advanced users building custom REST clients. The built-in sub-clients (client.memory, client.players, etc.) use the default RestClient created by EstuaryClient.