# "sonar-pro" Model Returns 400 Invalid Model Error Despite Valid Setup

**URL:** <https://community.perplexity.ai/t/sonar-pro-model-returns-400-invalid-model-error-despite-valid-setup/623>\
**Category:** Bug Reports\
**Created:** [July 4, 2025, 12:26am UTC](https://community.perplexity.ai/t/sonar-pro-model-returns-400-invalid-model-error-despite-valid-setup/623 "2025-07-04T00:26:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Groves](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/nick_groves/32/353_2.png) [@Nick\_Groves](https://community.perplexity.ai/u/Nick_Groves)\
**Post date:** [July 4, 2025, 12:26am UTC](https://community.perplexity.ai/t/sonar-pro-model-returns-400-invalid-model-error-despite-valid-setup/623/1 "2025-07-04T00:26:35Z")

</div>

## 🐛 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

```auto
{
  "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` or `curl`.
- 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

```auto
{
  "Authorization": "Bearer [API_KEY]",
  "Content-Type": "application/json"
}

```

**Response:**

json

CopyEdit

```auto
{
  "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, but `sonar-pro` fails consistently

- This is a blocking issue for integrating Perplexity into a production app

---

<div class="post-metadata">

**Author:** ![jamesliounis](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/jamesliounis/32/897_2.png) [@jamesliounis](https://community.perplexity.ai/u/jamesliounis)\
**Post date:** [July 5, 2025, 12:58am UTC](https://community.perplexity.ai/t/sonar-pro-model-returns-400-invalid-model-error-despite-valid-setup/623/2 "2025-07-05T00:58:46Z")

</div>

Hey Nick - James here from the API team. I just tried to repro and sonar-pro is working fine. Can you please share a cURL request that caused the bug you’re describing? Below request works.

```curl
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer pplx- \
--data '{
  "model": "sonar-pro",
  "messages": [
    {
      "role": "system",
      "content": "Be precise and concise."
    },
    {
      "role": "user",
      "content": "How many stars are there in our galaxy?"
    }
  ]
}'
```
