Back to All Models
Perplexity · Balanced

Sonar

perplexity/sonar
Use Model Now

Sonar is lightweight, affordable, fast, and simple to use — now featuring citations and the ability to customize sources.

Input Price / 1M Tokens
$1.35
Output Price / 1M Tokens
$1.35
Context Window
127K
Vision
Python Example — perplexity/sonar
from openai import OpenAI

client = OpenAI(
    base_url="https://relaystack-ai.vercel.app/v1",
    api_key="sk-rs-your-key-here",
)

response = client.chat.completions.create(
    model="perplexity/sonar",
    messages=[{"role": "user", "content": "Hello from RelayStack!"}],
)
print(response.choices[0].message.content)