{"record":{"id":"84ab925c5297cc59","repo":"Mintplex-Labs/anything-llm","slug":"giteeai-api-key-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"GiteeAI API Key must be provided to use agents.","messagePattern":"GiteeAI API Key must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":257,"sourceCode":"      case \"gemini\":\n        if (!process.env.GEMINI_API_KEY)\n          throw new Error(\"Gemini API key must be provided to use agents.\");\n        break;\n      case \"moonshotai\":\n        if (!process.env.MOONSHOT_AI_MODEL_PREF)\n          throw new Error(\"Moonshot AI model must be set to use agents.\");\n        break;\n      case \"cometapi\":\n        if (!process.env.COMETAPI_LLM_API_KEY)\n          throw new Error(\"CometAPI API Key must be provided to use agents.\");\n        break;\n      case \"foundry\":\n        if (!process.env.FOUNDRY_BASE_PATH)\n          throw new Error(\"Foundry base path must be provided to use agents.\");\n        break;\n      case \"giteeai\":\n        if (!process.env.GITEE_AI_API_KEY)\n          throw new Error(\"GiteeAI API Key must be provided to use agents.\");\n        break;\n      case \"cohere\":\n        if (!process.env.COHERE_API_KEY)\n          throw new Error(\"Cohere API key must be provided to use agents.\");\n        break;\n      case \"docker-model-runner\":\n        if (!process.env.DOCKER_MODEL_RUNNER_BASE_PATH)\n          throw new Error(\n            \"Docker Model Runner base path must be provided to use agents.\"\n          );\n        break;\n      case \"privatemode\":\n        if (!process.env.PRIVATEMODE_LLM_BASE_PATH)\n          throw new Error(\n            \"Privatemode base path must be provided to use agents.\"\n          );\n        break;\n      case \"sambanova\":","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L239-L275","documentation":"Thrown by checkSetup() (server/utils/agents/index.js:128) when the resolved agent provider is 'giteeai' but process.env.GITEE_AI_API_KEY is unset/empty. It is a precondition gate inside agent.init() that blocks the Gitee AI provider client from being constructed without credentials.","triggerScenarios":"A chat turn calls agent.init(); this.provider resolves to 'giteeai' (workspace.agentProvider or LLM_PROVIDER fallback); case 'giteeai' runs and process.env.GITEE_AI_API_KEY is falsy.","commonSituations":"Gitee AI chosen as agent provider but the API key never pasted/saved; .env changed but server not restarted; deployment moved to a new host and the secret env was not propagated.","solutions":["Set GITEE_AI_API_KEY in .env to a valid Gitee AI key and restart the server.","Verify the running process actually has the key (log its presence, never its value) - containers may need recreate.","If Gitee AI is not desired, change the workspace/system provider to one that is configured."],"exampleFix":"// before (.env)\nGITEE_AI_API_KEY=\n// after (.env)\nGITEE_AI_API_KEY=<your-gitee-ai-key>","handlingStrategy":"validation","validationCode":"function assertGiteeAiReady(workspaceAgentProvider) {\n  const using = workspaceAgentProvider === 'giteeai' || process.env.LLM_PROVIDER === 'giteeai';\n  if (using && !process.env.GITEE_AI_API_KEY)\n    throw new Error('GITEE_AI_API_KEY missing - set it before starting an agent.');\n}","typeGuard":null,"tryCatchPattern":"try { await agent.init(); } catch (e) { if (/GiteeAI API Key must be provided/.test(e.message)) return showProviderConfig('giteeai'); throw e; }","preventionTips":["Treat API keys as required boot dependencies for their provider.","Restart after .env edits.","Probe key presence (not value) at startup."],"tags":["config","env","agent-provider","giteeai","api-key","agents"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}