Hello Community,
I’ve been encountering an “Invalid image” error frequently while working with the GPT-4 Vision API. I’m using image URLs to include pictures in my requests. Here’s a simplified version of my request structure, with specific details omitted for data protection:
I try to send this to an assistand message thread.
{
"model": "gpt-4-vision-preview",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Please describe the contents of this image."},
{"type": "image_url", "image_url": {"url": "hereIsACorrectFormattedURL","detail":"auto"}},
{"type": "image_url", "image_url": {"url": "hereIsACorrectFormattedURL","detail":"auto"}}
]
}
]
}
Despite the URLs being correct and the images being accessible via a web browser, I consistently receive the following error message: "
"error": {
"message": "Invalid 'content[1].image_url.url'.",
"type": "invalid_request_error",
"param": "content[1].image_url.url.url",
"code": "invalid_value"
}
Watch for te double url.url part returning from the API. Is this a bug?
I’ve tried converting the images to Base64-encoded strings but I ran into other issues with this. Also those images are quite large as bas64 so it would be nonsense to do this.
Has anyone else experienced this or have any troubleshooting tips? Are there specific settings or formats that have proven more effective in circumventing this issue? Any help or insight would be greatly appreciated!
Thank you in advance!