Conversations API bug: Cannot post messages with images to the endpoint

Adding items to the conversation using ‘‘Create Items” fails when adding the input_image item

Post conversations/conv_xyz/items

Request:
{
    "items": [
        {
            "type": "message",
            "content": [
                {
                    "type": "input_text",
                    "text": "Okay lets analyze my starter"
                },
                {
                    "type": "input_image",
                    "image_url": "https://images.food52.com/t9oX_tD1C21tZd5Duhh9NmH2FzI=/27aa2e1d-5b46-4c04-b424-045780c98ca8--IMG_0953.jpg"
                }
            ],
            "role": "user"
        }
    ]
}

Response 400 Bad Request:
{
    "error": {
        "message": "Error while downloading https://images.food52.com/t9oX_tD1C21tZd5Duhh9NmH2FzI=/27aa2e1d-5b46-4c04-b424-045780c98ca8--IMG_0953.jpg.",
        "type": "invalid_request_error",
        "param": "url",
        "code": "invalid_value"
    }
}
2 Likes

I pasted your very picture into my “demo” app; MODEL: str = "gpt-4.1-mini":

def main() -> None:
    conversation_id: str = create_conversation()
    prompt: str = "Introduce yourself"

    prompt: list = [
        {
            "type": "message",
            "role": "user",
            "content": [
                {"type": "input_text", "text": "What do you see in the picture?"},    
                {
                    "type": "input_image",
                    "image_url": "https://images.food52.com/t9oX_tD1C21tZd5Duhh9NmH2FzI=/27aa2e1d-5b46-4c04-b424-045780c98ca8--IMG_0953.jpg"
                }
            ],
        }
    ]
_doc_: OpenAI Conversations + Responses: server-side chat memory demo
One Conversation per run; server keeps history across turns.
Default: streaming via SSE; prints deltas; usage on completion.
Toggle non-streaming with USE_STREAMING.
instructions=SYSTEM sent per request (Conversation minimal).
Payload built by build_responses_payload; caller sets stream.
Persisted response (store:true) deleted after completion.
Lockfile aids cleanup; Conversation deleted on exit.

Conversation created conv_68f720aa979481939ebe1393903169cb0dbe35c389dc73b3

[assistant:] The picture shows a glass jar filled with a bubbly, frothy mixture. This appears to be a sourdough starter, which is a fermented mixture of flour and water used for baking sourdough bread. The bubbles indicate active fermentation by wild yeast and bacteria.
[conv-debug] baseline established; count=2
Response ID deleted: resp_0dbe35c389dc73b30068f720ab2338819392bcebd76d7e6be5
–Usage-- in/cached: 2454/0; out/reasoning:54/0

Are you employing a model without vision?

I would not use conversations as a “thread”, but instead, send your newest message as “input”.

The image as chat history via conversations works:

Prompt (or 'exit'): What color is the glass?

[assistant:] The glass is clear and transparent.
[conv-debug] items changed 2→4; verified
--Usage--  in/cached: 2521/1536;  out/reasoning:8/0

I can get an error adding “items” to conversations with an input_image content part in a user message.

Then I look at the API shape and see fields marked here, “required” in red:

Let’s pretend that detail being required means it is required, and even than sending “auto” is not enough (which ALWAYS means high, anyway)

prompt: list = [
    {
        "type": "message",
        "role": "user",
        "content": [
            {"type": "input_text", "text": "What do you see in the picture?"},    
            {
                "type": "input_image", "detail": "high",
                "image_url": "https://images.food52.com/t9oX_tD1C21tZd5Duhh9NmH2FzI=/27aa2e1d-5b46-4c04-b424-045780c98ca8--IMG_0953.jpg"
            }
        ],
    }
]

conversations_payload = {
    "metadata": {"conversations": "a failure"},
    "items": prompt,
}

Nope. 400 error on the described input shape.

At least new inputs from an API call being run are even being added, not the case just a few days ago.

Thanks for checking. Yes, the problem exists with the Create Items endpoint. The Responses API works fine with the image.

Same issue here. Did you find any solution? I’m unable to upload any image file to the Conversations API, it keeps throwing a 400 Error downloading.

An interesting detail: I first upload the file to the Files API, then reference it in the Conversations API using the file_id. However, when the error occurs, the message indicates that an Azure URL was attempted to be downloaded.

Example:

const message: ResponseInputItem.Message = {
  content: [
    { type: "input_text", text: "Check this image" },
    {
      type: "input_image",
      image_url:
        "https://hips.hearstapps.com/hmg-prod/images/dog-puppy-on-garden-royalty-free-image-1586966191.jpg",
      detail: "high",
    },
  ],
  role: "user",
};

const created = await openai.conversations.items.create(conversationId, {
  items: [message],
});

Results in:

{
  "message": "Error while downloading https://hips.hearstapps.com/hmg-prod/images/dog-puppy-on-garden-royalty-free-image-1586966191.jpg.",
  "type": "invalid_request_error",
  "param": "url",
  "code": "invalid_value"
}

Nope, it’s a clear bug on OpenAI’s side. I reached out to their support, but they are bullshitting me with the same thing, asking me to provide a video with a different host, while I have tested and provided evidence with 6 different hosts that it’s not working.

1 Like

The correct path if I was running that operation:

“We see you told an API developer to make a screenshot or a browser web log. You have not a whiff of comprehension of the issue. You are fired.” “Your contract is terminated”.

“We see you released to production an API stateful product that cannot even stream, will fail silently to store if ZDR or if an unwanted “store”:true is not sent, cannot use images as placement, and doesn’t store tool messages vital for success. You are fired.”

“You called Responses at feature-parity (to anything). You also are sacked.”

More “conversations” issues continue, that never worked:

1 Like

@OpenAI_Support @OpenAIAPIhelper please look into this :folded_hands:

I figured out a solution! In the image_url field, upload the file encoded as Base64. That should work correctly. Still, OpenAI should look into this, since using a real URL or file_id should be supported. But for now, this workaround does the job!