如何在 n8n 使用 Perplexity API:完整串接教學

前言

如何在 n8n 使用 Perplexity API?
在 n8n 並沒有一個對應 Perplexity 的官方節點,我是利用 HTTP Request 節點來串接 Perplexity,通常是連接到 AI Agent 當成 Tool 用。

取得 Perplexity API Key 的步驟

建立 n8n 節點:AI Agent 與 HTTP Reques

把以下 2 個節點建立起來

  1. AI Agent
  2. HTTP Request

設定 HTTP Request 節點以呼叫 Perplexity API

  • Method: Post
  • URL: https://api.perplexity.ai/chat/completions
  • Authentication: Generic Credential Type
  • Generic Auth Type: Header Auth
  • Header Auth: Create new credential
    • Name: Authorization
    • Value: Bearer Your API KEY (Bearer 後面要空一格後才把你 Open AI 的 API Key 貼上去)

需要協助?加入 Discord 社群尋求支援

如果你遇到任何問題的話,歡迎你進來 Discord 找我。

Discord 討論區

延伸閱讀:  如何在 n8n 串接 Imgur API:完整教學與 HTTP Request 設定指南