{"record":{"id":"561f384e219bbbbd","repo":"FlowiseAI/Flowise","slug":"fireworks-api-key-not-found-please-set-the-firewo","errorCode":null,"errorMessage":"Fireworks API key not found. Please set the FIREWORKS_API_KEY environment variable or provide the key into \"fireworksApiKey\"","messagePattern":"Fireworks API key not found\\. Please set the FIREWORKS_API_KEY environment variable or provide the key into \"fireworksApiKey\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/components/nodes/chatmodels/ChatFireworks/core.ts","lineNumber":56,"sourceCode":"\n    get lc_secrets(): { [key: string]: string } | undefined {\n        return {\n            fireworksApiKey: 'FIREWORKS_API_KEY',\n            apiKey: 'FIREWORKS_API_KEY'\n        }\n    }\n\n    lc_serializable = true\n\n    fireworksApiKey?: string\n\n    apiKey?: string\n\n    constructor(fields?: ChatFireworksParams) {\n        const fireworksApiKey = fields?.apiKey || fields?.fireworksApiKey || getEnvironmentVariable('FIREWORKS_API_KEY')\n\n        if (!fireworksApiKey) {\n            throw new Error(\n                `Fireworks API key not found. Please set the FIREWORKS_API_KEY environment variable or provide the key into \"fireworksApiKey\"`\n            )\n        }\n\n        super({\n            ...fields,\n            model: fields?.model || fields?.modelName || 'accounts/fireworks/models/llama-v3p1-8b-instruct',\n            apiKey: fireworksApiKey,\n            configuration: {\n                baseURL: 'https://api.fireworks.ai/inference/v1'\n            },\n            streamUsage: false\n        })\n\n        this.fireworksApiKey = fireworksApiKey\n        this.apiKey = fireworksApiKey\n    }\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/chatmodels/ChatFireworks/core.ts#L38-L74","documentation":"Thrown by the ChatFireworks constructor (core.ts:56) when none of fields.apiKey, fields.fireworksApiKey, or the FIREWORKS_API_KEY environment variable resolve to a truthy value. ChatFireworks extends the LangChain OpenAI completions client and hard-codes the Fireworks baseURL; it requires the key at construction time. The constructor is synchronous, so this throws at `new ChatFireworks(...)`.","triggerScenarios":"Instantiating ChatFireworks without passing apiKey/fireworksApiKey in the fields object while FIREWORKS_API_KEY is unset in the process environment.","commonSituations":"The FIREWORKS_API_KEY env var was never added to .env (or Flowise was not restarted after editing .env), the key was removed, or code constructs the class directly without forwarding credentials.","solutions":["Add FIREWORKS_API_KEY=<your-key> to the Flowise .env file and restart the process so getEnvironmentVariable picks it up.","Pass the key explicitly: new ChatFireworks({ apiKey: process.env.FIREWORKS_API_KEY }).","In Flowise, verify the Fireworks credential component is bound to the node so the key is injected at construction."],"exampleFix":"// before: new ChatFireworks({ model: 'accounts/fireworks/models/llama-v3p1-8b-instruct' })  // FIREWORKS_API_KEY unset -> throws\n// after:  new ChatFireworks({ apiKey: process.env.FIREWORKS_API_KEY, model: 'accounts/fireworks/models/llama-v3p1-8b-instruct' })","handlingStrategy":"validation","validationCode":"function resolveFireworksKey(fields?: { apiKey?: string; fireworksApiKey?: string }): string {\n  const key = fields?.apiKey || fields?.fireworksApiKey || process.env.FIREWORKS_API_KEY\n  if (!key) throw new Error('Set FIREWORKS_API_KEY or pass apiKey/fireworksApiKey')\n  return key\n}\n// guard before construction:\nconst apiKey = resolveFireworksKey({ apiKey: process.env.FIREWORKS_API_KEY })\nnew ChatFireworks({ apiKey })","typeGuard":"function hasFireworksKey(fields: unknown): fields is { apiKey: string } | { fireworksApiKey: string } {\n  return typeof fields === 'object' && fields !== null\n    && (typeof (fields as any).apiKey === 'string' || typeof (fields as any).fireworksApiKey === 'string')\n}","tryCatchPattern":"try {\n  return new ChatFireworks(params)\n} catch (e) {\n  if (e instanceof Error && /Fireworks API key not found/.test(e.message)) {\n    // instruct the user to set FIREWORKS_API_KEY in .env and restart\n  }\n  throw e\n}","preventionTips":["Always source the key from a single place (env var) and forward it explicitly to the constructor.","Restart the Flowise process after editing .env so getEnvironmentVariable sees new values.","Add a startup health check that fails fast when required provider env vars are missing."],"tags":["credentials","configuration","fireworks","environment-variables","constructor"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}