Mintplex-Labs/anything-llm · error · Error

FireworksAI API Key must be provided to use agents.

Error message

FireworksAI API Key must be provided to use agents.

What it means

Thrown by AgentHandler.checkSetup() (server/utils/agents/index.js:198) when the workspace agent provider is 'fireworksai' but FIREWORKS_AI_LLM_API_KEY is unset/empty. Fireworks AI serves hosted open-source models behind this key, which is the only credential the guard validates.

Source

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

        if (!process.env.GENERIC_OPEN_AI_BASE_PATH)
          throw new Error("API base path must be provided to use agents.");
        break;
      case "perplexity":
        if (!process.env.PERPLEXITY_API_KEY)
          throw new Error("Perplexity API key must be provided to use agents.");
        break;
      case "textgenwebui":
        if (!process.env.TEXT_GEN_WEB_UI_BASE_PATH)
          throw new Error(
            "TextWebGenUI API base path must be provided to use agents."
          );
        break;
      case "bedrock":
        // No validations since there are many possible authentication methods
        break;
      case "fireworksai":
        if (!process.env.FIREWORKS_AI_LLM_API_KEY)
          throw new Error(
            "FireworksAI API Key must be provided to use agents."
          );
        break;
      case "deepseek":
        if (!process.env.DEEPSEEK_API_KEY)
          throw new Error("DeepSeek API Key must be provided to use agents.");
        break;
      case "litellm":
        if (!process.env.LITE_LLM_BASE_PATH)
          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":

View on GitHub (pinned to 526360e320)

Solutions

  1. Create a key at https://fireworks.ai/account/api-keys and set FIREWORKS_AI_LLM_API_KEY in .env.
  2. Restart AnythingLLM to reload process.env.
  3. Validate with curl -H 'Authorization: Bearer $FIREWORKS_AI_LLM_API_KEY' https://api.fireworks.ai/inference/v1/models.
  4. Confirm the workspace agent model is a valid Fireworks model id.

Example fix

// before (.env)
// FIREWORKS_AI_LLM_API_KEY=

// after (.env)
FIREWORKS_AI_LLM_API_KEY=fw_...your-key
Defensive patterns

Strategy: validation

Validate before calling

const key = process.env.FIREWORKS_AI_LLM_API_KEY;
if (!key) {
  throw new Error(
    'Cannot start FireworksAI agent: set FIREWORKS_AI_LLM_API_KEY (from fireworks.ai/account/api-keys) in .env.'
  );
}

Try / catch

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

Prevention

When it happens

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

Common situations: Fireworks AI selected in System > LLM Preference without a key; key created at fireworks.ai but never added to .env; .env edited on disk but the Node process still holds the old env; key rotated/revoked.

Related errors


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