hallowed-book-84502
08/29/2025, 12:13 PMtall-airline-16756
08/29/2025, 12:13 PMtall-airline-16756
08/29/2025, 12:14 PMhallowed-book-84502
08/29/2025, 12:14 PMtall-airline-16756
08/29/2025, 12:15 PMname
parameter when you create the room. You do this with the CreateRoom
API call. Here’s a quick example in Python:
room_client.CreateRoom(
livekit.CreateRoomRequest(
name="myroom", # This is where you set your room name
empty_timeout=600,
max_participants=20
)
)
Just a heads up—the room name has to be unique within your LiveKit deployment. If a room with that name already exists, the request will simply return the existing room. If you have any questions or want me to walk you through anything else, just let me know—I’m here to help!
Sources: Managing rooms | LiveKit Docs | packages/livekit-server-sdk/src/RoomServiceClient.ts | examples/api/src/main.rs | livekit-protocol/livekit/protocol/room.pyi | src/main/kotlin/io/livekit/server/RoomServiceClient.kthallowed-book-84502
08/29/2025, 12:16 PMtall-airline-16756
08/29/2025, 12:17 PMCreateRoom
API. Here’s a quick example in Python:
room_client.CreateRoom(\n livekit.CreateRoomRequest(\n name=\"myroom\",\n empty_timeout=600,\n max_participants=20\n )\n)
And don’t worry if your starter code doesn’t explicitly create rooms—the automatic creation will still kick in when someone joins. If you want, I’m happy to help you find where that happens in your code!
Sources: packages/livekit-server-sdk/src/RoomServiceClient.ts | examples/api.py | Managing rooms | LiveKit Docs | examples/api/src/main.rs | protobufs/livekit_room.protohallowed-book-84502
08/29/2025, 12:22 PMtall-airline-16756
08/29/2025, 12:22 PMCreateRoom
API before kicking off the session. Here’s a friendly little tweak to your code to help you add room creation:
from livekit import RoomServiceClient, CreateRoomRequest
# Initialize the RoomServiceClient (just make sure you have your credentials handy)
room_client = RoomServiceClient(api_key="your_api_key", api_secret="your_api_secret")
# Let's create the room explicitly
room = room_client.CreateRoom(
CreateRoomRequest(
name="myroom", # Pick a room name you like here
empty_timeout=600, # Optional: how long before the room times out (in seconds)
max_participants=20 # Optional: max number of people allowed
)
)
# Now, continue with your usual session setup
session = AgentSession(
llm=openai.realtime.RealtimeModel(
voice="ash"
)
)
await session.start(
room=room, # Use the room we just created
agent=Assistant(),
room_input_options=RoomInputOptions(
noise_cancellation=noise_cancellation.BVC(),
),
)
Just a quick reminder to swap out your_api_key
and your_api_secret
with your actual LiveKit credentials. If you hit any bumps or have questions, I’m here to help!