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

# Sonar Pro

> 提一个需要多轮检索才能回答的问题，拿回带引用的文字答案。

提一个需要多轮检索才能回答的问题，拿回带引用的文字答案。请求与返回形状和 [`post_perplexity_sonar`](/docs/zh/api-reference/perplexity/post_perplexity-sonar) 完全相同 —— 传 `model`（必填，`sonar-pro`）和 `messages`，返回 `choices[0].message.content`、`citations`、`search_results[]` 和 `usage`。实测约 10 秒，大约是 `sonar` 的三倍，计费方式同样是按次固定费率。适合有多个分支或需要追问的问题。若只是一次查找，`sonar` 用三分之一的时间、同样的价格就够；若难点在推理而不在检索，[`post_perplexity_sonar_reasoning_pro`](/docs/zh/api-reference/perplexity/post_perplexity-sonar-reasoning-pro) 会把推演过程写出来。

<Note>
  **第一次用？** 把任意 MCP 客户端指向 `https://mcp.aisa.one/mcp` —— Claude Code、
  Codex、Cursor、VS Code 都可以。鉴权走 OAuth：客户端打开浏览器，你点一次
  Allow，不需要粘贴任何 key。各客户端的具体命令和每次调用的价格见
  [aisa.one/zh-cn/mcp](https://aisa.one/zh-cn/mcp#connect)。
</Note>

[在你的 agent 里把这个端点跑起来 →](https://aisa.one/mcp?from=/zh/api-reference/perplexity/post_perplexity-sonar-pro)


## OpenAPI

````yaml openapi/zh/perplexity-openapi.json POST /perplexity/sonar-pro
openapi: 3.0.0
info:
  title: Perplexity Sonar API
  version: 1.0.0
  description: Perplexity Sonar API——内置网页搜索功能的 LLM。返回 AI 生成的答案，并附有网页来源引用。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - bearerAuth: []
paths:
  /perplexity/sonar-pro:
    post:
      tags:
        - Perplexity Sonar Pro
      summary: Sonar Pro — 面向复杂查询的高级搜索
      description: >-
        提一个需要多轮检索才能回答的问题，拿回带引用的文字答案。请求与返回形状和 `post_perplexity_sonar` 完全相同 —— 传
        `model`（必填，`sonar-pro`）和 `messages`，返回
        `choices[0].message.content`、`citations`、`search_results[]` 和
        `usage`。实测约 10 秒，大约是 `sonar`
        的三倍，计费方式同样是按次固定费率。适合有多个分支或需要追问的问题。若只是一次查找，`sonar`
        用三分之一的时间、同样的价格就够；若难点在推理而不在检索，`post_perplexity_sonar_reasoning_pro`
        会把推演过程写出来。
      operationId: post_perplexity_sonar_pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            example:
              model: sonar-pro
              messages:
                - role: user
                  content: >-
                    Compare the economic policies of the US and EU regarding AI
                    regulation in 2025-2026
      responses:
        '200':
          description: 包含 AI 答案和引用的成功响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 要使用的 Sonar 模型。
          enum:
            - sonar
            - sonar-pro
            - sonar-reasoning-pro
            - sonar-deep-research
        messages:
          type: array
          description: 由截至目前的对话内容组成的消息列表。
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
                enum:
                  - system
                  - user
                  - assistant
                description: 消息作者的角色。
              content:
                type: string
                description: 消息内容。
        max_tokens:
          type: integer
          description: 响应中要生成的最大词元数。
        temperature:
          type: number
          description: 介于 0 和 2 之间的采样温度。较低的值会使输出更集中且更具确定性。
          default: 0.2
          minimum: 0
          maximum: 2
        top_p:
          type: number
          description: 核采样参数。模型会考虑累计概率质量达到 top_p 的词元。
          default: 0.9
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: 用于 top-k 筛选的保留词元数。
          default: 0
          minimum: 0
          maximum: 2048
        stream:
          type: boolean
          description: 是否使用服务器发送事件以流式方式返回响应。
          default: false
        search_context:
          type: string
          description: 控制使用的搜索上下文量。会影响单次请求的成本。
          enum:
            - low
            - medium
            - high
          default: low
        frequency_penalty:
          type: number
          description: 根据新词元目前在文本中的出现频率对其施加惩罚。正值会降低逐字重复同一行的可能性。
          default: 1
          minimum: 0
          maximum: 2
        presence_penalty:
          type: number
          description: 根据新词元此前是否已出现在文本中对其施加惩罚。正值会提高谈论新主题的可能性。
          default: 0
          minimum: -2
          maximum: 2
        return_citations:
          type: boolean
          description: 是否在响应中返回引用和搜索结果。
          default: true
        search_recency_filter:
          type: string
          description: 按时效性筛选搜索结果。
          enum:
            - month
            - week
            - day
            - hour
        search_domain_filter:
          type: array
          description: 将搜索限制在特定域名。
          items:
            type: string
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 补全结果的唯一标识符。
        model:
          type: string
          description: 用于生成补全内容的模型。
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          description: 补全创建时间的 Unix 时间戳。
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
                    description: AI 生成的答案，包含类似 [1][2] 的内联引用。
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
        citations:
          type: array
          description: 答案中引用的来源 URL 列表。
          items:
            type: string
        search_results:
          type: array
          description: 包含标题、摘要和 URL 的详细搜索结果。
          items:
            type: object
            properties:
              title:
                type: string
              url:
                type: string
              snippet:
                type: string
              date:
                type: string
              source:
                type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
            search_context_size:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.