lively-diamond-77676
12/29/2025, 11:00 AMtall-airline-16756
12/29/2025, 11:00 AMtall-airline-16756
12/29/2025, 11:01 AMstt: ... portion of your AgentSession or equivalent code). Is it inference.STT, a provider plugin (Deepgram, etc.), or a model string like "deepgram/nova-3"?
• Any STT-related logs (look for transcription events, errors, or VAD events). In particular, output from:
◦ session.stt.on("metrics_collected", ...)
◦ session.stt.on("eou_metrics_collected", ...)
• Confirmation that the agent is subscribed to the user’s audio track (is audio actually being published/subscribed in the LiveKit room?).
• Whether you have an API key set for the STT provider and which provider you’re using.
Quick checklist you can verify now:
• Agent is connected and subscribed to the participant audio track.
• STT provider API key is present and valid.
• VAD settings aren’t preventing speech detection (too strict).
• STT mode (streaming vs non-streaming) matches the provider requirements.
Send the requested code snippets and the STT/VAD logs and I’ll pinpoint the failure and give exact steps to fix it.
Sources: STT Metrics | LiveKit docslively-diamond-77676
12/29/2025, 11:02 AMtall-airline-16756
12/29/2025, 11:02 AMDEEPGRAM_API_KEY present and valid in the environment where the agent runs?
• Room/agent connection: Is the agent actually joined to the LiveKit room when audio should be processed? (Confirm connection status/log line showing join success.)
• Audio subscription: Is the agent subscribed to the participant’s audio track? If you handle tracks manually, ensure you subscribe and stream frames into Deepgram (example below). If you use AgentSession, confirm you called await session.start(...).
• STT/VAD logs: Paste output for these events if available:
◦ session.stt.on("metrics_collected", ...)
◦ session.stt.on("eou_metrics_collected", ...)
◦ Any errors emitted by the STT stream or Deepgram client
• VAD behavior: Could VAD be ignoring speech? Try temporarily relaxing VAD sensitivity or logging VAD decisions to confirm voice activity is detected.
• Streaming loop (if manual): If you process tracks yourself, confirm you stream frames into Deepgram. Example pattern:
@room.on("track_subscribed")
async (track) => {
if (track.kind === TrackKind.KIND_AUDIO) {
const audioStream = new AudioStream(track);
const sttStream = stt.stream();
for await (const frame of audioStream) {
sttStream.pushFrame(frame);
}
}
}
If you share the STT/VAD logs and a short snippet showing how you start the session or subscribe to tracks, I’ll pinpoint the failure and give exact steps to fix it.
Sources: Silero VAD plugin | LiveKit docs | Pipeline Translator Agent | LiveKit docs | Simple Call Answering Agent | LiveKit docs | livekit/livekit_composite | DeepWikilively-diamond-77676
12/29/2025, 11:03 AMagent-starter-node@1.0.0 dev /home/abdullah/work/livekit_demo/livekit_p1_be
tsx src/agent.ts dev[dotenv@17.2.3] injecting env (10) from .env.local -- tip: 👥 sync secrets across teammates & machines: https://dotenvx.com/ops [155138.591] INFO (1305350): starting worker version: "0.1.0" [155138.637] INFO (1305350): Server is listening on port 40325 [155200.543] INFO (1305350): registered worker version: "0.1.0" id: "AW_Mnk5ibutEncV" server_info: { "edition": "Cloud", "version": "1.9.9", "protocol": 16, "region": "India West", "nodeId": "NC_OMUMBAI1A_GHAq2fmCHKDe", "debugInfo": "", "agentProtocol": 0 } [155214.096] INFO (1305350): received job request version: "0.1.0" jobId: "AJ_GJGU4z9htKQs" resuming: false agentName: "" [dotenv@17.2.3] injecting env (0) from .env.local -- tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit VAAPI is supported. [155225.612] WARN (1308432): room not connect after job_entry was called after 10 seconds, jobID: "AJ_GJGU4z9htKQs" [155316.054] INFO (1308432): mainTask: draining and no more speech tasks [155316.055] INFO (1308432): AgentActivity mainTask: exiting [155316.051] DEBUG (lk-rtc/1308432): Connect callback received [155343.041] WARN (1305350): job is unresponsive [155937.448] INFO (1305350): received job request version: "0.1.0" jobId: "AJ_G9trLR8W2WsB" resuming: false agentName: "" [dotenv@17.2.3] injecting env (0) from .env.local -- tip: 🗂️ backup and recover secrets: https://dotenvx.com/ops VAAPI is supported. [155941.951] INFO (1336953): participantValue.trackPublications participantValue: "voice_assistant_user_9791" trackPublications: [ { "info": { "sid": "TR_AMiXncHGTdFddT", "name": "", "kind": "KIND_AUDIO", "source": "SOURCE_MICROPHONE", "simulcasted": false, "width": 0, "height": 0, "mimeType": "audio/red", "muted": false, "remote": true, "encryptionType": "NONE", "audioFeatures": [ "TF_AUTO_GAIN_CONTROL", "TF_ECHO_CANCELLATION", "TF_NOISE_SUPPRESSION" ] }, "ffiHandle": {}, "subscribed": false } ] lengthOfTrackPublications: 1 [155941.947] DEBUG (lk-rtc/1336953): Connect callback received [155944.891] INFO (1336953): STT metrics audioDurationMs: 1100 [155944.913] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 70 inferenceCount: 1 User said: Is that, like, [155945.835] INFO (1336953): starting preemptive generation newTranscript: "Is that, like," transcriptConfidence: 0.58081055 [155945.836] INFO (1336953): Creating speech handle speech_id: "speech_79e62193-e74" [155947.089] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 49 inferenceCount: 1 User said: Is User said: Is that [155947.843] INFO (1336953): starting preemptive generation newTranscript: "Is that, like, Is that" transcriptConfidence: 0.776245125 [155947.844] INFO (1336953): Creating speech handle speech_id: "speech_e34a3c65-40f" [155948.344] INFO (1336953): LLM metrics ttftMs: -1 inputTokens: 0 promptCachedTokens: 0 outputTokens: 0 tokensPerSecond: 0 [155949.682] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 59 inferenceCount: 1 [155949.981] INFO (1336953): STT metrics audioDurationMs: 3700 [155950.237] INFO (1336953): LLM metrics ttftMs: -1 inputTokens: 0 promptCachedTokens: 0 outputTokens: 0 tokensPerSecond: 0 [155955.713] INFO (1336953): EOU metrics endOfUtteranceDelayMs: 6000 transcriptionDelayMs: 0 onUserTurnCompletedDelayMs: 0 [160002.882] INFO (1336953): STT metrics audioDurationMs: 900 [160022.781] INFO (1336953): STT metrics audioDurationMs: 1800 [160035.478] INFO (1336953): STT metrics audioDurationMs: 1100 [160041.359] INFO (1336953): STT metrics audioDurationMs: 1700 [160114.881] INFO (1336953): STT metrics audioDurationMs: 1100 [160114.899] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 1553 inferenceCount: 1 [160127.881] INFO (1336953): STT metrics audioDurationMs: 1900 [160136.679] INFO (1336953): STT metrics audioDurationMs: 1100 [160142.559] INFO (1336953): STT metrics audioDurationMs: 1100 [160144.081] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 722 inferenceCount: 1 [160147.252] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 79 inferenceCount: 1 [160147.581] INFO (1336953): STT metrics audioDurationMs: 3700 [160212.343] INFO (1336953): VAD metrics idleTimeMs: 0 inferenceDurationTotalMs: 595 inferenceCount: 1 [160212.373] INFO (1336953): STT metrics audioDurationMs: 1500 [160312.160] INFO (1336953): STT metrics audioDurationMs: 1300 [160317.684] INFO (1336953): STT metrics audioDurationMs: 1300
tall-airline-16756
12/29/2025, 11:04 AMnewTranscript: "Is that, like,").
• VAD is detecting voice (VAD metrics present, idleTimeMs: 0).
• The agent is seeing the participant’s audio track (trackPublications shows a remote audio track).
What’s not happening:
• The LLM never receives input (LLM metrics show ttftMs: -1 and inputTokens: 0).
Most likely causes to check (please confirm each):
• OpenAI LLM initialization: Can you confirm OPENAI_API_KEY is set and valid in the same environment the agent runs in? If the key is missing/invalid the LLM won’t accept transcripts.
• Model name: Verify the model string gpt-4.1-mini is a valid model name for your OpenAI client. If the model name is invalid the LLM client may fail to create a usable session. Share any LLM-related errors if present.
• Errors from LLM calls: Look for error logs or exceptions when the agent attempts to call the LLM (there are no LLM error lines in the logs you pasted). If you can, enable/collect debug logs around the LLM call to see failures.
• Preemptive generation flow: You have preemptiveGeneration: true. Confirm the code path that forwards STT transcripts into the LLM is executing. The STT logs show transcripts and "starting preemptive generation" but the LLM never reports tokens — this suggests the transcripts aren’t making it into the LLM request (or the request is failing silently).
• Subscription flag: Your trackPublications shows "subscribed": false. Ensure the agent is actually subscribed to the published audio track (AgentSession normally subscribes automatically, but if subscription failed, STT may have fallback audio or partial frames — double-check that subscription becomes true when the user speaks).
Next steps I can help with — please provide one of these:
• LLM error logs or uncaught exceptions around the time transcripts are sent.
• The code snippet that forwards transcripts to llm (where you call llm.generate(...) or similar) or your AgentSession start code (await session.start(...)).
• Confirmation of OPENAI_API_KEY and the exact model name you intend to use.
If you share the LLM call code or LLM error output, I’ll pinpoint the exact fix and the minimal changes to make the LLM receive the transcripts.lively-diamond-77676
12/29/2025, 11:07 AMtall-airline-16756
12/29/2025, 11:08 AMlively-diamond-77676
12/29/2025, 11:13 AMtall-airline-16756
12/29/2025, 11:13 AMOPENAI_API_KEY is in the environment where your agent runs (e.g., .env, CI, or process env).
• In your agent process, log or print process.env.OPENAI_API_KEY presence (do not log the actual key in production).
1. Test the key with a simple API request
• Run from the machine where your agent runs:
curl <https://api.openai.com/v1/models> \
-H "Authorization: Bearer YOUR_API_KEY"
• A successful response returns a list of models. A 401/403 means the key is invalid or unauthorized.
1. Check usage and billing on OpenAI
• Sign in and open: https://platform.openai.com/usage
• View recent usage, token counts, and costs. This shows whether requests are being billed.
1. Troubleshooting tips
• If the curl returns 401/403: regenerate an API key at https://platform.openai.com/api-keys and update OPENAI_API_KEY in your environment, then restart the agent.
• If keys are valid but you see no usage: confirm your agent actually makes LLM calls (enable debug logs around the LLM request) and check for silent errors in your agent logs.
• For local testing, temporarily run a single LLM request (e.g., curl above or a small chat.completions call) from the same host to ensure network/Egress to api.openai.com is allowed.
If you want, tell me whether you prefer to test via curl or from your Node process and I’ll give the exact command/snippet.
Sources: OpenAI STT plugin guide | LiveKit docslively-diamond-77676
12/29/2025, 2:07 PMtall-airline-16756
12/29/2025, 2:08 PMexport OPENAI_API_KEY="your_api_key_here"
curl <https://api.openai.com/v1/chat/completions> \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role":"user","content":"Hello, are you working?"}]
}'
• 200 response with a choices array means the key and network are working.
• 401/403 means the key is invalid or unauthorized.
2) Node.js (quick test script)
// test-openai.js
import fetch from "node-fetch";
const key = process.env.OPENAI_API_KEY;
if (!key) throw new Error("Set OPENAI_API_KEY in your env");
const res = await fetch("<https://api.openai.com/v1/chat/completions>", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${key}`,
},
body: JSON.stringify({
model: "gpt-3.5-turbo",
messages: [{ role: "user", content: "Hello, are you working?" }]
}),
});
const data = await res.json();
console.log(res.status, JSON.stringify(data, null, 2));
Run:
export OPENAI_API_KEY="your_api_key_here"
node test-openai.js
If you get a successful response but your agent still shows ttftMs: -1, paste the agent logs around the LLM call or the snippet where you call llm.generate(...) and I’ll help trace why transcripts aren’t reaching the LLM.
Sources: OpenAI LLM plugin guide | LiveKit docslively-diamond-77676
12/29/2025, 2:10 PMtall-airline-16756
12/29/2025, 2:10 PMOPENAI_API_KEY) after restarting it.
4) Quick tests after fixing
• Re-run the curl chat completion test you used earlier. A 200 response confirms the key/billing is ok.
• If you still get quota errors but your billing page shows active payment method and no limits, send me the output of curl <https://api.openai.com/v1/models> -H "Authorization: Bearer $OPENAI_API_KEY" (redact the key) and the timestamp of the failed request — I’ll help interpret the response.
5) Alternatives if you prefer not to add payment details
• Use LiveKit Inference (LiveKit handles billing) if available on your plan. Tell me if you want steps for switching to LiveKit Inference.
Tell me which step you took and paste any billing/usage lines or the models curl response and I’ll guide the exact next action.lively-diamond-77676
12/29/2025, 2:46 PMtall-airline-16756
12/29/2025, 2:46 PMlively-diamond-77676
12/29/2025, 2:47 PMtall-airline-16756
12/29/2025, 2:47 PMlively-diamond-77676
12/29/2025, 2:50 PMtall-airline-16756
12/29/2025, 2:50 PMopenai/gpt-4.1-mini, GPT-5 variants)
• Google Gemini (e.g., google/gemini-2.5-pro, google/gemini-2.5-flash)
• Qwen (e.g., qwen/qwen3-235b-a22b-instruct)
• Kimi (e.g., moonshotai/kimi-k2-instruct)
• DeepSeek (e.g., deepseek-ai/deepseek-v3)
Plugin / Provider Integrations (bring-your-own API key)
• Anthropic (Claude family)
• Amazon Bedrock (AWS-hosted models)
• Groq (high-speed Llama/Mixtral)
• Mistral AI (Mistral, Mixtral)
• Azure OpenAI (Azure-hosted OpenAI models)
• Cerebras
• DeepSeek (direct plugin)
• Fireworks AI
• OpenRouter (unified access to multiple models)
• Perplexity
• Telnyx
• Together AI
• xAI (Grok)
• Letta
• Baseten
Self-host / Local
• Ollama — run Llama‑3, Phi‑3, and other open models locally (no API fees; requires hardware/ops).
Free / low-cost friendly options
• Ollama (local, no API cost)
• LiveKit Cloud free inference credits (small monthly allotment)
• Some providers offer signup credits or trial tiers (OpenAI, Google Cloud, Together AI, Groq, Perplexity, Baseten) — check the provider for current offers
• Inworld TTS had time-limited free promos for TTS (not LLM)
If you want, tell me:
• Do you prefer a hosted (LiveKit Inference) model or a plugin with your own provider key?
• Any constraints (budget, latency, on‑prem hardware)?
I’ll recommend 2–3 specific models/plugins and give the exact config snippet for your AgentSession.
Sources: Large language models (LLM) | LiveKit Docs | Ollama LLM plugin guide | LiveKit docs | Groq LLM plugin guide | LiveKit docs | Perplexity LLM plugin guide | LiveKit docs | DeepSeek LLM plugin guide | LiveKit docslively-diamond-77676
12/29/2025, 2:51 PMtall-airline-16756
12/29/2025, 2:51 PMpnpm add @livekit/agents-plugin-openai@1.x
Other providers (Google, Ollama, etc.) have their own plugin packages (e.g., @livekit/agents-plugin-google).
• Auth: each plugin requires you to set the provider API key in env vars (e.g., GOOGLE_API_KEY, GROQ_API_KEY, OLLAMA_BASE_URL) and restart your agent.
• Ollama is for local self‑hosting (no API fees but needs local hardware).
• LiveKit Inference is an alternative if you prefer LiveKit-hosted models (no plugin key needed; set model_id).
If you tell me which 2–3 providers you’re interested in, I’ll give the exact Node.js install command and the minimal AgentSession snippet for that provider.
Sources: Large language models (LLM) | LiveKit Docs | Perplexity LLM plugin guide | LiveKit docs | Cerebras LLM plugin guide | LiveKit docs | Fireworks AI LLM plugin guide | LiveKit docs | xAI LLM plugin guide | LiveKit docslively-diamond-77676
12/29/2025, 2:52 PMtall-airline-16756
12/29/2025, 2:52 PMlively-diamond-77676
12/29/2025, 2:53 PMtall-airline-16756
12/29/2025, 2:53 PMlively-diamond-77676
12/29/2025, 3:02 PMtall-airline-16756
12/29/2025, 3:02 PMlively-diamond-77676
12/30/2025, 4:25 AMtall-airline-16756
12/30/2025, 4:25 AMlively-diamond-77676
12/30/2025, 4:28 AMtall-airline-16756
12/30/2025, 4:28 AMlively-diamond-77676
12/30/2025, 4:30 AMtall-airline-16756
12/30/2025, 4:30 AMnpm install -g @livekit/cli
1. Authenticate the CLI with your cloud API key:
livekit login --api-key YOUR_LIVEKIT_API_KEY
1. Get project usage (month-to-date):
livekit usage get --project PROJECT_ID --range month
• This returns usage lines (agent minutes, inference, WebRTC, etc.). Look for inference/LLM rows and their cost/amount.
1. Export CSV (if supported) for easier math:
livekit usage export --project PROJECT_ID --range month --output usage.csv
• Open usage.csv and find the inference lines; compute remaining = plan included credits − cost used.
Option B — LiveKit Cloud REST API
1. Obtain your LiveKit Cloud API key from Project → Settings.
2. Fetch usage (replace PROJECT_ID and YOUR_API_KEY):
curl -H "Authorization: Bearer YOUR_API_KEY" \
"<https://api.livekit.cloud/v1/projects/PROJECT_ID/usage?range=month>"
• Response includes resource usage entries. Find entries for inference/LLM and check amount and cost.
1. Compute remaining inference credits:
◦ Get plan included credits from project billing (dashboard or API).
◦ Remaining = included_inference_credits - sum(cost of inference usage from API response).
Notes and tips
• The CLI usage get response shows the same rows you saw in the dashboard; export CSV to compute remaining easily.
• If the API path above returns 404 or differs, open your project settings page for the exact API base returned there (some accounts expose region-specific endpoints).
• If you want, paste the JSON output (redact secrets) and I’ll compute the remaining inference credits for you.
Tell me which option you prefer (CLI or API) and I’ll give the exact command with your PROJECT_ID format and a sample of how to parse the returned JSON to get the inference cost.lively-diamond-77676
12/30/2025, 4:33 AMtall-airline-16756
12/30/2025, 4:34 AMnpm install -g @livekit/cli
• Log in (this links your CLI to your Cloud account):
lk cloud auth
Follow the browser flow. After success, run:
lk usage get --project PROJECT_ID --range month
Or export CSV:
lk usage export --project PROJECT_ID --range month --output usage.csv
2) If you must call the API directly: generate a JWT (do NOT use API secret as Bearer)
• Node.js example (generate short-lived JWT):
// npm i livekit-server-sdk
import { AccessToken } from "livekit-server-sdk";
const at = new AccessToken("YOUR_API_KEY", "YOUR_API_SECRET");
at.ttl = 600; // seconds
const jwt = at.toJwt();
console.log(jwt);
• Use that JWT as Authorization:
curl -H "Authorization: Bearer <JWT>" \
"<https://api.livekit.cloud/v1/projects/PROJECT_ID/usage?range=month>"
(If your project uses a region subdomain, use the project’s exact API base URL shown in the Cloud dashboard.)
3) How to compute remaining inference credits
• Find your plan’s included inference credits on Cloud → Project → Billing/Plan.
• From lk usage get or the API response, locate LLM/inference rows and note cost or token counts.
• Remaining = included_credits − sum(inference_costs) (export CSV to compute precisely).
4) Troubleshooting tips
• “Invalid authorization token” means you passed the raw API key or secret as Bearer. Generate a JWT as above.
• Ensure PROJECT_ID and API base URL match the project shown in cloud.livekit.io.
• If lk cloud auth fails, clear CLI cache (~/.livekit/) and retry.
• Paste the JSON output from the curl (redact secrets) and I can compute remaining credits for you.
If you want, tell me which option you prefer (CLI or API) and your PROJECT_ID format, and I’ll provide the exact command with placeholders ready to run.
Sources: Deploying to production | LiveKit Docs | Server-side | livekit/livekit_composite | DeepWikilively-diamond-77676
12/30/2025, 4:35 AMtall-airline-16756
12/30/2025, 4:35 AMlk usage (or lk usage get ...)? Paste the error text.
While you paste that, try these checks in order:
1) Re-authenticate the CLI (recommended)
• Run:
lk cloud auth
Complete the browser flow. After success, retry:
lk usage get --project PROJECT_ID --range month
2) Ensure CLI is installed and up to date
• Reinstall/update:
npm install -g @livekit/cli
lk --version
3) Verify CLI config and saved credentials
• Open: ~/.livekit/config.json (or ~/.livekit/credentials) and confirm a valid session exists.
• If corrupt, remove ~/.livekit/ and run lk cloud auth again.
4) If you must use API keys, generate a JWT and call the API directly
• Generate JWT (Node.js):
// npm i livekit-server-sdk
import { AccessToken } from "livekit-server-sdk";
const at = new AccessToken("YOUR_API_KEY","YOUR_API_SECRET");
at.ttl = 600;
const jwt = at.toJwt();
console.log(jwt);
• Call usage endpoint:
curl -H "Authorization: Bearer <JWT>" \
"<https://api.livekit.cloud/v1/projects/PROJECT_ID/usage?range=month>"
(Use your project’s exact API base URL from the Cloud dashboard if different.)
5) Common causes and fixes
• Error: “invalid authorization token” → you passed API secret as Bearer. Generate JWT instead.
• Error: “forbidden/unauthorized” → wrong PROJECT_ID or JWT signed with different project keys.
• Error: network/502 → try again or confirm correct API base URL for your region.
Send me:
• The exact lk command you ran and the full error output, and
• Your PROJECT_ID (or confirm you want me to use placeholders)
I’ll diagnose the error immediately and give the exact command that will work.lively-diamond-77676
12/30/2025, 4:38 AMtall-airline-16756
12/30/2025, 4:39 AMlk usage isn't a valid command. To get inference usage/remaining with the CLI or API, follow one of these exact paths.
Option A — Quick & reliable: Cloud dashboard (recommended)
• Go to: https://cloud.livekit.io → select your project → Billing / Usage or Plan details.
• The dashboard shows included inference credits; your monthly usage lines (tokens / minutes) are the consumption. Remaining = included allowance − consumed amount.
Option B — CLI via browser auth (works without creating JWT manually)
1. Install/update CLI:
npm install -g @livekit/cli
1. Authenticate via browser:
lk cloud auth
Complete the web flow. This stores credentials in ~/.livekit/.
1. Get project usage (month-to-date):
lk cloud usage get --project PROJECT_ID --range month
If that subcommand is unavailable on your CLI version, export CSV:
lk cloud usage export --project PROJECT_ID --range month --output usage.csv
Option C — Direct API (requires JWT signed with your project key/secret)
1. Generate short-lived JWT (Node.js):
// npm i livekit-server-sdk
import { AccessToken } from "livekit-server-sdk";
const at = new AccessToken("YOUR_API_KEY","YOUR_API_SECRET");
at.ttl = 600;
const jwt = at.toJwt();
console.log(jwt);
1. Call usage endpoint (replace API base with your project URL if different):
curl -H "Authorization: Bearer <JWT>" \
"<https://api.livekit.cloud/v1/projects/PROJECT_ID/usage?range=month>"
1. From the JSON, locate inference/LLM entries and use cost or amount to compute remaining:
Remaining = plan_included_inference_credits − sum(inference_costs)
Troubleshooting common failures
• "invalid authorization token": you passed the API secret or API key as Bearer. Do NOT do that — generate a JWT as shown.
• lk cloud auth fails: remove ~/.livekit/ credentials and retry. Confirm lk --version is up to date.
• If lk cloud usage get subcommand isn't present, use lk cloud usage export or the API + JWT method above.
If you want, paste:
• The exact lk command you ran and the full error output, OR
• The JSON returned by the API call (redact secrets)
I’ll parse it and compute your remaining inference credits for this month. Which do you prefer me to help with: CLI auth fix, run the API call for you (you paste output), or compute remaining from your usage CSV?lively-diamond-77676
12/30/2025, 4:42 AMtall-airline-16756
12/30/2025, 4:42 AMlk cloud auth and follow the flow.
Two working ways to get usage (pick one)
A) Recommended — CLI via browser auth
1. Install/update CLI:
npm install -g @livekit/cli
1. Authenticate (opens browser):
lk cloud auth
1. Get monthly usage (replace PROJECT_ID):
lk cloud usage get --project PROJECT_ID --range month
1. Or export CSV:
lk cloud usage export --project PROJECT_ID --range month --output usage.csv
If lk cloud auth fails, remove ~/.livekit/ then retry.
B) Direct API (requires JWT signed with project API key + secret)
1. Create short‑lived JWT (Node.js):
// npm i livekit-server-sdk
import { AccessToken } from "livekit-server-sdk";
const at = new AccessToken("YOUR_API_KEY","YOUR_API_SECRET");
at.ttl = 600;
const jwt = at.toJwt();
console.log(jwt);
1. Call usage endpoint (replace PROJECT_ID and use your project’s API base if region differs):
curl -H "Authorization: Bearer <JWT>" \ "https://api.livekit.cloud/v1/projects/PROJECT_ID/usage?range=month"
1. In the JSON, locate LLM / inference rows and use cost (or amount) to compute remaining:
Remaining = plan_included_inference_credits − sum(inference_costs)
If you still get “invalid API key for domain”
• Confirm you’re using the Cloud project keys (Project → Settings → API keys at cloud.livekit.io).
• Ensure LIVEKIT_URL or CLI flags point to the Cloud domain (no localhost). Example env:
export LIVEKIT_API_KEY=your_api_key export LIVEKIT_API_SECRET=your_api_secret export LIVEKIT_URL=https://your-subdomain.livekit.cloud
• If using direct API, verify you used the JWT generated by the same API key/secret for that project.
If you want, paste:
• The exact command you ran and the full error output, OR
• The JWT (redact) and curl response body — I’ll diagnose immediately and compute your remaining inference credits. Which do you prefer? Sources: Voice AI quickstart | LiveKit docs | Mini tutorial: setting up a LiveKit Cloud project | Server-side | livekit/livekit_composite | DeepWiki | Deploying to production | LiveKit Docs | Python SDKs | livekit/livekit_composite | DeepWiki