Mintplex-Labs/anything-llm · error · Error

Minimax API key must be provided to use agents.

Error message

Minimax API key must be provided to use agents.

What it means

Setup guard in checkSetup(): provider is 'minimax' but the Minimax API key environment variable is unset. Minimax cannot be authenticated, so agent initialization is refused at the configuration stage.

Solutions

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

Strategy: validation

When it happens

Trigger: Minimax 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/fc8908ef132742cc. Report an issue: GitHub.

Appendix: source

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

          throw new Error(
            "Privatemode base path must be provided to use agents."
          );
        break;
      case "sambanova":
        if (!process.env.SAMBANOVA_LLM_API_KEY)
          throw new Error("SambaNova API key must be provided to use agents.");
        break;
      case "lemonade":
        if (!process.env.LEMONADE_LLM_BASE_PATH)
          throw new Error("Lemonade base path must be provided to use agents.");
        break;
      case "omlx":
        if (!process.env.OMLX_LLM_BASE_PATH)
          throw new Error("OMLX base path must be provided to use agents.");
        break;
      case "minimax":
        if (!process.env.MINIMAX_API_KEY)
          throw new Error("Minimax API key must be provided to use agents.");
        break;
      case "cerebras":
        if (!process.env.CEREBRAS_API_KEY)
          throw new Error("Cerebras API key must be provided to use agents.");
        break;
      case "vertex":
        if (
          !process.env.VERTEX_AI_LLM_API_KEY ||
          !process.env.VERTEX_AI_LLM_PROJECT_ID
        )
          throw new Error(
            "Vertex AI API key and project ID must be provided to use agents."
          );
        break;
      default:
        throw new Error(
          "No workspace agent provider set. Please set your agent provider in the workspace's settings"
        );

View on GitHub (pinned to 20f6d3546c)