Exclusively available on the OpenRouter API, Sonar Pro's new Pro Search mode is Perplexity's most advanced agentic search system. It is designed for deeper reasoning and analysis. Pricing is based...
from openai import OpenAI
client = OpenAI(
base_url="https://infergate.ru/api/v1",
api_key="ig-•••",
)
resp = client.chat.completions.create(
model="perplexity/sonar-pro-search",
messages=[{"role": "user", "content": "Привет!"}],
)
print(resp.choices[0].message.content)modelstringобязательныйmessagesarrayобязательныйtemperaturenumbermax_tokensintegertop_pnumbertop_kintegerfrequency_penaltynumberpresence_penaltynumberstructured_outputsbooleanreasoningobjectinclude_reasoningbooleanweb_search_optionsobject