Mintplex-Labs/anything-llm · error · Error
Groq API key must be provided to use agents.
Error message
Groq API key must be provided to use agents.
What it means
Setup guard in checkSetup(): provider is 'groq' but GROQ_API_KEY is unset. Without the key the Groq client cannot authenticate, so the agent session is refused during provider setup, before any inference request.
Solutions
- Set the GROQ_API_KEY environment variable.
- Or select a different agent provider.
Defensive patterns
Strategy: validation
When it happens
Trigger: Groq was selected as the agent provider but no API key is configured.
Common situations: This error is raised at runtime in server/utils/agents/index.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.
AI-assisted analysis of Mintplex-Labs/anything-llm@20f6d3546c (2026-08-18).
Data as JSON: /api/errors/6cd0ad13a0003b8f.
Report an issue: GitHub.
Appendix: source
Thrown at server/utils/agents/index.js:148
case "openai":
if (!process.env.OPEN_AI_KEY)
throw new Error("OpenAI API key must be provided to use agents.");
break;
case "anthropic":
if (!process.env.ANTHROPIC_API_KEY)
throw new Error("Anthropic API key must be provided to use agents.");
break;
case "lmstudio":
if (!process.env.LMSTUDIO_BASE_PATH)
throw new Error("LMStudio base path must be provided to use agents.");
break;
case "ollama":
if (!process.env.OLLAMA_BASE_PATH)
throw new Error("Ollama base path must be provided to use agents.");
break;
case "groq":
if (!process.env.GROQ_API_KEY)
throw new Error("Groq API key must be provided to use agents.");
break;
case "togetherai":
if (!process.env.TOGETHER_AI_API_KEY)
throw new Error("TogetherAI API key must be provided to use agents.");
break;
case "azure":
if (!process.env.AZURE_OPENAI_ENDPOINT || !process.env.AZURE_OPENAI_KEY)
throw new Error(
"Azure OpenAI API endpoint and key must be provided to use agents."
);
break;
case "koboldcpp":
if (!process.env.KOBOLD_CPP_BASE_PATH)
throw new Error(
"KoboldCPP must have a valid base path to use for the api."
);
break;
case "localai":View on GitHub (pinned to 20f6d3546c)