Invalid_image_url error when using AWS CloudFront URLs for images

Hi all,

I’m sending AWS CloudFront image URLs to the chat/completions endpoint and they are always failing with the following error:

{
“error”: {
“message”: “Error while downloading [cloudfrontURL].”,
“type”: “invalid_request_error”,
“param”: null,
“code”: “invalid_image_url”
}
}

If I bypass CloudFront and send a presigned S3 URL to the origin image everything works perfectly.

Both URLs work fine and display the image in a browser.

I’ve made sure that the CloudFront URL returns the correct Content-Type header in it’s response.

Is there any other requirements that make a ‘valid image’ that the response from CloudFront might be missing?

Thanks for the help.

Hello, same here from a different host. I think OpenAI is experiencing an outage right now.

Their status page says the outage is resolved if you want to try again. (In case the outage was the problem).

Thanks, unfortunately it doesn’t seem to be the outage. The S3 direct URLs still work fine and the CloudFront ones still fail :frowning:

EDIT: Issue resolved itself.

Summary

@matt78 - I just started encountering this issue today. Been using the Completions API for months now to handle Cloudfront image_url in prompts, but suddenly started failing with the same 400 timeout error. Did you find a solution? Thanks!