Note: Sonar Pro pricing includes Perplexity search pricing. See details here For enterprises seeking more advanced capabilities, the Sonar Pro API can handle in-depth, multi-step queries with added extensibility, like...
Reroute speaks the OpenAI Chat Completions format. Point any OpenAI SDK at https://reroute.wtf/api/v1 and use perplexity/sonar-pro as the model.
curl https://reroute.wtf/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $REROUTE_API_KEY" \
-d '{
"model": "perplexity/sonar-pro",
"messages": [
{ "role": "user", "content": "What is the meaning of life?" }
]
}'Set stream: true to receive server-sent events. The final chunk carries usage and cost.
curl -N https://reroute.wtf/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $REROUTE_API_KEY" \
-d '{ "model": "perplexity/sonar-pro", "stream": true,
"messages": [{ "role": "user", "content": "Count to five" }] }'