I am getting an error msg with the gpt-4-turbo, for describing an image that I am sending through URL in the API. The image size is 6.9 MB, and the max allowed limit is 20 MB.
Code -
imgLink = "https://benny-image-shop.s3.ap-south-1.amazonaws.com/2024-05-01/1714564843256000_152.58.111.108.jpg"
payload = {"model": "gpt-4-turbo",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "describe"
},
{
"type": "image_url",
"image_url": {
"url": imgLink
}
}
]
}
],
"max_tokens": 500
}
headers = {"Authorization": f"Bearer " + api_key,
"Content-Type": "application/json"}
response = requests.post('https://api.openai.com/v1/chat/completions', headers=headers, json=payload)
Error - {‘error’: {‘message’: ‘Invalid image.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}