# Perplexity LLM 응답(라이브)

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/ai_optimization/perplexity/llm_responses/live`

**Tags:** DataForSEO

`user_prompt`를 Perplexity 모델로 보내고 그 응답을 동기적으로 반환합니다. `model_name`은 `get_dataforseo_ai_perplexity_llm_responses_models`에서 가져와야 하며, `sonar`, `sonar-pro`, `sonar-reasoning-pro` 중 하나입니다. `web_search_country_iso_code`로 검색 범위를 한정할 수 있는데, 다른 세 공급자는 이 기능을 제공하지 않습니다. `model_name`, `input_tokens`, `output_tokens`, `reasoning_tokens`, `web_search`, `money_spent`, `datetime`, `items`, `fan_out_queries`를 반환합니다. 프롬프트 한 번의 실제 비용은 응답의 `money_spent`에서 확인하세요. DataForSEO의 봉투 구조로 감싸집니다. 데이터는 `tasks[0].result`, 결과 상태는 `tasks[0].status_code`에 있으며, 거부된 요청도 HTTP 200을 반환합니다. 

### 요금 참고 정보

- 계량 방식: 보고된 응답 비용.
- 참고 요청 추정치: USD 0.0163.
- 참고 고객 배수: 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: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "user_prompt": {
            "type": "string",
            "description": "<em>AI 모델용 프롬프트</em><br><strong>필수 필드</strong><br>AI 모델에 보낼 질문 또는 작업입니다;<br><code>user_prompt</code> 필드에는 <strong>최대 500자</strong>까지 지정할 수 있습니다"
          },
          "model_name": {
            "type": "string",
            "description": "<em>AI 모델 이름</em><br><strong>필수 필드</strong><br><code>model_name</code >은 실제 모델 이름과 버전 이름으로 구성됩니다;<br>기본 모델 이름을 지정하면 최신 버전이 기본으로 설정됩니다;<br>사용 가능한 LLM 모델 목록은 다음 엔드포인트로 별도 요청해 받을 수 있습니다: <code>https://api.dataforseo.com/v3/ai_optimization/perplexity/llm_responses/models</code>"
          },
          "max_output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>AI 응답의 최대 토큰 수</em><br>선택 필드<br>최솟값: <code>1</code><br>최댓값: <code>4096</code>;<br>기본값: <code>2048</code>;<br><strong>참고:</strong> 요청에 추론 모델이 지정되면 출력 토큰 수가 지정한 <code>max_output_tokens</code> 한도를 초과할 수 있습니다"
          },
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>AI 응답의 무작위성</em><br>선택 필드<br>값이 높을수록 출력이 더 다양해집니다 <br>값이 낮을수록 출력이 더 집중됩니다<br>최솟값: <code>0</code><br>최댓값: <code>1.9</code><br>기본값: <code>0.77</code>"
          },
          "top_p": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>AI 응답의 다양성</em><br>선택 필드 <br>토큰 선택을 제한하여 응답의 다양성을 제어합니다<br>최솟값: <code>0</code><br>최댓값: <code>1</code> <br>기본값: <code>0.9</code>"
          },
          "web_search_country_iso_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>웹 검색 현지화용 국가 코드</em><br>선택 필드<br>현지화된 웹 검색 결과를 얻으려면 국가 ISO 코드를 지정하세요<br><strong>참고:</strong> Perplexity Sonar 모델에서만 사용할 수 있습니다<br>예: <code>US</code>"
          },
          "system_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>AI 동작 지침</em><br>선택 필드<br>AI의 역할, 어조 또는 특정 동작을 정의합니다 <br><code>system_message</code> 필드에는 <strong>최대 500자</strong>까지 지정할 수 있습니다"
          },
          "message_chain": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ],
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "메시지를 보낸 사용자의 역할"
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "메시지 텍스트"
                    }
                  }
                }
              ]
            },
            "description": "대화 기록\n선택 필드\n이전 대화 턴을 나타내는 메시지 객체 배열입니다;\n각 객체에는 다음이 포함되어야 합니다:\nrole — user 또는 ai 역할을 담은 문자열;\nmessage — 메시지 내용을 담은 문자열(최대 500자);\n배열에는 메시지 객체를 최대 10개까지 지정할 수 있습니다;\n참고: Perplexity 모델의 경우 메시지는 user와 AI 역할이 엄격히 번갈아야 합니다(user → ai);\n예:\n\"message_chain\": [{\"role\":\"user\",\"message\":\"Hello, what’s up?\"},{\"role\":\"ai\",\"message\":\"Hello! I’m doing well, thank you. How can I assist you today?\"}]"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>사용자 정의 작업 식별자</em><br>선택 필드<br><em>최대 255자</em><br>이 매개변수를 사용해 작업을 식별하고 결과와 매칭할 수 있습니다<br><code>tag</code>에 지정한 값은 응답의 <code>data</code> 객체에서 확인할 수 있습니다"
          }
        },
        "example": [
          {
            "system_message": "communicate as if we are in a business meeting",
            "message_chain": [
              {
                "role": "user",
                "message": "Hello, what’s up?"
              },
              {
                "role": "ai",
                "message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
              }
            ],
            "max_output_tokens": 200,
            "temperature": 0.3,
            "top_p": 0.5,
            "web_search_country_iso_code": "FR",
            "model_name": "sonar",
            "user_prompt": "provide information on how relevant the amusement park business is in France now"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "system_message": "communicate as if we are in a business meeting",
      "message_chain": [
        {
          "role": "user",
          "message": "Hello, what’s up?"
        },
        {
          "role": "ai",
          "message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
        }
      ],
      "max_output_tokens": 200,
      "temperature": 0.3,
      "top_p": 0.5,
      "web_search_country_iso_code": "FR",
      "model_name": "sonar",
      "user_prompt": "provide information on how relevant the amusement park business is in France now"
    }
  ]
}
```

