{"record":{"id":"12a8b9886f622fe5","repo":"FlowiseAI/Flowise","slug":"perplexity-api-key-missing-from-credential","errorCode":null,"errorMessage":"Perplexity API Key missing from credential","messagePattern":"Perplexity API Key missing from credential","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/chatmodels/ChatPerplexity/ChatPerplexity.ts","lineNumber":198,"sourceCode":"        const presencePenalty = nodeData.inputs?.presencePenalty as string\n        const frequencyPenalty = nodeData.inputs?.frequencyPenalty as string\n        const streaming = nodeData.inputs?.streaming as boolean\n        const timeout = nodeData.inputs?.timeout as string\n        const searchDomainFilterRaw = nodeData.inputs?.searchDomainFilter\n        const returnImages = nodeData.inputs?.returnImages as boolean\n        const returnRelatedQuestions = nodeData.inputs?.returnRelatedQuestions as boolean\n        const searchRecencyFilter = nodeData.inputs?.searchRecencyFilter as string\n        const proxyUrl = nodeData.inputs?.proxyUrl as string\n        const cache = nodeData.inputs?.cache as BaseCache\n\n        if (nodeData.inputs?.credentialId) {\n            nodeData.credential = nodeData.inputs?.credentialId\n        }\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const apiKey = getCredentialParam('perplexityApiKey', credentialData, nodeData)\n\n        if (!apiKey) {\n            throw new Error('Perplexity API Key missing from credential')\n        }\n\n        const obj: PerplexityChatInput = {\n            model,\n            apiKey,\n            streaming: streaming ?? true\n        }\n\n        if (temperature) obj.temperature = parseFloat(temperature)\n        if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)\n        if (topP) obj.topP = parseFloat(topP)\n        if (topK) obj.topK = parseInt(topK, 10)\n        if (presencePenalty) obj.presencePenalty = parseFloat(presencePenalty)\n        if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty)\n        if (timeout) obj.timeout = parseInt(timeout, 10)\n        if (returnImages) obj.returnImages = returnImages\n        if (returnRelatedQuestions) obj.returnRelatedQuestions = returnRelatedQuestions\n        if (searchRecencyFilter && searchRecencyFilter !== '') obj.searchRecencyFilter = searchRecencyFilter","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/chatmodels/ChatPerplexity/ChatPerplexity.ts#L180-L216","documentation":"ChatPerplexity resolves its API key via getCredentialParam('perplexityApiKey', ...) from the bound credential. If that returns falsy, Flowise refuses to construct the model. Unlike HuggingFace there is no env-var fallback in this node — the key must come from the credential component.","triggerScenarios":"nodeData.credential is unbound or points to a credential whose perplexityApiKey field is blank; the credentialId input is set but the credential name does not resolve; the user added the node without selecting a Perplexity credential.","commonSituations":"New Perplexity node added without binding a credential; wrong credential type selected (e.g. OpenAI cred bound to a Perplexity node); credential was renamed/deleted in the workspace; chatflow JSON imported without its credential payload.","solutions":["Open the ChatPerplexity node and bind a Perplexity credential with perplexityApiKey filled.","If using credentialId input wiring, ensure the id resolves to an existing Perplexity credential.","Create a new credential of the correct type if none exists, then bind it.","Re-import the credential alongside the chatflow when copying between workspaces."],"exampleFix":"// before\nnodeData.credential = '' // or wrong-type credential\n\n// after\nnodeData.credential = 'perplexity-cred-id'\n// credential component: perplexityApiKey = 'pplx-xxx'","handlingStrategy":"validation","validationCode":"const credentialData = await getCredentialData(nodeData.credential ?? '', options)\nconst apiKey = getCredentialParam('perplexityApiKey', credentialData, nodeData)\nif (!apiKey) {\n  throw new Error('ChatPerplexity requires a Perplexity credential with perplexityApiKey filled.')\n}","typeGuard":"function hasPerplexityKey(cred: unknown): cred is { perplexityApiKey: string } {\n  return typeof (cred as any)?.perplexityApiKey === 'string' && (cred as any).perplexityApiKey.length > 0\n}","tryCatchPattern":"try {\n  return await initChatPerplexity(nodeData, options)\n} catch (e) {\n  if (e.message === 'Perplexity API Key missing from credential') {\n    return { error: 'Bind a Perplexity credential (perplexityApiKey) to this node.' }\n  }\n  throw e\n}","preventionTips":["Bind a Perplexity credential before saving the node.","Use the Perplexia credential type, not a generic API key.","Carry credentials alongside chatflow JSON on import/export.","Lint chatflows for missing credential bindings before deploy."],"tags":["perplexity","credentials","api-key","configuration","flowise"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}