clever-hamburger-87073
10/31/2025, 6:40 AMtall-airline-16756
10/31/2025, 6:40 AMtall-airline-16756
10/31/2025, 6:41 AMLIVEKIT_API_KEY and LIVEKIT_API_SECRET are correctly configured in your environment variables or config files. If you’re in development mode, you can use the placeholder values: devkey for the API Key and secret for the API Secret.
2. Check Key Initialization: Make sure your application is properly loading these environment variables when it runs.
3. Validate Token Generation: Try generating a valid token using the LiveKit CLI with your API key and secret. Here’s an example command:
lk token create \
--api-key <your-api-key> --api-secret <your-api-secret> \
--join --room my-first-room --identity user1 \
--valid-for 24h
4. Test with Example App: You can also test your generated token by using the LiveKit example app at example.livekit.io to see if the connection works smoothly.
5. Review Logs: Take a look at your application logs for any unauthorized errors — they can give you clues if there’s something off with your API credentials.
If you’re still running into trouble, please check that your server is running in development mode if you’re using those placeholder credentials, or confirm your production keys are correctly set up and haven’t been revoked. Feel free to reach out if you need more guidance—I’m here to support you!
Sources: Mini tutorial: setting up a LiveKit Cloud project | README.md | examples/nextjs/.env.example | livekit-api/src/lib.rs | examples/src/frontdesk/calendar_api.test.tsclever-hamburger-87073
10/31/2025, 6:42 AMtall-airline-16756
10/31/2025, 6:42 AMLIVEKIT_API_KEY and LIVEKIT_API_SECRET).
2. Understand where credentials come from: The SDK looks for credentials in this order:
◦ Parameters passed directly to the TTS constructor
◦ Environment variables LIVEKIT_INFERENCE_API_KEY and LIVEKIT_INFERENCE_API_SECRET
◦ If those aren’t found, it falls back to LIVEKIT_API_KEY and LIVEKIT_API_SECRET
1. Check your Access Token: Make sure your token includes an inference grant (perform: true) when it’s generated, since this is essential for TTS operations.
2. Verify your deployment environment: Confirm that your deployment environment has the right LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL variables properly set.
If you’ve confirmed all of the above and the problem is still there, it might be worth checking your network connection or seeing if a proxy or firewall could be blocking the WebSocket connection. Please feel free to reach out if you need any more help—we’re here to support you!
Sources: Core Platform Architecture & Authentication | livekit/livekit_composite | D... | livekit-plugins/livekit-plugins-sarvam/livekit/plugins/sarvam/tts.py | agents/src/inference/tts.ts | Server-Side SDKs & Authentication | livekit/livekit_composite | DeepWikiclever-hamburger-87073
10/31/2025, 6:44 AMLIVEKIT_INFERENCE_API_KEY and LIVEKIT_INFERENCE_API_SECRET
What are thesetall-airline-16756
10/31/2025, 6:44 AMLIVEKIT_INFERENCE_API_KEY and LIVEKIT_INFERENCE_API_SECRET are special environment variables that help you connect securely with LiveKit's Inference services, like speech-to-text (STT), text-to-speech (TTS), and large language model (LLM) APIs.
When you use the LiveKit Agents SDKs, these variables are automatically picked up to set up the inference clients—unless you’ve provided specific API key and secret details directly in your code. If these aren’t set, no worries! The system will use LIVEKIT_API_KEY and LIVEKIT_API_SECRET instead.
This setup really helps you manage your credentials separately for inference services, giving you more control and flexibility with how you handle access and keys. If you have any questions or need a hand with this, feel free to ask—I’m here to help!
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/llm.py | agents/src/inference/stt.ts | Secrets management | LiveKit Docsclever-hamburger-87073
10/31/2025, 6:47 AMtall-airline-16756
10/31/2025, 6:47 AMLIVEKIT_API_KEY and LIVEKIT_API_SECRET
Also, if you’re using third-party services through LiveKit plugins like Cartesia, Deepgram, or Rime, you might need additional API keys from those providers. But don’t worry—for LiveKit’s own native inference services, just your LiveKit API key and secret will do the trick.
Sources: Adrian Cowham - LiveKit Blog | Tom Shapland - LiveKit Blog | livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/tts.py | Rime TTS plugin guide | LiveKit Docs | LiveKit Pricingclever-hamburger-87073
10/31/2025, 6:49 AMtall-airline-16756
10/31/2025, 6:50 AMLIVEKIT_API_KEY and LIVEKIT_API_SECRET) to give you access to all its inference services, including LLM, STT, and TTS models.
Behind the scenes, LiveKit takes care of managing the credentials for the underlying LLM providers like OpenAI and Google. So, all you need to do is provide your LiveKit API key and secret, which you can set as environment variables or include directly in your client configuration.
Now, if you’re using plugins to connect directly to third-party LLM providers such as Azure OpenAI or AWS Bedrock, then you will need provider-specific API keys. Just keep in mind, this is separate from LiveKit’s managed inference service.
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/llm.py | agents/src/inference/llm.ts | Kimi LLM | LiveKit Docs | Qwen LLM | LiveKit Docs | livekit-api/src/lib.rsclever-hamburger-87073
10/31/2025, 6:52 AMtall-airline-16756
10/31/2025, 6:52 AMOPENAI_API_KEY or DEEPGRAM_API_KEY).
• Use the provider-specific plugins in your code, like openai.LLM() or deepgram.STT(), which will automatically pick up these keys from your environment.
• Or, if you prefer, you can pass the API key directly when creating the plugin.
Keep in mind, third-party keys are only necessary if you want to bypass LiveKit’s gateway or access certain features or models not available through it. For most of your needs, your LiveKit credentials will do the job just fine.
Sources: Tom Shapland - LiveKit Blog | .env.example | .env.example | .env.example | AI Service Plugin System | livekit/livekit_composite | DeepWikiclever-hamburger-87073
10/31/2025, 6:53 AMtall-airline-16756
10/31/2025, 6:53 AM.env file:
OPENAI_API_KEY=your-openai-key
DEEPGRAM_API_KEY=your-deepgram-key
2. Use Provider-Specific Plugins:
Next, in your code, use the right plugin for your provider. Here’s an example in JavaScript:
import { openai, deepgram } from '@livekit/agents-plugin';
const session = new voice.AgentSession({
stt: new deepgram.STT(), // This will use your DEEPGRAM_API_KEY
llm: new openai.LLM() // This will use your OPENAI_API_KEY
});
3. Pass the API Key Directly (Optional):
If you’d rather, you can also pass the API key directly when creating the plugin instance:
const llm = new openai.LLM({ apiKey: 'your-openai-key' });
With these steps, the plugins will seamlessly use the API keys you provide to connect to the third-party services. If you have any questions or need further help, feel free to ask—I’m here to support you!