How to get gpt-vision-preview in api call to correctly read a publicly accessible jpg image from Google Drive?

Error message:

openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: “You uploaded an unsupported image. Please make sure your image is below 20 MB in size and is of one the following formats: [‘png’, ‘jpeg’, ‘gif’, ‘webp’].”, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘invalid_image_format’}}

Nothing seems to work. Everything is correct on my end. The image meets all requirements and the api call meets all requirements. Is it a GPT problem? Or what[s the problem?

Did anyone here ever get a shared google drive file correctly read by the gpt4-vision-preview?

edit - Tried Microsoft One Drive too. The api also fails and shows same error message when image file is published to world using Microsoft One Drive.

1 Like

Hey there and welcome to the community!

So, you are not the first who has come on here attempting some kind of retrieval from google drive.

At the moment, I have not seen any working code that succeeds on this front. Therefore I don’t really recommend working with drives like google drive for this kind of stuff. What is probably happening is that it’s being fed the URL to an image location, but not the image itself, and therefore cannot retrieve it, thus causing your bad request error.

1 Like

URL are permitted in a request by way of very first example in the Documentation. The documentation also works correctly which I verified by running the sample code on my computer.