Pipecat Quickstart
Building a voice or multimodal AI agent? Pipecat is built on top of
daily-python and is the faster path — see the Pipecat Quickstart guide.Installation
See the installation guide for setup instructions.Core concepts
Initializing
daily.Daily.init()
Before using the SDK, initialize the Daily context:
Creating a call client
daily.CallClient()
Most SDK functionality lives in the CallClient class. Create one after initializing:
Releasing a call client
daily.CallClient.release()
Once the client is no longer needed, explicitly release its internal resources. This is important when the client holds a circular reference (e.g. via an event handler — see Handling events below).
Joining a meeting
daily.CallClient.join()
Join a Daily meeting with its URL:
Leaving a meeting
daily.CallClient.leave()
Always leave the meeting when done to clean up network connections:
Setting the user name
daily.CallClient.set_user_name()
Setting client permissions
Meeting owners can control whether participants have presence in a meeting, can send media, or can manage other participants. Permissions can be set dynamically from within a meeting or configured in advance with a meeting token. A common use case fordaily-python is to export media from a call as a hidden participant. To do this, use the REST API to create a meeting token with the permissions object’s hasPresence set to false, then pass the resulting JWT to join():
Completion callbacks
SomeCallClient methods are asynchronous. Pass an optional callback to be notified when they complete:
Handling events
To listen and react to various meeting events, such as participant updates, recordings started or ended, etc., simply subclassdaily.EventHandler and implement the relevant event handler methods. For example:
MyApp and the client — make sure to call client.release() during cleanup.
Inputs and publishing
Inputs control devices — whether a camera is enabled and at what resolution, or which microphone is selected. Publishing settings control whether the input is being sent, and at what quality. A camera can be enabled via inputs but not published (i.e. not sent to other participants). Seedaily.CallClient.inputs and daily.CallClient.publishing for details.
Subscriptions and subscription profiles
Subscriptions define which media you receive, from which participants, and the quality you receive it at — for example, you may subscribe to audio from all participants but only subscribe to video from specific ones or you may only subscribe to low-quality video from certain participants. Subscription profiles give a named set of subscription settings. The built-inbase profile is applied to all remote participants’ camera and microphone streams by default.
Updating subscription profiles
Update thebase profile to change default subscriptions for all participants — for example, to subscribe to microphone only:
Updating subscriptions for participants
Update a specific participants’ subscriptions to use a custom or"base" profile:
Sending media
daily-python supports virtual video and audio devices for simulating cameras, speakers, and microphones.
Sending video
Cameras are used to send video into the meeting. A camera is a live stream, so it needs to generate images at a certain framerate. To start, we need to create a virtual camera with a certain width, height, and an optional color format (frames written to the camera should then be in this color format):daily.Daily.create_camera_device and daily.CallClient.update_inputs for more details.
Sending audio
Create a virtual microphone and write audio frames to it, similar to the virtual camera:daily.Daily.create_microphone_device and daily.CallClient.update_inputs for more details.
If you are using multiple call clients, where each need their own microphone, create separate processes. Multiple microphones can exist simultaneously, but only one can be active per client.
Receiving media
Receiving video
daily.CallClient.set_video_renderer()
Register a callback to receive video frames from a specific participant:
video_frame is a daily.VideoFrame.
Receiving audio
Audio can be received from an individual participant or from all meeting participants in a single mixed track. For individual participant audio, register a callback usingdaily.CallClient.set_audio_renderer():
audio_data is a daily.AudioData.
Receiving mixed audio
Create a virtual speaker to receive mixed audio from all meeting participants:daily.Daily.create_speaker_device and daily.Daily.select_speaker_device for more details.
Transcription
start_transcription()stop_transcription()
Room owners or participants with the 'transcription' canAdmin permission can start and stop transcription:
| Name | Type | Description |
|---|---|---|
language | str | See Deepgram language docs |
model | str | See Deepgram model docs |
profanity_filter | bool | See Deepgram profanity filter docs |
redact | bool or list | See Deepgram redaction docs |
extra | dict | Additional Deepgram streaming options |
includeRawResponse | bool | Whether to include Deepgram’s raw response in transcription messages |
on_transcription_message, on_transcription_started, and on_transcription_stopped.
Stop transcription with:
Recording
daily.CallClient.start_recording()daily.CallClient.stop_recording()
With recording enabled on the room, you can start/stop a cloud recording from your Python client:
stream_id UUID. For layout options, see the recording layout reference.
See also Daily’s recording guide for more details on recording features and capabilities.
Chatting with Prebuilt Clients
send_prebuilt_chat_message()
When participants are in a Daily Prebuilt call, your Python client can send messages to Prebuilt’s chat like so: