Invalid_image_url error code for image urls without file extension

At 23:25 UTC, Chat Completions API started throwing 400 timeout errors for our requests with prompt containing image_url where the url does not have a file extension. We have images stored in S3 (CloudFront) w/o file extension info, and have never had an issue until today. Is anyone else experiencing this?

There was a related topic about the Assistants API not supporting image urls w/o file extension, but not Chat Completions API.

I could not replicate. It may be the service or its robots.txt policy.

Four different image sources without file extension:

from openai import OpenAI
client = OpenAI()

response = client.chat.completions.create(
  model="gpt-4o",
  messages=[
    {
      "role": "user",
      "content": [
        {
          "type": "image_url",
          "image_url": {
            "url": "https://lh3.googleusercontent.com/d/1qH4wvzP260vJ_P7BLAJD5SiH-LG-dqI4"
          }
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9"
          }
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://graph.facebook.com/NASA/picture?type=large"
          }
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://avatars.githubusercontent.com/u/1?v=4"
          }
        },
        {
          "type": "text",
          "text": "extract any image text from images"
        }
      ]
    }
  ],
  max_completion_tokens=100,
  top_p=0.1,
)
print(response.choices[0].message.content)

Results in:

1. The first image is of a dog and does not contain any text.
2. The second image has the text: "Make something awesome." and "#unsplash".
3. The third image is the NASA logo, which includes the text: "NASA".
4. The fourth image is of a person and does not contain any text.

It also may be mime type header, where these would have:

content-type:image/png

2 Likes

Thanks so much for your effort and expeditious reply! Glad to see that it’s not a general issue. Will try some more direct reproduction efforts tomorrow.

1 Like

Update: Chat Completions API is working as expected this morning, so I guess the issue was resolved upstream.

1 Like