Describe the Bug
Calling the /chat/completions
endpoint with a valid sonar-pro
model results in a 400
error stating “Invalid model ‘sonar-pro’” — even though this is listed as a supported model in the documentation and confirmed by your support team.
Expected Behavior
A valid JSON response from the sonar-pro
model, containing a reply to the user’s message.
Actual Behavior
The API returns a 400 error:
json
CopyEdit
{
"error": {
"message": "Invalid model 'sonar-pro'. Permitted models can be found in the documentation at https://docs.perplexity.ai/guides/model-cards.",
"type": "invalid_model",
"code": 400
}
Steps to Reproduce
- Call the Perplexity API with the payload below using Python
requests
orcurl
. - Observe that the response is a 400 error.
API Request & Response (if applicable)
{
“model”: “sonar-pro”,
“messages”: [{“role”: “user”, “content”: “What did Powell say this week?”}],
“stream”: false
}
Headers:
json
CopyEdit
{
"Authorization": "Bearer [API_KEY]",
"Content-Type": "application/json"
}
Response:
json
CopyEdit
{
"error": {
"message": "Invalid model 'sonar-pro'",
"type": "invalid_model",
"code": 400
}
}
Environment
-
API Version: Latest as of July 1, 2025
-
SDK: Python (
requests
) -
Operating System: Windows 10
-
API key is valid and
.env
is configured properly -
Other models like
sonar
may work, butsonar-pro
fails consistently -
This is a blocking issue for integrating Perplexity into a production app