"invalid_image" error in gpt-4o when using S3 presigned URL

I’m generating S3 pre-signed URL for files that have been uploaded to S3, So far I’ve checked that the image has been pushed to S3 correctly, with the correct content type and content disposition, by default these images are private, however, I’m generating pre-signed URL to send as image URL to chat API, but I’m always getting The following error

{"message"=>"Invalid image.", "type"=>"invalid_request_error", "param"=>nil, "code"=>"invalid_image"}}

Here is the API request payload:

      [
        {
          type: 'image_url',
          image_url: {
            url: "pre_s3_signed_url"
          }
        },
      ]
1 Like

Welcome to the community!

You know, in some cases it might be worth it to just send the b64 string…

Probably a dumb question, but it’s it possible the image_url url value is having the query string being stripped away by the endpoint? That the endpoint is expecting a clean URL?

1 Like

That’s a good question, I’m not sure if there is some sort of validation at the API level that removes or rejects query parameters, the pre-signed link can be opened by a browser, the content disposition is inline, and the content type is image/, but the API is just “rejecting” the URL saying that it is invalid

1 Like