Perplexity: Sonar
perplexity/sonarSonar is lightweight, affordable, fast, and simple to use — now featuring citations and the ability to customize sources. It is designed for companies seeking to integrate lightweight question-and-answer features...
Доступна через единый OpenAI-совместимый API AI Gateway: подключайтесь через привычный SDK — меняется только base_url и параметр model. Оплата в рублях, контроль расхода и данные в РФ.
Быстрый старт
Первый запрос к perplexity/sonar — скопируйте и подставьте свой ключ.
from openai import OpenAI
client = OpenAI(
base_url="https://ai-gatewey.ru/v1",
api_key="sk-aigate-ваш_ключ",
)
resp = client.chat.completions.create(
model="perplexity/sonar",
messages=[{"role": "user", "content": "Привет!"}],
)
print(resp.choices[0].message.content)