## Responses

### 200 — 작업 성공

Headers:
- `X-Request-Id` (string) — Felo 지원팀에 문의할 때 포함할 요청 식별자입니다.

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResponseInfo"
    }
  ]
}
```

### 400 — 요청을 처리할 수 없습니다. 요청 매개변수를 확인하세요.

### 401 — 유효한 Felo API 키가 필요합니다.

### 402 — 청구 요건이 충족되지 않아 요청을 진행할 수 없습니다.

### 403 — 이 계정에는 이 작업을 수행할 권한이 없습니다.

### 429 — 요청 또는 지출 한도에 도달했습니다.

### 502 — 서비스가 요청을 완료할 수 없습니다.

### 503 — API 또는 청구 서비스를 일시적으로 사용할 수 없습니다.

### 504 — 요청을 처리하는 동안 서비스 시간이 초과되었습니다.

### default — 오류 응답. 업스트림 패스스루 응답은 공급자 형식을 사용할 수 있습니다.

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResponseInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveTaskInfo"
              }
            ]
          },
          "description": "<em>작업 배열</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResultInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResultInfo`

```json
{
  "type": "object",
  "properties": {
    "model_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>사용된 AI 모델 이름</em>"
    },
    "input_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>입력의 토큰 수</em><br>처리된 총 토큰 수"
    },
    "output_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>출력의 토큰 수</em><br>AI 응답에서 생성된 총 토큰 수"
    },
    "reasoning_tokens": {
      "type": [
        "integer",
        "null"
      ]
    },
    "web_search": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>웹 검색 사용 여부를 나타냅니다</em><br><strong>참고:</strong> Perplexity Sonar 모델에서는 웹 검색이 기본적으로 활성화되어 있습니다"
    },
    "money_spent": {
      "type": [
        "number",
        "null"
      ],
      "description": "<em>AI 토큰 비용(USD)</em><br>타사 AI 모델 제공업체가 자체 <a href=\"https://docs.perplexity.ai/guides/pricing\" target=\"_blank\">가격 정책</a>에 따라 청구하는 가격"
    },
    "datetime": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>결과를 받은 날짜와 시간</em><br>UTC 형식: “yyyy-mm-dd hh-mm-ss +00:00”<br>예:<br><code class=\"long-string\">2019-11-15 12:57:46 +00:00</code>"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem"
          }
        ]
      },
      "description": "<em>응답 항목 배열</em><br>구조화된 AI 응답 데이터를 포함합니다"
    },
    "fan_out_queries": {
      "type": [
        "object",
        "null"
      ],
      "description": "<em>팬아웃 쿼리 배열</em><br>더 포괄적인 응답을 제공하기 위해 기본 쿼리에서 파생된 관련 검색어를 포함합니다"
    }
  }
}
```

### Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveTaskInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResultInfo"
              }
            ]
          },
          "description": "<em>결과 배열</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_AnnotationInfo

`#/components/schemas/Response36Afe1097B20_AnnotationInfo`

```json
{
  "type": "object",
  "properties": {
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>인용된 출처의 도메인 이름 또는 제목</em>"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>인용된 출처로의 리디렉션 URL</em><br>원본 출처로 연결되는 Vertex AI 리디렉션을 포함합니다"
    },
    "direct_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>인용된 출처로의 직접 URL</em><br>`url` 필드의 Vertex AI 리디렉션이 연결되는 원본 출처 URL을 포함합니다"
    },
    "start_index": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>어노테이션 인덱싱 시작</em>"
    },
    "end_index": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>어노테이션 인덱싱 종료</em>"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>추론 체인 섹션의 텍스트</em><br>모델의 사고 과정을 요약하는 추론 체인 섹션의 텍스트"
    }
  }
}
```

### Response36Afe1097B20_BaseAiOptimizationLlmResponseElementItem

`#/components/schemas/Response36Afe1097B20_BaseAiOptimizationLlmResponseElementItem`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "요소 유형"
    }
  },
  "additionalProperties": false,
  "discriminator": {
    "propertyName": "type",
    "mapping": {
      "reasoning": "#/components/schemas/Response36Afe1097B20_ReasoningAiOptimizationLlmResponseElementItem",
      "message": "#/components/schemas/Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API의 현재 버전"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "일반 상태 코드입니다.\n응답 코드 전체 목록은 여기에서 확인할 수 있습니다."
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "일반 정보 메시지입니다.\n일반 정보 메시지 전체 목록은 여기에서 확인할 수 있습니다."
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "총 실행 시간(초)"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "전체 작업 비용, USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 배열의 작업 수",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "오류와 함께 반환된 tasks 배열의 작업 수",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "작업 식별자\n시스템 내 고유 작업 식별자(UUID 형식)"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "작업의 상태 코드\nDataForSEO가 생성하며 10000-60000 범위일 수 있습니다.\n응답 코드 전체 목록은 여기에서 확인할 수 있습니다."
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "작업의 정보 메시지\n일반 정보 메시지 전체 목록은 여기에서 확인할 수 있습니다."
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "실행 시간, 초"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "전체 작업 비용, USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result 배열의 요소 수",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL 경로"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "POST 요청에 지정한 것과 동일한 매개변수를 포함합니다"
    }
  }
}
```

### Response36Afe1097B20_LlmMessageSectionInfo

`#/components/schemas/Response36Afe1097B20_LlmMessageSectionInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "요소 유형"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>추론 체인 섹션의 텍스트</em><br>모델의 사고 과정을 요약하는 추론 체인 섹션의 텍스트"
    },
    "annotations": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_AnnotationInfo"
          }
        ]
      },
      "description": "<em>응답 생성에 사용된 참조 배열</em><br><code>web_search</code> 매개변수가 <code>true</code>로 설정되지 않으면 <code>null</code>입니다.<br><strong>참고:</strong> AI가 웹 정보를 검색하려고 시도하지만 관련 결과를 찾지 못할 수 있으므로 <code>web_search</code>가 <code>true</code>여도 <code>annotations</code>가 비어 있을 수 있습니다"
    }
  }
}
```

### Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem

`#/components/schemas/Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseAiOptimizationLlmResponseElementItem"
    },
    {
      "type": "object",
      "properties": {
        "sections": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_LlmMessageSectionInfo"
              }
            ]
          },
          "description": "<em>추론 체인 섹션</em><br>LLM이 생성한 추론 체인 섹션을 담은 객체 배열"
        }
      }
    }
  ]
}
```
