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
Thrown by checkSetup() (server/utils/agents/index.js:128) when the resolved agent provider is 'minimax' but process.env.MINIMAX_API_KEY is unset/empty. It is a precondition gate in agent.init() ensuring the Minimax client is never built without an API key.
Source
Thrown at server/utils/agents/index.js:289
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;
default:
throw new Error(
"No workspace agent provider set. Please set your agent provider in the workspace's settings"
);
}
}
/**
* Finds the default model for a given provider. If no default model is set for it's associated ENV then
* it will return a reasonable base model for the provider if one exists.
* @param {string} provider - The provider to find the default model for.
* @returns {string|null} The default model for the provider.
*/View on GitHub (pinned to 526360e320)
Solutions
- Set MINIMAX_API_KEY in .env to a valid Minimax key and restart the server.
- Verify the process loaded the key via a status probe.
- Switch provider if Minimax is not intended.
Example fix
// before (.env) MINIMAX_API_KEY= // after (.env) MINIMAX_API_KEY=<your-minimax-key>
Defensive patterns
Strategy: validation
Validate before calling
function assertMinimaxReady(workspaceAgentProvider) {
const using = workspaceAgentProvider === 'minimax' || process.env.LLM_PROVIDER === 'minimax';
if (using && !process.env.MINIMAX_API_KEY)
throw new Error('MINIMAX_API_KEY missing - set it before starting an agent.');
} Try / catch
try { await agent.init(); } catch (e) { if (/Minimax API key must be provided/.test(e.message)) return showProviderConfig('minimax'); throw e; } Prevention
- Treat API keys as required boot dependencies for their provider.
- Restart after .env edits.
- Probe key presence (not value) at startup.
When it happens
Trigger: A chat turn calls agent.init(); this.provider resolves to 'minimax'; case 'minimax' runs and process.env.MINIMAX_API_KEY is falsy.
Common situations: Minimax selected as agent provider but the key was not saved; key expired/rotated; server not restarted after .env change.
Related errors
- GiteeAI API Key must be provided to use agents.
- Cohere API key must be provided to use agents.
- SambaNova API key must be provided to use agents.
- Cerebras API key must be provided to use agents.
- Foundry base path must be provided to use agents.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/fc8908ef132742cc.
Report an issue: GitHub.