Perplexity
Sonar
Perplexity 在线搜索模型,实时访问互联网获取最新信息
模型类型在线搜索模型
特色能力实时网络搜索
搜索查询$0.005/次
定价与规格
💰 定价
输入$1 / M tokens
输出$1 / M tokens
⚙️ 规格
模型类型在线搜索模型
特色能力实时网络搜索
搜索查询$0.005/次
数据源实时互联网数据
API 调用示例
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.xairouter.com/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="sonar",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)cURL
curl https://api.xairouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "sonar",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'