{"record":{"id":"6cd0ad13a0003b8f","repo":"Mintplex-Labs/anything-llm","slug":"groq-api-key-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"Groq API key must be provided to use agents.","messagePattern":"Groq API key must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/agents/index.js","lineNumber":148,"sourceCode":"      case \"openai\":\n        if (!process.env.OPEN_AI_KEY)\n          throw new Error(\"OpenAI API key must be provided to use agents.\");\n        break;\n      case \"anthropic\":\n        if (!process.env.ANTHROPIC_API_KEY)\n          throw new Error(\"Anthropic API key must be provided to use agents.\");\n        break;\n      case \"lmstudio\":\n        if (!process.env.LMSTUDIO_BASE_PATH)\n          throw new Error(\"LMStudio base path must be provided to use agents.\");\n        break;\n      case \"ollama\":\n        if (!process.env.OLLAMA_BASE_PATH)\n          throw new Error(\"Ollama base path must be provided to use agents.\");\n        break;\n      case \"groq\":\n        if (!process.env.GROQ_API_KEY)\n          throw new Error(\"Groq API key must be provided to use agents.\");\n        break;\n      case \"togetherai\":\n        if (!process.env.TOGETHER_AI_API_KEY)\n          throw new Error(\"TogetherAI API key must be provided to use agents.\");\n        break;\n      case \"azure\":\n        if (!process.env.AZURE_OPENAI_ENDPOINT || !process.env.AZURE_OPENAI_KEY)\n          throw new Error(\n            \"Azure OpenAI API endpoint and key must be provided to use agents.\"\n          );\n        break;\n      case \"koboldcpp\":\n        if (!process.env.KOBOLD_CPP_BASE_PATH)\n          throw new Error(\n            \"KoboldCPP must have a valid base path to use for the api.\"\n          );\n        break;\n      case \"localai\":","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L130-L166","documentation":"checkSetup() (index.js:146-149) throws for provider === \"groq\" when process.env.GROQ_API_KEY is falsy, preventing an unauthenticated call to the Groq Cloud API.","triggerScenarios":"Selecting the groq agent provider while GROQ_API_KEY is unset or empty in the server environment.","commonSituations":"Groq provider selected without configuring the key, a typo in the env name, or a deployment that didn't inject the secret.","solutions":["Set GROQ_API_KEY in .env to a valid Groq Cloud API key.","Restart the server to reload the env.","For Docker, pass the key via the compose env block or -e.","Confirm the key is valid at console.groq.com."],"exampleFix":"# before (.env)\n# GROQ_API_KEY=\n\n# after (.env)\nGROQ_API_KEY=gsk_...validkey...","handlingStrategy":"validation","validationCode":"function groqAgentReady() {\n  return Boolean(process.env.GROQ_API_KEY && process.env.GROQ_API_KEY.trim());\n}\nif (provider === \"groq\" && !groqAgentReady())\n  throw new Error(\"Set GROQ_API_KEY before enabling the groq agent.\");","typeGuard":null,"tryCatchPattern":"try {\n  agent.checkSetup();\n} catch (e) {\n  if (/GROQ_API_KEY|API key must be provided/i.test(e.message)) {\n    throw new Error(\"Groq agent is not configured: set GROQ_API_KEY in .env and restart.\");\n  }\n  throw e;\n}","preventionTips":["Call checkSetup() at server boot.","Restart after setting the key in .env.","Pass the key via Docker env in deployments.","Verify the key at console.groq.com before enabling."],"tags":["groq","config","env","auth","agents"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}