Perplexity API key not working in n8n

Describe the problem/error/question

Hi everyone,

I’m trying to integrate Perplexity API with n8n.

I have already purchased credits ($5) and successfully generated an API key.

:check_mark: I tested the key via curl using the official Perplexity documentation, and it works correctly (the API responds with valid results).

:cross_mark: But when I try to connect the same key inside n8n using the Perplexity API credential, I get the error:

“Couldn’t connect with these settings – Bad request.”

It looks like the built-in Perplexity credential in n8n does not activate properly, even though the key itself is valid and working outside n8n.

I’m attaching a screenshot of the n8n credential screen.

:backhand_index_pointing_right: Could you please help me understand what might be the issue? Is this a bug in the n8n Perplexity integration, or do I need to configure it differently (e.g. endpoint, headers)?

Thanks in advance!

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @eboziev hope all is well. Welcome to the community.

Does it reveal any additional information about the issue when you click on the Mode details text?

1 Like

Hello @eboziev :waving_hand:t2:,

Could you please try executing any Perplexity node operation that uses that credential after saving it?

It looks like only the connection test is failing, while the node itself works fine with the saved credentials.

Let me know if it works for you.

2 Likes

Hey guys :waving_hand:

You were right — the issue was only with the connection test. It shows an error when saving the credential, but the node itself works fine once connected.

I just attached the node in the workflow and it executed successfully.

Thanks a lot :folded_hands: Everything is working great now!

1 Like

Glad it works @eboziev! I hope this connection test issue gets resolved soon.

Kindly mark my reply as the solution. Thanks, and have a great day!

1 Like

I had the exact same problem that had me flummoxed. Reading this thread saved me from what would have been an extremely frustrating afternoon. Hope they fix the issue soon

1 Like

Filed a bug for this issue:

1 Like

I’ve been having the same issue. Thanks for the info!! Very helpful.

1 Like

New version [email protected] got released which includes the GitHub PR 19440.

2 Likes

Hi Jan! Thanks for the suggestion, however it is still visible after the update to ver. 1.111.0 self hosted version. Is there an alternative solution, would be great. Thank you!

Edit: Currently feeding perplexity API key into Openrouter and using OR in N8n as a workaround.

The fix is in 1.112, not 1.111.

Hey Jabbson! Thank you! Will use the work around for now. Cheers!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.