



const { OpenAI } = require('openai');
const api = new OpenAI({
baseURL: 'https://api.ai.cc/v1',
apiKey: '',
});
const main = async () => {
const result = await api.chat.completions.create({
model: 'perplexity/sonar',
messages: [
{
role: 'system',
content: 'You are an AI assistant who knows everything.',
},
{
role: 'user',
content: 'Tell me, why is the sky blue?'
}
],
});
const message = result.choices[0].message.content;
console.log(`Assistant: ${message}`);
};
main();
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.ai.cc/v1",
api_key="",
)
response = client.chat.completions.create(
model="perplexity/sonar",
messages=[
{
"role": "system",
"content": "You are an AI assistant who knows everything.",
},
{
"role": "user",
"content": "Tell me, why is the sky blue?"
},
],
)
message = response.choices[0].message.content
print(f"Assistant: {message}")
-
AI Playground

Test all API models in the sandbox environment before you integrate.
We provide more than 300 models to integrate into your app.


Product Detail
Perplexity Sonar: Your Advanced Multimodal AI Assistant
Perplexity AI's Sonar is a cutting-edge, multimodal AI assistant engineered for exceptional real-time, context-aware web search, intelligent information synthesis, and insightful conversational analytics. Designed to empower both professional and consumer workflows, Sonar seamlessly integrates rapid, authoritative information retrieval with robust reasoning capabilities over diverse retrieved documents.
Technical Specifications
Performance Benchmarks
- ✅ Model Architecture: A hybrid system blending proprietary and open-source Large Language Models (LLMs), including Llama 3.1 70B base with custom Perplexity fine-tuning. It features integrated real-time web search and multi-document synthesis.
- ⚙️ Context Window: Dynamic, automatically adjusting to the complexity of the query and the volume of retrieved content.
- 🔗 Tool Integration: Native live web search, access to academic databases, and a comprehensive citation engine for producing source-backed answers.
Performance Metrics
Sonar consistently delivers real-time information retrieval and high-quality, source-backed answers. Its growing query volume and strong user engagement underscore its market fit for knowledge-intensive workflows. While it may have slightly higher latency compared to pure LLM chatbots due to its commitment to rapid, cited answers, this trade-off ensures superior accuracy and transparency.
API Pricing
- 📥 Input: $1.05 per million tokens
- 📤 Output: $1.05 per million tokens
Key Capabilities
The Perplexity Sonar API is designed to deliver authoritative and highly reliable outputs for information-dense workflows.
- 🔍 Advanced Search & Synthesis: Excels at cross-referencing multiple web sources, distilling complex information, and presenting it with unparalleled clarity and transparency.
- 💬 Conversational Analytics: Supports multi-turn, context-aware dialogues, making it ideal for in-depth research, business intelligence, and critical decision support.
- 🛠️ Tool Utilization: Integrates proprietary live web search, enabling real-time fact-checking and precise source citation for every answer.
Optimal Use Cases
- 🔬 Research & Analysis: Facilitates rapid literature reviews, competitive intelligence gathering, and advanced academic research with cited sources.
- 📈 Business Intelligence: Provides real-time market analysis, crucial news monitoring, and swift executive briefings.
- 📚 Education & Content Creation: Perfect for answering complex questions with verifiable citations, efficient content summarization, and clear explanation generation.
- ⚙️ Technical Support: Aids in troubleshooting, comprehensive documentation lookup, and workflow guidance, all with strong source grounding.
Code Sample
<!-- Example of how the Perplexity Sonar API might be called -->
<div data-name="open-ai.chat-completion" data-model="perplexity/sonar">
<!-- Actual code snippet would typically be rendered here by an embed script -->
<p>This area would display the API integration code for perplexity/sonar model.</p>
</div>
Comparison with Other Leading Models
- Vs. Claude 4 Opus: Sonar specializes in live, cited answers directly from the web. In contrast, Claude 4 Opus excels in autonomous coding, complex reasoning, and agentic workflows. Sonar is optimized for users who prioritize answers grounded in the latest, most authoritative sources over extensive long-context reasoning or advanced code generation.
- Vs. Gemini 2.5: Perplexity Sonar places a strong emphasis on real-time search and synthesis. While Gemini models offer broad multimodal capabilities and long-context reasoning, they may not always explicitly surface citations or real-time data with the same transparency as Sonar.
- Vs. OpenAI GPT-4: Perplexity Sonar is purpose-built for Retrieval-Augmented Generation (RAG) and unparalleled source transparency. GPT-4, being a generalist model, is best suited for broad reasoning and creative tasks that do not inherently require built-in web sourcing for every query.
Key Limitations of Perplexity Sonar
While Perplexity Sonar excels in real-time research, multi-source synthesis, and cited analytics, its specialized architecture means it has distinct limitations:
- 🚫 No Traditional Coding or Reasoning Benchmarks: Unlike models such as Claude Opus 4 or Kimi K2, Perplexity Sonar does not publish standard coding or reasoning metrics (e.g., SWE-bench, LiveCodeBench). Its architecture is optimized for real-time, sourced knowledge retrieval, not autonomous coding or long-horizon reasoning tasks.
- 🚫 Best for Research & Analytics, Not Pure Code: It truly shines in tasks requiring live web search, deep citation, and business intelligence. However, it is less suitable for pure code generation, agentic autonomy, or scenarios where generative program synthesis is critical.
- 🚫 Static Knowledge and Reasoning (Without Web Access): For tasks beyond its search-embedded, live-updated knowledge, Perplexity Sonar operates like any RAG system. Without real-time, cited web access, it cannot claim dramatic accuracy or recency advantages over other frontier models for general knowledge.
API Integration
Perplexity Sonar is readily accessible via the AI/ML API. Comprehensive documentation is available for seamless integration.
Frequently Asked Questions (FAQ)
Q: What is Perplexity Sonar and how does it enhance search and research capabilities?
A: Perplexity Sonar is an advanced AI-powered search and research assistant that combines real-time web search with sophisticated reasoning capabilities. It enhances traditional search by providing comprehensive, well-structured answers with citations, engaging in conversational follow-ups, and synthesizing information from multiple sources to deliver nuanced, context-aware responses rather than just search results.
Q: What makes Perplexity Sonar different from traditional search engines and other AI assistants?
A: Perplexity Sonar differs through its unique combination of real-time web search with source citation, a conversational interface that understands follow-up questions, the ability to synthesize information across multiple sources, a focus on providing comprehensive answers rather than just links, and sophisticated reasoning that connects related concepts. It acts as both a search engine and research assistant in one integrated experience.
Q: What types of research and search tasks does Perplexity Sonar handle best?
A: Perplexity Sonar excels at academic and market research, current events analysis with multiple perspectives, technical topic exploration with detailed explanations, comparative analysis of products or concepts, fact-checking with source verification, and exploratory learning about complex subjects. Its strength lies in connecting disparate information and providing well-reasoned, evidence-based answers.
Q: How does the citation system work in Perplexity Sonar responses?
A: Perplexity Sonar automatically cites sources by including numbered references for key information, linking to original web sources, providing context about source reliability, maintaining transparency about information origins, and allowing users to verify claims easily. This citation system enables users to assess information credibility and explore source materials directly, making it valuable for academic and professional research.
Q: What are the practical benefits of using Perplexity Sonar for information gathering?
A: Practical benefits include significantly reduced research time through synthesized answers, improved information reliability through source verification, deeper understanding through connected insights, the ability to explore related topics conversationally, and access to current information beyond training data cutoffs. It's particularly valuable for professionals, students, and anyone needing efficient, credible information synthesis.
Learn how you can transformyour company with AICC APIs



Log in