# Posting image to sonar-deep-research leads to 500 error

**URL:** <https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204>\
**Category:** Bug Reports\
**Created:** [May 24, 2025, 4:46am UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204 "2025-05-24T04:46:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yosun](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/yosun/32/59_2.png) [@yosun](https://community.perplexity.ai/u/yosun)\
**Post date:** [May 24, 2025, 4:46am UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204/1 "2025-05-24T04:46:23Z")

</div>

## 🐛 Describe the Bug

Posted an image to sonar-deep-research but got a 500 error

## ✅ Expected Behavior

What you expected to happen.

## ❌ Actual Behavior

```auto
HTTP/1.1 500 Internal Server Error
Date: Sat, 24 May 2025 04:42:27 GMT
Content-Type: application/json
Content-Length: 104
Connection: close
cf-cache-status: DYNAMIC
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
Server: cloudflare
CF-RAY: 944a1f7fbc938f76-BOS

{"error":{"message":"An internal server error has occurred.","type":"internal_server_error","code":500}}

```

## 🔄 Steps to Reproduce

post a content array with two entries for user: with a text question and a type image\_url

```auto
{
  "model": "sonar-deep-research",
  "messages": [
    {
      "role": "system",
      "content": "Provide facts as force diagram nodes with: id, title, description, child_of_id, and citation_ids"
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Tell me about the sculpture on the bridge in the background; is it original? Provide all possible and relevant knowledge about this photo. User lat lng unknown. Format response as JSON array of nodes. Each node must contain: id (integer), title (string), description (string), child_of_id (integer|null), and citation_ids (array of indices referencing root citations)."
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://i.gyazo.com/33984c4ec2dc9b92d1f0ccca55c0d316.jpg"
          }
        }
      ]
    }
  ],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "schema": {
        "title": "ForceDiagram",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "title": "Node ID"
            },
            "title": {
              "type": "string",
              "title": "Node Title"
            },
            "description": {
              "type": "string",
              "title": "Node Description"
            },
            "child_of_id": {
              "type": [
                "integer",
                "null"
              ],
              "title": "Parent Node ID"
            },
            "citation_ids": {
              "type": "array",
              "items": {
                "type": "integer"
              },
              "title": "Citation References",
              "description": "Array indices matching root citations array"
            }
          },
          "required": [
            "id",
            "title",
            "description"
          ]
        }
      }
    }
  }
}

```

## 📌 API Request & Response (if applicable)

## 🌍 Environment

- **API Version:** sonar-deep-research
- **SDK (if applicable):** CURL / REST

## 📎 Logs or Screenshots (if applicable)

Add any logs or screenshots that can help debug the issue.

## 📝 Additional Context

Add any other context about the problem here.

---

<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:** [May 25, 2025, 9:56pm UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204/2 "2025-05-25T21:56:54Z")

</div>

Unfortunately, sonar deep research does not yet support image uploads. Please bear with us as we introduce this functionality.

---

<div class="post-metadata">

**Author:** ![yosun](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/yosun/32/59_2.png) [@yosun](https://community.perplexity.ai/u/yosun)\
**Post date:** [May 26, 2025, 12:03pm UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204/3 "2025-05-26T12:03:13Z")

</div>

ah which think models support image?

---

<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:** [May 29, 2025, 6:33pm UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204/4 "2025-05-29T18:33:21Z")

</div>

All of them except this one.

---

<div class="post-metadata">

**Author:** ![yosun](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/yosun/32/59_2.png) [@yosun](https://community.perplexity.ai/u/yosun)\
**Post date:** [May 30, 2025, 12:28am UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204/5 "2025-05-30T00:28:04Z")

</div>

as a sanity check, can you send a sample full curl request? i keep getting 500 and 400 errors when i try posting an image (by using url not base64)

---

<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:** [June 2, 2025, 12:26am UTC](https://community.perplexity.ai/t/posting-image-to-sonar-deep-research-leads-to-500-error/204/6 "2025-06-02T00:26:21Z")

</div>

That’s why! It needs to be base64 encoded. Here’s an example:

```curl
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
  "model": "sonar-pro",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Can you describe this image?"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." // Replace with your base64 string
          }
        }
      ]
    }
  ]
}'
```
