{"record":{"id":"4f5c3c537e04ff0b","repo":"Mintplex-Labs/anything-llm","slug":"ppio-api-key-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"PPIO API Key must be provided to use agents.","messagePattern":"PPIO API Key must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":237,"sourceCode":"          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.\");\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\":","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L219-L255","documentation":"Thrown by AgentHandler.checkSetup() (server/utils/agents/index.js:236) when the workspace agent provider is 'ppio' but PPIO_API_KEY is unset/empty. PPIO provides hosted LLM inference behind this single key, which is the only credential the guard validates.","triggerScenarios":"An agent invocation runs with workspace.agentProvider === 'ppio' while PPIO_API_KEY is absent from process.env. Path: #providerSetupAndCheck() -> checkSetup() at index.js:476.","commonSituations":"PPIO selected in System > LLM Preference without a key; key from ppio not pasted into .env; .env edited but the server not restarted; key revoked.","solutions":["Create a key in the PPIO console and set PPIO_API_KEY in .env.","Restart AnythingLLM to reload process.env.","Validate with curl -H 'Authorization: Bearer $PPIO_API_KEY' against the PPIO models endpoint.","Confirm the agent model is a PPIO-supported model id."],"exampleFix":"// before (.env)\n// PPIO_API_KEY=\n\n// after (.env)\nPPIO_API_KEY=...your-ppio-key","handlingStrategy":"validation","validationCode":"const key = process.env.PPIO_API_KEY;\nif (!key) {\n  throw new Error(\n    'Cannot start PPIO agent: set PPIO_API_KEY (from the PPIO console) in .env.'\n  );\n}","typeGuard":null,"tryCatchPattern":"try {\n  await agentHandler.start();\n} catch (e) {\n  if (/PPIO API Key must be provided/.test(e.message)) {\n    return respondConfigError('ppio', ['PPIO_API_KEY']);\n  }\n  throw e;\n}","preventionTips":["Create the key in the PPIO console and write it to .env immediately.","Restart AnythingLLM so process.env reloads.","Add a startup provider->env-var validator.","Keep .env out of version control."],"tags":["agents","llm-provider","ppio","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"}