busy-london-38160
07/20/2025, 3:54 PMRoomServiceClient, and then the AI agent attempts to connect to that room as a participant.
However, the agent's connection consistently fails with a 401 Unauthorized error.
The Error: Error: Could not fetch region settings: Unauthorized (status: 401)
My Setup:
• Project URL: <wss://ai-agent>-****.livekit.cloud
• Environment: Node.js v20.18.3 on an Apple Silicon (arm64) Mac.
• Key Libraries:
◦ `livekit-client`: 1.15.7
◦ `livekit-server-sdk`: 2.13.1
◦ `@roamhq/wrtc`: 0.0.0-beta.2
What I've Already Tried (Exhaustive Debugging): I'm certain this is not a simple credential typo, as I have tried the following:
1. Generated brand new API keys and secrets multiple times.
2. To completely rule out any issues with my .env file or local environment, I hardcoded the new API Key and Secret directly into my application code. The 401 error still occurs.
3. To rule out clock skew, I forced my machine's clock to sync with an NTP time server (sudo sntp -sS <http://time.apple.com|time.apple.com>). The error still occurs.
4. I have tried connecting to both the global LiveKit URL and the specific regional URL for India (<wss://ai-agent>-****ivekit.cloud).
My Question: Given that the connection fails with a 401 error even with brand new, hardcoded credentials and a synchronized clock, what could be the server-side cause? Is there a known issue with project authentication states or a specific configuration I might be missing?
Any help would be greatly appreciated. Thank you!