LIVEKIT_URL=<wss://air-lk.livekit.cloud> LIVEKIT_A...
# ask-ai
n
LIVEKIT_URL=wss://air-lk.livekit.cloud LIVEKIT_API_KEY=API4xxxxQt LIVEKIT_API_SECRET=t6Lc6yeeeeeWZGEuHyPk7UDTvilfeSGemC I have these keys in my env.local. I have used this to pick secrets for my cloud deployment. But when i print os.getenv("LIVEKIT_API_KEY"), os.getenv("LIVEKIT_API_SECRET"), i see a different pair of keys that are not even present in the api keys section of cloud console. How can this happen?
t
Thanks for reaching out, Hari. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I hear your concern about seeing different API keys in the deployed app than the ones you put in
env.local
. I’m responding about why
LIVEKIT_API_KEY
/
LIVEKIT_API_SECRET
can differ between local files and a cloud deployment, and what you can do. What’s happening • LiveKit Cloud does not upload or use the
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
, and
LIVEKIT_URL
values from local env files during deployment. • The platform auto-injects system-managed credentials for your project into the running environment. That’s why
os.getenv("LIVEKIT_API_KEY")
/
LIVEKIT_API_SECRET")
in the deployed app show a different pair — they are the platform-provisioned keys, not the ones in your local
env.local
. What this means for you • The keys printed by your deployed process are valid for that deployment even if they don’t match local files or what you expect to see in the console. • This behavior is intentional to keep agent credentials secure and consistent across deployments. If you want to verify or change credentials • If you need to use specific credentials or inspect project credentials, tell me whether you want to: ◦ confirm which project/agent is running (I can walk you through checks to identify the project/agent), ◦ use different credentials for local testing vs cloud (I can show safe ways to do that), or ◦ rotate/regenerate keys for the project (I can outline the steps). Which of those would you like to do, or share whether you’re running in development vs a cloud deployment so I can give precise steps. Sources: Examples | livekit/livekit_composite | DeepWiki | Agents Framework | livekit/livekit_composite | DeepWiki
n
How can i see the keys that are going to be used in the cloud deployment. And do they change with every deployment
t
Thanks — I’m answering your two questions: how to see the keys used in cloud deployment, and whether they change each deploy. How to view the keys being used • Open your LiveKit Cloud dashboard and go to your project’s Settings page — the project’s
LIVEKIT_API_KEY
and
LIVEKIT_API_SECRET
are shown there. • Or run the CLI to write the project env into a local file: a. Run:
lk app env -w
b. This creates a
.env.local
populated with
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
, and
LIVEKIT_URL
. Do the keys change with every deployment? • No. These keys are project-scoped and remain the same across deployments unless you manually rotate them in the dashboard. • Note: the deployment process ignores any
LIVEKIT_*
values from your local env files and injects the project-managed credentials into the running environment. Would you like steps to rotate keys or to confirm which project is currently deployed? Sources: Mini tutorial: setting up a LiveKit Cloud project | Google AI and LiveKit | LiveKit Docs | Examples | livekit/livekit_composite | DeepWiki | Server-side | livekit/livekit_composite | DeepWiki