How to Get Citations Field in Perplexity API Response

When you use the Perplexity API to generate search-backed answers, the response includes a citations field that lists the source URLs used. However, many developers find this field missing or empty in their API output. This usually happens because the request was sent without the required parameter that enables citation gathering. This article explains how … Read more

Perplexity API Returns Empty Citations Array: Fix

When you call the Perplexity API and the citations array comes back empty, your application cannot display the sources behind the answer. This breaks the core value of Perplexity’s search-grounded responses. The problem usually occurs because the return_citations parameter is not set to true in your API request. This article explains the exact cause and … Read more

How to Stream Perplexity API Responses With Server-Sent Events

Streaming Perplexity API responses using Server-Sent Events allows your application to display real-time answers as they are generated instead of waiting for the full response. SSE is a standard protocol that sends data from the server to the client over a single HTTP connection. This article explains how to configure your API request to enable … Read more

Perplexity API Streaming Cuts Off Early: Diagnostic Steps

When you use the Perplexity API for streaming responses, the output may stop before the model finishes generating an answer. This early cutoff interrupts workflows that depend on complete replies, such as automated research summaries or customer-facing chatbots. The issue typically stems from client-side timeout settings, network interruptions, or misconfigured API parameters. This article explains … Read more

Perplexity API OpenAI Compatibility: What Is Supported

Developers building AI-powered applications often ask whether the Perplexity API works with tools and libraries built for OpenAI. The Perplexity API is designed to be compatible with the OpenAI client libraries and API format, making migration or integration simpler. This article explains exactly which OpenAI features are supported by the Perplexity API and which are … Read more

How to Switch Perplexity API Model in a Single Request

Perplexity offers several AI models through its API, including llama-3.1-sonar-small-128k-online, llama-3.1-sonar-large-128k-online, and llama-3.1-sonar-huge-128k-online. Each model has different capabilities in terms of speed, cost, and answer quality. You may need to switch between these models for different tasks such as quick lookups versus deep research. This article explains how to specify the model parameter in a … Read more