GPT 4 Vision Timeout while Downloading image_url

I’m trying to use GPT-4 Turbo to interpret an image. Although I’ve confirmed that the image URL is accessible in a web browser, I consistently encounter the following error message:

Error code: 400 - {‘error’: {‘message’: ‘Timeout while downloading {image_url}’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘invalid_image_url’}}

2 Likes

Same thing, “Timeout while downloading” a pre-signed image from an AWS bucket.

Can I have the image address so I can test it on my end? It may be breaking the no real people rules, or other filters.

The image I used is very public. It is the toy in my hand…

Welcome to the forum it is wonderland lol :rabbit: @Dmanea

I also got same error ,and I used ‘https://i.ibb.co/NrZX1dj/2022040414050315369-1649048703.jpg’ , ‘https://i.ibb.co/5LT64j0/pasta.jpg’ .

Yeah they won’t read on my machine either super weird🐰 it may be issues with hosting but no clue who’s end it’s on. @_j you ever seen this error?

Hello, I also get the same error trying to download a public image from a google drive. Would love to know if there is a fix :slight_smile:

OpenAI checks the robots.txt file of a site to see if a webmaster has put in “no ChatGPT bot” rules, or others, which OpenAI respects.

The robots.txt file https://i.ibb.co/robots.txt returns a secure connection error when used in a stateless browser. That may be why the image retriever cannot continue.

2 Likes

TY @_j :rabbit: out of :heart:s. This one was a hard nut to crack :nut_and_bolt:

Having same when making API call to GPT 4 Vision. Is there any solution for this?

If you’re encountering a timeout error when providing a URL link as the source of an image to the API method, it might be due to network issues with retrieval, as previously mentioned. Here’s a recommended approach to handle this, which may be your solution:

  1. Download the Image Locally: Instead of providing the URL directly to the API, you could download the image to your local system or server. This gives you more control over the process and allows you to handle any network issues that might occur during the download.

  2. Persistent Network Requests: Network issues can be unpredictable. Therefore, it’s advisable to implement a retry mechanism for your network requests. This ensures that temporary network issues don’t cause permanent failures.

  3. Verify the Image Contents: Once the image is downloaded, verify its contents to ensure it’s valid and meets the requirements of the API. This could include checking the file type, size, and dimensions.

  4. Rescale to a Token Budget: If the image is too large, it might exceed the cost you enforce, or take longer to transmit. In this case, you can rescale or resize the image to fit within the token budget, or use the detail setting.

  5. Provide Feedback: If an image isn’t returned or if there’s an issue with the image, provide feedback to the user. This could be in the form of an error message or a prompt to upload a different image. No need to make unnecessary API requests.

  6. Upload the Image: Once the image has been validated and possibly rescaled, you can then upload it to the API, attaching to the content of a user message. Use the appropriate method for the endpoint you’re using.

By following these steps, you can ensure a more robust and reliable image handling process when working with the API than relying on OpenAI’s downloader.

1 Like

It randomly works without me changing anything. Same image will go through. Then it won’t. Fails more often than succeeds though. New problem with an old workflow that just started to pop up in the last week.

I am facing this same issue with the following URL - https://benny-image-shop.s3.ap-south-1.amazonaws.com/2024-10-29/1730203065277000_152.59.78.213.jpg

Please help me out on this. @_j or anyone

1 Like

Same here, “Timeout while downloading” using google media URL’s. After retrying X amount of times it works and then randomly fails again.

Model: “gpt-4o-mini”

I am facing the same issue

I’m getting the same error, but after some hair pulling, I’m noticing something extra strange:

Here’s my data, edited for privacy:

[{‘role’: ‘system’, ‘content’: ‘You are a friendly chatbot’}, {‘role’: ‘user’, ‘content’: [{‘type’: ‘image_url’, ‘image_url’: {‘url’: ‘https://my.site/viz/images/d65d4cb5dbe418e46101e6aa535d491a’, ‘detail’: ‘low’}}, {‘type’: ‘text’, ‘text’: ‘What is this?’}]}]

Note that the url is to a jpg. The error occurs with or without the .jpg extension.

Now here’s the confusing part. Notice what’s wrong with the URL in the error response?:

Error processing request: Error code: 400 - {‘error’: {‘message’: ‘Timeout while downloading https://my.site/viz/images/d65d4cb5dbe418e46101e6aa535d491a.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘invalid_image_url’}}

Somehow, there’s a ‘.’ at the end of the URL.

Is that just a goof because somebody decided to put punctuation in the error message, or is that ‘.’ actually being stuck onto the end? :stuck_out_tongue:

It happened to me with gpt4o but seems to happen only when the image is large and it takes a few seconds to load.

From all my experiments, I have realised the base64 format of providing the image for vision purposes failed very rarely. Although for large images, the request could get slow or timeout, it’s better to compress the image, and send as base64. It is faster too.

use this -

{
    "type": "image_url",
    "image_url": {
        "url":  f"data:image/{file_ext};base64,{base64_image}"
    },
}
2 Likes

hey dude, the full stop symbol has nothing to be seen as something strange. It is the error message in a proper sentence form with a ‘.’ at the end . So ‘Timeout while downloading image_url.’ is the error message sentence generated from the api call. If i click on the image_url, it is opening properly which means the image_url stays original. In the image below you can see that the image_url is in green color while the . symbol at the end is in black color.