GPT-Image-1 API is not showing images

Hello I am still learning but when I try to make a Make scenario (HTTP) + Gmail with the GPT-Image-1 API I only get black pictures “we don’t know this format”, tried everything (also others then Make, 64, png, jpg, extra HTTP etc. etc). Any one know the solution? Thank you

Hi, can you try to ask help from GPT 4o. They have almost all the info how to fetch the image properly.

you mean the normal ChatGPT? I’ve tried, also tried Operator, Perplexity en Claude :slight_smile:

I don’t understand what GMail would have to do with the API, but I do know the API.

The request is multipart/form-data. The OpenAI API libraries for specific programming languages will make this easier, turning the http form fields into parameters for a function.

There is only one type of image returned: a file.

It is BASE64 encoded, which is a 3 byte to 4 byte transformation suitable for transmission by JSON.

This is then indeed sent to you in a JSON that needs to be properly parsed into programming language data objects.

{
  "created": 1713833628,
  "data": [
    {
      "b64_json": "..."
    }
  ],
  "usage": {
    "total_tokens": 100,
    "input_tokens": 50,
    "output_tokens": 50,
    "input_tokens_details": {
      "text_tokens": 10,
      "image_tokens": 40
    }
  }
}

From that, you need to get response.data.b64_json out, using a JSON support library.

Then you can go through the steps of decoding and saving to a file, a png file you name if you have not specified a file type.

The first thing you should ensure is that you are sending "quality": "low" while doing experimentation, so your bill of not seeing the results is lower.

And then ensure you are capturing and displaying any error, such as “your organization must be verified to use this model” being returned instead of the expected response body.

2 Likes