Mintplex-Labs/anything-llm · error · Error

PPIO API Key must be provided to use agents.

Error message

PPIO API Key must be provided to use agents.

What it means

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.

Source

Thrown at server/utils/agents/index.js:237

          throw new Error("xAI API Key must be provided to use agents.");
        break;
      case "zai":
        if (!process.env.ZAI_API_KEY)
          throw new Error("Z.AI API Key must be provided to use agents.");
        break;
      case "novita":
        if (!process.env.NOVITA_LLM_API_KEY)
          throw new Error("Novita API Key must be provided to use agents.");
        break;
      case "nvidia-nim":
        if (!process.env.NVIDIA_NIM_LLM_BASE_PATH)
          throw new Error(
            "NVIDIA NIM base path must be provided to use agents."
          );
        break;
      case "ppio":
        if (!process.env.PPIO_API_KEY)
          throw new Error("PPIO API Key must be provided to use agents.");
        break;
      case "gemini":
        if (!process.env.GEMINI_API_KEY)
          throw new Error("Gemini API key must be provided to use agents.");
        break;
      case "moonshotai":
        if (!process.env.MOONSHOT_AI_MODEL_PREF)
          throw new Error("Moonshot AI model must be set to use agents.");
        break;
      case "cometapi":
        if (!process.env.COMETAPI_LLM_API_KEY)
          throw new Error("CometAPI API Key must be provided to use agents.");
        break;
      case "foundry":
        if (!process.env.FOUNDRY_BASE_PATH)
          throw new Error("Foundry base path must be provided to use agents.");
        break;
      case "giteeai":

View on GitHub (pinned to 526360e320)

Solutions

  1. Create a key in the PPIO console and set PPIO_API_KEY in .env.
  2. Restart AnythingLLM to reload process.env.
  3. Validate with curl -H 'Authorization: Bearer $PPIO_API_KEY' against the PPIO models endpoint.
  4. Confirm the agent model is a PPIO-supported model id.

Example fix

// before (.env)
// PPIO_API_KEY=

// after (.env)
PPIO_API_KEY=...your-ppio-key
Defensive patterns

Strategy: validation

Validate before calling

const key = process.env.PPIO_API_KEY;
if (!key) {
  throw new Error(
    'Cannot start PPIO agent: set PPIO_API_KEY (from the PPIO console) in .env.'
  );
}

Try / catch

try {
  await agentHandler.start();
} catch (e) {
  if (/PPIO API Key must be provided/.test(e.message)) {
    return respondConfigError('ppio', ['PPIO_API_KEY']);
  }
  throw e;
}

Prevention

When it happens

Trigger: An agent invocation runs with workspace.agentProvider === 'ppio' while PPIO_API_KEY is absent from process.env. Path: #providerSetupAndCheck() -> checkSetup() at index.js:476.

Common situations: 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.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/4f5c3c537e04ff0b. Report an issue: GitHub.