Perplexity API
Generate answers and research reports with web citations.
Perplexity Sonar Deep Research
여러 웹 검색과 인용 출처를 사용해 리서치 보고서를 생성합니다. model과 messages는 필수이며, 이 엔드포인트에는 model sonar-deep-research를 사용하세요. 이 공개 계약은 stream false를 사용하는 비스트리밍 JSON 응답을 다룹니다. 리서치는 몇 분이 걸릴 수 있으며 게이트웨이나 클라이언트 타임아웃을 초과할 수 있습니다. 보고서와 출처는 choices[].message.content, citations, search_results에서 읽으세요. usage는 Felo 크레딧 청구가 아닙니다.
가격 참고
- 과금 기준: 응답에 보고된 비용.
- 참고 요청 추정치: USD 0.23932.
- 참고 고객 배수: 1.0. 정산된 고객 금액에 다시 적용하지 마세요.
참고용 메타데이터일 뿐이며, 계정 견적 또는 보장된 가격 또는 지출 한도가 아닙니다. 리소스 크레딧은 Felo 크레딧이 아닙니다. 최종 청구는 Felo 청구 기록을 따릅니다.
- 유형: array object[]messages필수
지금까지의 대화를 구성하는 메시지 목록입니다.
- content유형: string필수
메시지의 콘텐츠입니다.
- role유형: string 열거형필수
메시지 작성자의 역할입니다.
값- system
- user
- assistant
- 유형: string 열거형model필수
사용할 Sonar 모델입니다.
값- sonar
- sonar
-pro - sonar
-reasoning -pro - sonar
-deep -research
- 유형: numberfrequency
_penalty 최솟값:0최댓값:2지금까지 텍스트에서의 기존 빈도에 따라 새 토큰에 패널티를 부여합니다. 양수 값은 동일한 문장을 그대로 반복할 가능성을 낮춥니다.
- 유형: integermax
_tokens 응답에서 생성할 최대 토큰 수입니다.
- 유형: numberpresence
_penalty 최솟값:-2최댓값:2지금까지 텍스트에 나타났는지 여부에 따라 새 토큰에 패널티를 부여합니다. 양수 값은 새로운 주제를 다룰 가능성을 높입니다.
- 유형: booleanreturn
_citations 응답에 인용과 검색 결과를 반환할지 여부입니다.
- 유형: string 열거형search
_context 사용할 검색 컨텍스트의 양을 제어합니다. 요청당 비용에 영향을 미칩니다.
값- low
- medium
- high
- 유형: array string[]search
_domain _filter 검색을 특정 도메인으로 제한합니다.
- 유형: string 열거형search
_recency _filter 최신성에 따라 검색 결과를 필터링합니다.
값- month
- week
- day
- hour
- 유형: booleanstream
서버 전송 이벤트를 사용하여 응답을 스트리밍할지 여부입니다.
- 유형: numbertemperature최솟값:0최댓값:2
0~2 사이의 샘플링 온도입니다. 값이 낮을수록 출력이 더 집중되고 결정적입니다.
- 유형: integertop
_k 최솟값:0최댓값:2048top-k 필터링에 유지할 토큰 수입니다.
- 유형: numbertop
_p 최솟값:0최댓값:1뉴클리어스 샘플링 매개변수입니다. 모델은 top_p 확률 질량을 가진 토큰을 고려합니다.
- 유형: object · ResponseD5E2470Dd28B_ChatCompletionResponse200
AI 답변과 인용이 포함된 성공 응답
- 유형: array object[]choices
- finish유형: string 열거형
_reason 값- stop
- length
- index유형: integer
Integer numbers.
- message유형: object
- content유형: string
[1][2]와 같은 인라인 인용 참조가 포함된 AI 생성 답변입니다.
- role유형: string
- 유형: array string[]citations
답변에서 참조된 소스 URL 목록입니다.
- 유형: integercreated
완료 응답이 생성된 Unix 타임스탬프입니다.
- 유형: stringid
완료 응답의 고유 식별자입니다.
- 유형: stringmodel
완료 응답에 사용된 모델입니다.
- 유형: stringobject
- 유형: array object[]search
_results 제목, 스니펫, URL이 포함된 상세 검색 결과입니다.
- date유형: string
- snippet유형: string
- source유형: string
- title유형: string
- url유형: string
- 유형: objectusage
- completion유형: integer
_tokens Integer numbers.
- prompt유형: integer
_tokens Integer numbers.
- search유형: string
_context _size - total유형: integer
_tokens Integer numbers.
application/json - 400
요청을 처리할 수 없습니다. 요청 매개변수를 확인하세요.
- 401
유효한 Felo API 키가 필요합니다.
- 402
청구 요건이 충족되지 않아 요청을 진행할 수 없습니다.
- 403
이 계정에는 이 작업을 수행할 권한이 없습니다.
- 429
요청 또는 지출 한도에 도달했습니다.
- 502
서비스가 요청을 완료할 수 없습니다.
- 503
API 또는 청구 서비스를 일시적으로 사용할 수 없습니다.
- 504
요청을 처리하는 동안 서비스 시간이 초과되었습니다.
- default
오류 응답. 업스트림 패스스루 응답은 공급자 형식을 사용할 수 있습니다.
application/json
curl --request POST https://openapi.felo.ai/v1/beta/perplexity/sonar-deep-research \
--header "Authorization: Bearer ${FELO_API_KEY:?Set FELO_API_KEY}" \
--header 'Content-Type: application/json' \
--data '{"model": "sonar-deep-research", "messages": [{"role": "user", "content": "Research HTTP caching strategies for public APIs, with references to standards."}], "max_tokens": 4096, "stream": false}'
{
"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
}
}