# perplexity

- [Perplexity API 발급 링크](https://docs.perplexity.ai/guides/getting-started) (결제수단 등록 후 최소 $3 충전 후에만 API_KEY 발급가능)

- perplexity [API 사용법 문서](https://perplexity.mintlify.app/api-reference/chat-completions)

n8n 설정값 

- Method : POST

- URL : [https://api.perplexity.ai/chat/completions](https://api.perplexity.ai/chat/completions) 

- Authentication : Generic Credential Type

- Generic Auth Type : Header Auth

    - Header Auth Name : Authorization

    - Header Auth Value : Bearer <API_TOKEN>

- Send Headers : Enable

    - Using Fields Below

        - Name : Content-Type

        - Value : application/json

        - Name : accept

        - Value : application/json

- Send Body : Enable

    - Body Content Type : JSON

Specify Body : Using JSON

```
{
  "model": "llama-3.1-sonar-small-128k-online",
  "messages": [
    {
      "role": "system",
      "content": "Be precise and concise."
    },
    {
      "role": "user",
      "content": "How many stars are there in our galaxy?"
    }
  ],
  "max_tokens": 1000,
  "temperature": 0.2,
  "top_p": 0.9,
  "return_citations": true,
  "search_domain_filter": [
    "perplexity.ai"
  ],
  "return_images": false,
  "return_related_questions": false,
  "search_recency_filter": "month",
  "top_k": 0,
  "stream": false,
  "presence_penalty": 0,
  "frequency_penalty": 1
}
```

![Image](https://upload.cafenono.com/image/slashpageHome/20250422/095023_zLJvfT98WgrL2JhveQ?q=80&s=1280x180&t=outside&f=webp)

![Image](https://upload.cafenono.com/image/slashpageHome/20250422/095024_eaRTN30TwXTfN5uKi2?q=80&s=1280x180&t=outside&f=webp)

![Image](https://upload.cafenono.com/image/slashpageHome/20250422/095024_kPt3VR658PqRaYGSwm?q=80&s=1280x180&t=outside&f=webp)

For the site tree, see the [root Markdown](https://slashpage.com/n8n-guide.md).
