narrow-hairdresser-82835
12/31/2025, 6:03 AMtall-airline-16756
12/31/2025, 6:03 AMtall-airline-16756
12/31/2025, 6:04 AMos.getenv("LIVEKIT_API_KEY") (and LIVEKIT_API_SECRET) return the single value set in your runtime environment. If you have three API keys in your LiveKit Cloud account, your app will use whichever key pair you have assigned to those environment variables — not a random one.
If you want to use a different key, set `LIVEKIT_API_KEY`/`LIVEKIT_API_SECRET` to that key pair in your environment (or use a secret manager to inject the desired pair per environment).
Sources: Custom agent deployments | LiveKit docsnarrow-hairdresser-82835
12/31/2025, 6:19 AMtall-airline-16756
12/31/2025, 6:19 AM.env or .env.local typically hold LIVEKIT_API_KEY and LIVEKIT_API_SECRET.
• With LiveKit CLI deployments: secrets are provided via the CLI flags (--secrets-file, --secrets, or --secret-mount) and uploaded/managed remotely — not baked into the image.
• Docker: a .env referenced by docker-compose or Docker build args (but do not include .env in the image; add it to .dockerignore).
• Kubernetes: secrets live in a Kubernetes Secret (often defined in a YAML Secret manifest) and mounted as env vars or files.
• Helm: values containing secret references (ideally using external secret management) or templates that reference Kubernetes Secrets.
Note: livekit.toml does not contain secrets; LiveKit Cloud may automatically inject LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL at runtime.
Which deployment method are you using (LiveKit Cloud, LiveKit CLI, Docker, Kubernetes, or something else)? I’ll give exact file/manifest examples for that setup.
Sources: Custom agent deployments | LiveKit docs | Server-side | livekit/livekit_composite | DeepWiki | Agents (Python) | livekit/livekit_composite | DeepWiki | Deploying to production | LiveKit Docs | server-sdk-go | livekit/livekit_composite | DeepWiki