# Structured output stopped working for sonar-reasoning-pro

**URL:** <https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902>\
**Category:** Bug Reports\
**Created:** [August 6, 2025, 4:36pm UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902 "2025-08-06T16:36:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eee](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@eee](https://community.perplexity.ai/u/eee)\
**Post date:** [August 6, 2025, 4:36pm UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902/1 "2025-08-06T16:36:38Z")

</div>

## 🐛 Describe the Bug

Until yesterday, structured JSON output worked when using sonar-reasoning-pro.

Here is a minimal query example:

```auto
import json

import requests
import pydantic

class MyBaseModel(pydantic.BaseModel):
    model_config = pydantic.ConfigDict(extra="forbid")

class GenericAnswerFormat(pydantic.BaseModel):
    result: str

url = "https://api.perplexity.ai/chat/completions"

headers = {
    "Authorization": f"Bearer {yourkeyhere}",
    "Content-Type": "application/json",
}

data = {
    "model": "sonar-reasoning-pro",
    "messages": [
        {
            "role": "system",
            "content": "You are an AI assistant that provides structured JSON output.",
        },
        {
            "role": "user",
            "content": "Give me information about the Eiffel Tower in Paris.",
        },
    ],
    "response_format": {
        "type": "json_schema",
        "json_schema": {"schema": GenericAnswerFormat.model_json_schema()},
    },
}

print(json.dumps(data, indent=2))

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Error: {response.status_code}, {response.text}")

```

## ✅ Expected Behavior

Get a result.

## ❌ Actual Behavior

`Error: 400, {“error”:{“message”:“Structured output schema error. Please refer to ` [Page Not Found](https://docs.perplexity.ai/guides/structured-outputs%60) for more information.”,“type”:“invalid\_parameter”,“code”:400}}`

☝🏻 If I change the model to “sonar-pro” above, the query works as expected.

## 🔄 Steps to Reproduce

See above.

##

---

<div class="post-metadata">

**Author:** ![vikvang](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vikvang](https://community.perplexity.ai/u/vikvang)\
**Post date:** [August 7, 2025, 12:29am UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902/2 "2025-08-07T00:29:05Z")

</div>

Hey! Just reproduced on my end and it seems to work for both `sonar-pro` and` sonar-reasoning-pro`. Can you please try again?

---

<div class="post-metadata">

**Author:** ![yilinjuang](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/yilinjuang/32/604_2.png) [@yilinjuang](https://community.perplexity.ai/u/yilinjuang)\
**Post date:** [August 7, 2025, 9:24am UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902/4 "2025-08-07T09:24:54Z")

</div>

I got the same error.

sonar, sonar-pro, sonar-reasoning works.

sonar-reasoning-pro, sonar-deep-research throws the following error. They worked two days ago, and nothing has changed on our end.

```json
{
  error: {
    message: 'Structured output schema error. Please refer to https://docs.perplexity.ai/guides/structured-outputs for more information.',
    type: 'invalid_parameter',
    code: 400
  }
}

```

```javascript
fetch('https://api.perplexity.ai/chat/completions', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer pplx-token`,
  },
  body: JSON.stringify({
    model: 'sonar-deep-research',
    response_format: {
      type: 'json_schema',
      json_schema: {
        schema: {
          type: 'object',
          properties: {
            products: {
              type: 'array',
              items: {
                type: 'object',
                properties: {
                  name: {
                    type: 'string',
                  },
                  description: {
                    type: 'string',
                  },
                },
                required: ['name', 'description'],
              },
            },
          },
          required: ['products'],
        },
      },
    },
    reasoning_effort: 'low',
    messages: [
      {
        role: 'user',
        content:
          'List up to 10 highly relevant commercial products that use AI to enhance image editing. For each product, include its name and a concise description.',
      },
    ],
  }),
})
  .then((res) => res.json())
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

```

---

<div class="post-metadata">

**Author:** ![FPOscar](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/fposcar/32/609_2.png) [@FPOscar](https://community.perplexity.ai/u/FPOscar)\
**Post date:** [August 7, 2025, 4:05pm UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902/5 "2025-08-07T16:05:44Z")

</div>

Im also seeing the same issue with reasoning pro, have some code I run every 2 weeks with structured output and today is failing - error 400

---

<div class="post-metadata">

**Author:** ![eee](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@eee](https://community.perplexity.ai/u/eee)\
**Post date:** [August 7, 2025, 6:29pm UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902/6 "2025-08-07T18:29:07Z")

</div>

I tried my minimal example from above again about 8 hours ago, at that time I still got the error as described. Now it seems to work, also for sonar-reasoning-pro! Fingers crossed that this is a permanent fix…

---

<div class="post-metadata">

**Author:** ![vikvang](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vikvang](https://community.perplexity.ai/u/vikvang)\
**Post date:** [August 7, 2025, 6:30pm UTC](https://community.perplexity.ai/t/structured-output-stopped-working-for-sonar-reasoning-pro/902/7 "2025-08-07T18:30:47Z")

</div>

Woohoo! Glad it’s working. Please make another note if something breaks or doesn’t work as intended.
