Hi
I want to extract details from an image (PNG) encoded in base64 string using Response API:
const response = await client.responses.create({
model: "gpt-4o-2024-11-20",
instructions: "...",
input: [
{
role: "user",
content: [
{
type: "input_file",
filename: "page.png",
file_data: `data:image/png;base64,${images[0]}`,
},
],
},
],
temperature: 0,
text: {
format: zodTextFormat(AccountSchema, "Account"),
},
});
The following error is thrown when run,
Invalid file data: 'input[0].content[0].file_data'. Expected a base64-encoded data URL with a valid file MIME type (e.g. 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=='), but got unsupported MIME type 'image/png'. Please see https://platform.openai.com/docs/assistants/tools/file-search#supported-files for supported file types.
It looks like we cannot upload the image file. May I know how to upload the an image to GPT-4o to analayze and extract the details?