401 error on python agent.py dev - wss://.livekit.cloud/agent

Getting persistent 401 errors when running python agent.py dev with livekit-agents 1.4.2.

Same API key works fine for RoomService API calls (200 OK). Agent runs perfectly in console mode.

Error: WSServerHandshakeError: 401, message='Invalid response status', url='wss://reyns-1lk896kt.livekit.cloud/agent'

Stack: Python 3.12, livekit-agents 1.4.2, LiveKit Cloud (Build plan). Any idea why the /agent endpoint rejects my key?

That usually indicates your system clock is not correct or you do not have proper env variables set.