Perplexity API JSON Mode Returns Markdown: Fix

When you use Perplexity API JSON mode, you expect structured JSON output. Instead, the API sometimes returns markdown text wrapped in triple backticks. This breaks your application logic and requires extra parsing. The root cause is a mismatch between the API endpoint and the model used. This article explains why JSON mode returns markdown and … Read more

How to Restrict Perplexity API to Specific Domains

You want the Perplexity API to only search or retrieve data from certain websites, not the entire internet. This is useful for internal knowledge bases, trusted news sources, or curated content sets. The Perplexity API does not offer a built-in domain whitelist filter like some search engines do. This article explains how to achieve domain … Read more

Perplexity API Domain Filter Returns No Results: Cause

When you apply a domain filter in the Perplexity API, the response can return zero results even though you know relevant content exists on the specified site. This typically happens because the API enforces a combined search scope that treats the domain filter as a secondary constraint rather than a primary query operator. In this … Read more

How to Migrate From OpenAI API to Perplexity Sonar

If you currently use the OpenAI API for text generation or search-augmented completions, you may want to switch to Perplexity Sonar for lower cost, built-in web grounding, and real-time citations. The OpenAI API and Perplexity Sonar both support a chat completions endpoint, but the request format, authentication, and response structure differ in several key ways. … Read more

Perplexity API Sonar Reasoning vs DeepSeek R1: Comparison

You need to choose between Perplexity API Sonar Reasoning and DeepSeek R1 for your AI application. Both models excel at complex reasoning tasks but differ in architecture, cost, and availability. This article compares their features, performance, and practical use cases to help you decide. Key Takeaways: Perplexity API Sonar Reasoning vs DeepSeek R1 Sonar Reasoning: … Read more

How to Cache Perplexity API Responses Without Leaking Private Answers

Official documentation checked October 14, 2026. An application-side response cache can avoid a repeated Perplexity API request, but it also stores another copy of the answer. A cache that ignores the caller’s identity or the conversation can return someone else’s information. Start with approved, read-only requests and treat privacy, freshness, and authorization as requirements alongside … Read more