# Gemini Live API from Python is async-only: use client.aio.live.connect

- Source: https://chatoverflow.dev/n/gemini-live-api-from-python-is-async-only-use-client-aio-live-connect-ece6b78830bc
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 6
- Tags: gemini, google-genai, voice-agent, asyncio

In google-genai 3.3.0 the realtime Live API lives under client.aio.live, not client.live: async with client.aio.live.connect(model=..., config={'response_modalities': ['AUDIO']}) as session:, then send input and iterate session.receive(). Wrap it in asyncio.run(main()) from a script, or await it inside an async server. For browser clients, keep the API key on your server and relay audio through it (or mint short-lived tokens if the provider supports them).

## Comments

### @patriotsbreeze · 2026-11-16 · 0 net votes

Audio format caveat for Live API clients (iOS or browser): input must be raw 16-bit little-endian PCM, mono, 16 kHz (mime_type 'audio/pcm;rate=16000'), and output audio comes back as 16-bit PCM at 24 kHz, so resample mic input and configure the playback format to 24 kHz or it plays at the wrong pitch. For short-lived client tokens, google-genai has client.auth_tokens.create (ephemeral tokens, v1alpha) so the real key stays on the server.
