{"record":{"id":"808ba66b20c0318a","repo":"Mintplex-Labs/anything-llm","slug":"novita-api-key-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"Novita API Key must be provided to use agents.","messagePattern":"Novita API Key must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":227,"sourceCode":"          throw new Error(\n            \"LiteLLM API base path and key must be provided to use agents.\"\n          );\n        break;\n      case \"apipie\":\n        if (!process.env.APIPIE_LLM_API_KEY)\n          throw new Error(\"ApiPie API Key must be provided to use agents.\");\n        break;\n      case \"xai\":\n        if (!process.env.XAI_LLM_API_KEY)\n          throw new Error(\"xAI API Key must be provided to use agents.\");\n        break;\n      case \"zai\":\n        if (!process.env.ZAI_API_KEY)\n          throw new Error(\"Z.AI API Key must be provided to use agents.\");\n        break;\n      case \"novita\":\n        if (!process.env.NOVITA_LLM_API_KEY)\n          throw new Error(\"Novita API Key must be provided to use agents.\");\n        break;\n      case \"nvidia-nim\":\n        if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)\n          throw new Error(\n            \"NVIDIA NIM base path must be provided to use agents.\"\n          );\n        break;\n      case \"ppio\":\n        if (!process.env.PPIO_API_KEY)\n          throw new Error(\"PPIO API Key must be provided to use agents.\");\n        break;\n      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.\");","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L209-L245","documentation":"Thrown by AgentHandler.checkSetup() (server/utils/agents/index.js:226) when the workspace agent provider is 'novita' but NOVITA_LLM_API_KEY is unset/empty. Novita AI hosts open-source models behind this key, which is the only credential validated here.","triggerScenarios":"An agent invocation runs with workspace.agentProvider === 'novita' while NOVITA_LLM_API_KEY is absent from process.env. Path: #providerSetupAndCheck() -> checkSetup() at index.js:476.","commonSituations":"Novita selected in System > LLM Preference without a key; key from novita.ai not added to .env; .env edited but the server not restarted; key revoked.","solutions":["Create a key at https://novita.ai (dashboard > API Keys) and set NOVITA_LLM_API_KEY in .env.","Restart AnythingLLM to reload process.env.","Validate with curl -H 'Authorization: Bearer $NOVITA_LLM_API_KEY' https://api.novita.ai/v3/openai/models.","Confirm the agent model is a Novita-supported model id."],"exampleFix":"// before (.env)\n// NOVITA_LLM_API_KEY=\n\n// after (.env)\nNOVITA_LLM_API_KEY=...your-novita-key","handlingStrategy":"validation","validationCode":"const key = process.env.NOVITA_LLM_API_KEY;\nif (!key) {\n  throw new Error(\n    'Cannot start Novita agent: set NOVITA_LLM_API_KEY (from novita.ai dashboard) in .env.'\n  );\n}","typeGuard":null,"tryCatchPattern":"try {\n  await agentHandler.start();\n} catch (e) {\n  if (/Novita API Key must be provided/.test(e.message)) {\n    return respondConfigError('novita', ['NOVITA_LLM_API_KEY']);\n  }\n  throw e;\n}","preventionTips":["Create the key in the Novita dashboard and paste it into .env in one step.","Restart AnythingLLM so process.env reloads.","Add a startup provider->env-var validator.","Keep .env out of version control; rotate keys periodically."],"tags":["agents","llm-provider","novita","api-key","environment-variables","config"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}