# Perplexity Sonar Deep Research

**API:** Data API

**Endpoint:** `POST /v1/beta/perplexity/sonar-deep-research`

**Tags:** Perplexity API

複数のウェブ検索と引用元を使って調査レポートを生成します。model と messages は必須で、このエンドポイントではモデル sonar-deep-research を使用します。この公開契約は stream が false の非ストリーミング JSON レスポンスを対象とします。調査には数分かかることがあり、ゲートウェイやクライアントのタイムアウトを超える可能性があります。レポートとその出典は choices[].message.content、citations、search_results から読み取ります。usage は Felo クレジットの請求ではありません。

### 料金の参考情報

- 計測方法：報告されたレスポンスコスト。
- 参考リクエスト見積もり：USD 0.23932。
- 参照用の顧客乗数：1.0。確定済みの顧客金額には再適用しないでください。

参考情報のメタデータであり、アカウントへの見積もり、保証された価格、支出上限ではありません。リソースクレジットは Felo クレジットではありません。最終的な請求は Felo の請求記録に従います。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "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"
      }
    }
  }
}
```

Example:

```json
{
  "model": "sonar-deep-research",
  "messages": [
    {
      "role": "user",
      "content": "Research HTTP caching strategies for public APIs, with references to standards."
    }
  ],
  "max_tokens": 4096,
  "stream": false
}
```

## Responses

### 200 — AI 回答と引用を含む成功レスポンス

Headers:
- `X-Request-Id` (string) — Felo サポートに問い合わせる際に伝えるリクエスト識別子。

**application/json**

Schema: `ResponseD5E2470Dd28B_ChatCompletionResponse` (`#/components/schemas/ResponseD5E2470Dd28B_ChatCompletionResponse`)

Example:

```json
{
  "id": "example-sonar-deep-research-completion",
  "model": "sonar-deep-research",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Public API caching combines freshness controls and conditional requests. [1][2]"
      },
      "finish_reason": "stop"
    }
  ],
  "citations": [
    "https://www.rfc-editor.org/rfc/rfc9111.html",
    "https://www.rfc-editor.org/rfc/rfc9110.html"
  ],
  "search_results": [
    {
      "title": "HTTP Caching",
      "url": "https://www.rfc-editor.org/rfc/rfc9111.html"
    },
    {
      "title": "HTTP Semantics",
      "url": "https://www.rfc-editor.org/rfc/rfc9110.html"
    }
  ],
  "usage": {
    "prompt_tokens": 40,
    "completion_tokens": 80,
    "total_tokens": 120
  }
}
```

### 400 — リクエストを処理できませんでした。リクエストパラメータを確認してください。

### 401 — 有効な Felo API キーが必要です。

### 402 — 請求要件が満たされていないため、リクエストを続行できません。

### 403 — このアカウントにはこの操作を行う権限がありません。

### 429 — リクエストまたは支出の上限に達しました。

### 502 — サービスがリクエストを完了できませんでした。

### 503 — API または請求サービスが一時的に利用できません。

### 504 — リクエストの処理中にサービスがタイムアウトしました。

### default — エラーレスポンス。上流のパススルーレスポンスはプロバイダーの形式を使用する場合があります

**application/json**

Schema:

```json
{}
```

## Schema definitions

### ResponseD5E2470Dd28B_ChatCompletionResponse

`#/components/schemas/ResponseD5E2470Dd28B_ChatCompletionResponse`

```json
{
  "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": "[1][2] のようなインライン引用参照を含む、AI が生成した回答。"
              }
            }
          },
          "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"
        }
      }
    }
  }
}
```
