# Perplexity Sonar Pro

**API:** Data API

**Endpoint:** `POST /v1/beta/perplexity/sonar-pro`

**Tags:** Perplexity API

웹 검색과 인용을 사용해 여러 부분으로 구성된 질문에 대한 답변을 생성합니다. model과 messages는 필수이며, 이 엔드포인트에는 model sonar-pro를 사용하세요. 이 공개 계약은 stream false를 사용하는 비스트리밍 JSON 응답을 다룹니다. 답변과 출처는 choices[].message.content, citations, search_results에서 읽으세요. usage는 Felo 크레딧 청구가 아닌 리소스 소비를 보고합니다.

### 가격 참고

- 과금 기준: 응답에 보고된 비용.
- 참고 요청 추정치: USD 0.11273.
- 참고 고객 배수: 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-pro",
  "messages": [
    {
      "role": "user",
      "content": "Compare Cache-Control no-cache and no-store, citing HTTP documentation."
    }
  ],
  "max_tokens": 1024,
  "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-pro-completion",
  "model": "sonar-pro",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "no-cache requires validation before reuse; no-store prohibits storage. [1]"
      },
      "finish_reason": "stop"
    }
  ],
  "citations": [
    "https://www.rfc-editor.org/rfc/rfc9111.html"
  ],
  "search_results": [
    {
      "title": "HTTP Caching",
      "url": "https://www.rfc-editor.org/rfc/rfc9111.html"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 40,
    "total_tokens": 65
  }
}
```

### 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"
        }
      }
    }
  }
}
```
