Perplexity Sonar is Perplexity AI's search-grounded model family, built specifically to power "AI search engine" style question-answering rather than general open-ended chat. It ranks #12 in usage share at roughly 7.6%. Its defining feature is that every answer comes back with live web citations attached, so users (and API callers) can see exactly which sources backed a given claim โ reducing hallucination risk compared to models with no live web access.
The Sonar API uses the same OpenAI-compatible chat completions format, but responses include a citations field with the source URLs behind the answer.
curl https://api.perplexity.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "sonar",
"messages": [{"role": "user", "content": "What are the latest updates to the Python 3.14 release?"}]
}'
# the JSON response includes a "citations" array
# alongside the normal chat completion, e.g.
{
"choices": [...],
"citations": ["https://docs.python.org/3.14/whatsnew/3.14.html", ...]
}
Sign up for a Perplexity API key from the developer settings page, then call the endpoint with any HTTP client.
# 1. sign up and generate an API key at perplexity.ai/settings/api
# 2. call it with curl, requests, or the OpenAI SDK pointed at
# base_url = "https://api.perplexity.ai"
export PERPLEXITY_API_KEY="your-key-here"