> ## Documentation Index
> Fetch the complete documentation index at: https://docs.perplexity.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sonar

> Learn about the Sonar search model, including its pricing, API usage, and best-fit use cases.

<div className="px-8 pt-8">
  <a href="/docs/sonar/models" className="inline-flex items-center text-muted-foreground hover:text-foreground transition-colors text-sm">
    <svg className="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
      <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
    </svg>

    Models
  </a>
</div>

<div className="w-[80%] max-w-5xl mx-auto px-8 sm:px-8 lg:px-12 xl:px-16">
  <div className="text-white px-8 pt-8 rounded-xl mb-8">
    <div className="max-w-6xl mx-auto">
      <div className="mb-8">
        {/* Banner */}

        <div
          className="w-full h-48 rounded-lg mb-6"
          style={{ 
          backgroundImage: `var(--sonar-banner)`,
          backgroundRepeat: 'no-repeat',
          backgroundSize: 'cover',
          backgroundPosition: 'center'
        }}
        />

        {/* Header Content */}

        <div className="flex items-center justify-between">
          <div className="flex items-left gap-2 flex-col">
            <h1 className="text-3xl font-semibold text-foreground">Sonar</h1>
            <p className="text-sm text-muted-foreground">Fast answers with reliable search results</p>
          </div>
        </div>
      </div>

      <div className="text-left w-full pt-8 border-b border-t border-border py-8">
        <p className="text-lg text-foreground leading-relaxed">
          A lightweight, cost-effective search model optimized for quick, grounded answers with real-time web search.
        </p>
      </div>
    </div>
  </div>

  <div className="px-8 border-b border-border pb-8 max-w-6xl mx-auto">
    <div className="flex items-left gap-2 flex-col">
      <h2 className="text-lg font-semibold text-left text-foreground">Pricing</h2>
      <a className="text-left text-muted-foreground mb-8 text-sm" href="/docs/getting-started/pricing" style={{ textDecoration: 'underline' }}>See the full pricing and search context size guide.</a>
    </div>

    <div className="grid grid-cols-1 md:grid-cols-3 gap-2">
      {/* Input Tokens Card */}

      <div className="bg-card p-4 rounded-lg border border-border">
        <div className="text-left">
          <div className="mb-6">
            <h3 className="text-sm font-semibold text-foreground">Input Tokens</h3>
          </div>

          <div className="flex justify-center items-center">
            <span className="text-xl text-foreground font-mono">\$1</span>
          </div>

          <div className="text-center mt-2">
            <span className="text-xs text-muted-foreground">Per 1M Tokens</span>
          </div>
        </div>
      </div>

      {/* Output Tokens Card */}

      <div className="bg-card p-4 rounded-lg border border-border">
        <div className="text-left">
          <div className="mb-6">
            <h3 className="text-sm font-semibold text-foreground">Output Tokens</h3>
          </div>

          <div className="flex justify-center items-center">
            <span className="text-xl text-foreground font-mono">\$1</span>
          </div>

          <div className="text-center mt-2">
            <span className="text-xs text-muted-foreground">Per 1M Tokens</span>
          </div>
        </div>
      </div>

      {/* Price Per 1K Requests Card */}

      <div className="bg-card p-4 rounded-lg border border-border">
        <div className="text-left">
          <h3 className="text-sm font-semibold text-foreground mb-2">Price Per 1K Requests</h3>

          <p className="text-xs text-muted-foreground mb-6" />

          <div className="space-y-2">
            <div className="flex justify-between items-center">
              <span className="text-xl text-foreground font-mono">\$12</span>
              <span className="text-xl text-foreground font-mono">\$8</span>
              <span className="text-xl text-foreground font-mono">\$5</span>
            </div>

            <div className="flex justify-between items-center">
              <span className="text-xs text-muted-foreground">High</span>
              <span className="text-xs text-muted-foreground">Medium</span>
              <span className="text-xs text-muted-foreground">Low</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div className="px-8 border-b border-border py-8">
    <h2 className="text-lg font-semibold text-left text-foreground mb-8">Features</h2>

    <div className="grid grid-cols-1 md:grid-cols-2 gap-8">
      {/* Left Column */}

      <div className="space-y-6">
        <div className="flex items-start gap-4">
          <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
            <img src="https://mintlify-assets.b-cdn.net/perplexity/arrow.svg" alt="Arrow" className="w-8 h-8" />
          </div>

          <div>
            <h3 className="font-medium mb-2">Non-reasoning model</h3>
          </div>
        </div>

        <div className="flex items-start gap-4">
          <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
            <img src="https://mintlify-assets.b-cdn.net/perplexity/searchicon.svg" alt="Search" className="w-8 h-8" />
          </div>

          <div>
            <h3 className="font-medium mb-2">Ideal for quick searches and straightforward Q\&A tasks</h3>
          </div>
        </div>

        <div className="flex items-start gap-4">
          <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
            <img src="https://mintlify-assets.b-cdn.net/perplexity/lengthicon.svg" alt="Length" className="w-8 h-8" />
          </div>

          <div>
            <h3 className="font-medium mb-2">128K context length</h3>
          </div>
        </div>
      </div>

      {/* Right Column */}

      <div className="space-y-6">
        <div className="flex items-start gap-4">
          <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
            <img src="https://mintlify-assets.b-cdn.net/perplexity/speedicon.svg" alt="Speed" className="w-8 h-8" />
          </div>

          <div>
            <h3 className="font-medium mb-2">Optimized for speed and cost</h3>
          </div>
        </div>

        <div className="flex items-start gap-4">
          <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
            <img src="https://mintlify-assets.b-cdn.net/perplexity/citationicon.svg" alt="Citation" className="w-8 h-8" />
          </div>

          <div>
            <h3 className="font-medium mb-2">Real-time web search-based answers with detailed search results</h3>
          </div>
        </div>

        <div className="flex items-start gap-4">
          <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
            <img src="https://mintlify-assets.b-cdn.net/perplexity/lockicon.svg" alt="Lock" className="w-8 h-8" />
          </div>

          <div>
            <h3 className="font-medium mb-2">No training on customer data</h3>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div className="px-8 border-b border-border py-8">
    <h2 className="text-lg font-semibold text-left text-foreground mb-8">Real World Use Cases</h2>

    <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
      <div className="flex items-start gap-4">
        <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
          <img src="https://mintlify-assets.b-cdn.net/perplexity/glasses.svg" alt="Summarizing" className="w-8 h-8" />
        </div>

        <div>
          <h3 className="font-medium mb-2">Summarizing books, TV shows, and movies</h3>
        </div>
      </div>

      <div className="flex items-start gap-4">
        <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
          <img src="https://mintlify-assets.b-cdn.net/perplexity/search.svg" alt="Definitions" className="w-8 h-8" />
        </div>

        <div>
          <h3 className="font-medium mb-2">Looking up definitions or quick facts</h3>
        </div>
      </div>

      <div className="flex items-start gap-4">
        <div className="w-8 h-8 flex items-center justify-center flex-shrink-0">
          <img src="https://mintlify-assets.b-cdn.net/perplexity/eye.svg" alt="Browsing" className="w-8 h-8" />
        </div>

        <div>
          <h3 className="font-medium mb-2">Browsing news, sports, health, and finance content</h3>
        </div>
      </div>
    </div>
  </div>

  <div className="px-8 border-b border-border py-8">
    <CodeGroup>
      ```bash cURL theme={null}
      curl --request POST \
      --url https://api.perplexity.ai/v1/sonar \
      --header "Authorization: Bearer <token>" \
      --header "Content-Type: application/json" \
      --data '{
        "model": "sonar",
        "messages": [
          {
            "role": "user",
            "content": "What is the latest news in AI research?"
          }
        ]
      }' | jq
      ```

      ```python python theme={null}
      import requests

      url = "https://api.perplexity.ai/v1/sonar"

      payload = {
          "model": "sonar",
          "messages": [
              {"role": "user", "content": "What is the latest news in AI research?"}
          ]
      }
      headers = {
          "Authorization": "Bearer <token>",
          "Content-Type": "application/json"
      }

      response = requests.post(url, json=payload, headers=headers)
      print(response.json())
      ```
    </CodeGroup>

    **Sample Response Metadata**

    <CodeGroup>
      ```json Success Response expandable wrap theme={null}
      {
      "id": "a954f304-9a7a-44f5-9605-152e9f5b1c74",
      "model": "sonar",
      "created": 1756485752,
      "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 402,
        "total_tokens": 411,
        "search_context_size": "low",
        "cost": {
          "input_tokens_cost": 0.0,
          "output_tokens_cost": 0.0,
          "request_cost": 0.005,
          "total_cost": 0.005
        }
      },
      "citations": [
        "https://champaignmagazine.com/2025/07/01/ai-by-ai-first-half-of-2025-themes-and-breakthroughs/",
        "https://www.artificialintelligence-news.com",
        "https://www.crescendo.ai/news/latest-ai-news-and-updates",
        "https://www.sciencedaily.com/news/computers_math/artificial_intelligence/",
        "https://explodingtopics.com/blog/future-of-ai"
      ],
      "search_results": [
        {
          "title": "AI by AI: First Half of 2025 Themes and Breakthroughs",
          "url": "https://champaignmagazine.com/2025/07/01/ai-by-ai-first-half-of-2025-themes-and-breakthroughs/",
          "date": "2025-07-01",
          "last_updated": "2025-08-29",
          "snippet": "Research published on May 13, 2025, by philosopher Frank Martela suggests AI is approaching conditions for free will, sparking ethical debates."
        },
        {
          "title": "AI News | Latest AI News, Analysis & Events",
          "url": "https://www.artificialintelligence-news.com",
          "date": "2025-08-28",
          "last_updated": "2025-08-29",
          "snippet": "Marketing AI boom faces crisis of consumer trust · AI security wars: Can Google Cloud defend against tomorrow's threats? · Agentic AI: Promise, scepticism, and ..."
        },
        {
          "title": "Latest AI Breakthroughs and News: June, July, August 2025",
          "url": "https://www.crescendo.ai/news/latest-ai-news-and-updates",
          "date": "2025-08-29",
          "last_updated": "2025-08-29",
          "snippet": "Wondering what's happening in the AI world? Here are the latest AI breakthroughs and news that are shaping the world around us!"
        },
        {
          "title": "Artificial Intelligence News - ScienceDaily",
          "url": "https://www.sciencedaily.com/news/computers_math/artificial_intelligence/",
          "date": "2025-08-28",
          "last_updated": "2025-08-29",
          "snippet": "Latest Headlines · Harvard's Ultra-Thin Quantum Computing Chip · Google's Deepfake Hunter Is Here · Affordance: The Brain's Hidden Superpower · Half of Today's Jobs ..."
        },
        {
          "title": "Future of AI: 7 Key AI Trends For 2025 & 2026",
          "url": "https://explodingtopics.com/blog/future-of-ai",
          "date": "2025-08-15",
          "last_updated": "2025-08-29",
          "snippet": "A look into the future of AI and the rapidly evolving landscape including potential impacts in healthcare, finance, and sustainability."
        }
      ],
      "object": "chat.completion",
      "choices": [
        {
          "index": 0,
          "finish_reason": "stop",
          "message": {
            "role": "assistant",
            "content": "The latest AI research breakthroughs as of mid-2025 include significant advancements across AI models, robotics, quantum computing, and sustainable AI technologies. Key highlights are:\n\n- **GPT-4o**, released in May 2025, integrates real-time speech, vision, text, and memory with near-human expressiveness, enabling a shift from chatbot interfaces to fluid, embodied AI assistants with empathic interaction and full conversational memory[1].\n\n- Google DeepMind's **Gemini 2.5 Pro** and **Gemini Robotics** models demonstrate advanced parallel thinking for complex math and coding, while enhancing robot reasoning, dexterity, and autonomy in physical tasks without external positioning systems[1].\n\n- Researchers have demonstrated **photonic quantum circuits** that enhance machine learning performance, marking practical steps toward incorporating quantum computing in AI tasks[1][4].\n\n- Japanese scientists created a **self-powered artificial synapse** that processes visual data with very low energy, enabling sustainable AI deployment on edge devices such as IoT sensors and autonomous systems[1].\n\nAdditional notable developments:\n\n- Stanford developed a **virtual AI scientist** that can autonomously design and execute biological experiments, accelerating biomedical research in genomics and drug discovery[3].\n\n- China introduced a **low-cost open-source AI model** cheaper than previous leaders, aimed at enterprise use and reflecting strategic AI independence efforts amid global chip sanctions[3].\n\n- AI is also being applied in healthcare to improve precision medicine and cancer treatment, exemplified by platforms like Avenda Health’s system for mapping and treating prostate cancer, which outperforms MRI in detection and has influenced treatment decisions[5].\n\nEmerging themes include the ethical debate on AI approaching free will conditions, integration of AI in physical and cognitive domains, and progress toward agentive AI systems capable of naturalistic interaction and real-world tasks[1][2].\n\nThese developments signal a rapid and multi-dimensional evolution in AI research, spanning foundational AI capabilities, hardware innovations, and application-specific breakthroughs in medicine and robotics."
          },
          "delta": {
            "role": "assistant",
            "content": ""
          }
        }
      ]
      }
      ```
    </CodeGroup>

    <Accordion title="Cost Breakdown for Sample Request">
      <Info>
        **Token Usage**

        * Prompt Tokens: 9
        * Completion Tokens: 402
        * Search Context Size: Low
      </Info>

      <Steps>
        <Step title="Calculate Input Tokens Cost">
          9 tokens ÷ 1,000,000 × \$1 = \$0.000009
        </Step>

        <Step title="Calculate Output Tokens Cost">
          411 tokens ÷ 1,000,000 × \$1 = \$0.000411
        </Step>

        <Step title="Calculate Search Context Cost">
          1 request × \$5 ÷ 1,000 = \$0.005
        </Step>

        <Step title="Calculate Total Cost">
          \$0.000009 + \$0.000411 + \$0.005 = \$0.005420
        </Step>
      </Steps>

      <Check>
        **Total cost for this request: \$0.005420**
      </Check>
    </Accordion>
  </div>
</div>
