Mintplex-Labs/anything-llm · error · Error

Novita API Key must be provided to use agents.

Error message

Novita API Key must be provided to use agents.

What it means

Provider setup guard in AgentHandler.checkSetup: the selected agent provider is 'novita' but NOVITA_LLM_API_KEY is empty/unset, so the agent has no credential for Novita's inference API and setup aborts.

Solutions

  1. Set the NOVITA_LLM_API_KEY environment variable.
  2. Or select a different agent provider.
Defensive patterns

Strategy: validation

When it happens

Trigger: Novita was selected as the agent provider but no API key is configured.

Common situations: This error is raised at runtime in server/utils/agents/index.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.


AI-assisted analysis of Mintplex-Labs/anything-llm@20f6d3546c (2026-08-18). Data as JSON: /api/errors/808ba66b20c0318a. Report an issue: GitHub.

Appendix: source

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

          throw new Error(
            "LiteLLM API base path and key must be provided to use agents."
          );
        break;
      case "apipie":
        if (!process.env.APIPIE_LLM_API_KEY)
          throw new Error("ApiPie API Key must be provided to use agents.");
        break;
      case "xai":
        if (!process.env.XAI_LLM_API_KEY)
          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.");

View on GitHub (pinned to 20f6d3546c)