Image variation API endpoint error

Hello, I am having an issue with the image variations endpoint. I will have my body posted below of information, but I am guessing it has something to do with the file not being sent right somehow. I keep getting the error message, { “error”: { “code”: null, “message”: “‘image’ is a required property”, “param”: null, “type”: “invalid_request_error” } }

Any information on this would be appreciated, but I cannot exactly figure out what is wrong here.

Content-Disposition: form-data; name=“image”; filename=“image.png”
Content-Type: image/png
Content-Transfer-Encoding: binary

�PNG


IHDR�?1heXIfMM*�|)&��POpenAI–581f3ecd5ee2e21fc153faa26121f740Made with OpenAI DALL-EL���IDATx+��~ (+
���������������������������������������������������()58) ������������������������������������������������������������������������ e
���������������������������������������������������������������������������������������������������������������������������������������� !"���������������������������������������������������������������������������������������������������������������������������������������������������a�� !�������������������������������������������������������������������������������������������������������������������������������������������aaa���
��������������������������������������������������������������������������������������������������������������������������������������������� �������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
 ��������������������������������������

������������������������������������������������������������������������������������������������������������������a
a����������������������������������

  ������&&#a���������34;%#(ee�aaa���������������������������������������������������������������������������������������������������������������������������������������������������a � ��������������������������������a

e
 



a ������e������e�����������IHP������
a�����24��������������������������������������������������������������������������������������������������������������������������������
�������������������
 a ���������������������
!$ (! $
aa
a a������
������ a������
e��������� ����eY40������������������
aa���

� #"�����������������������������������������������������������������������������������������������������������������������������������
����������������%((5%&1+,-�aa�������  � ������(
'����������������������?G���������
�������

����������� ������ $ aa�����������������������������������������������������������������������������������������������������������aaa���������������������aaa���������������  *e
,)9
������������
���������������a �������������

DCBOD������('&,	

�������������e������ $������ 
a��� ���$76<�������ĸ�����������������������������������������������������������������������������������������a��������������������������������������� !)'199B//7������a���������������
� ��� a� !������Ŀ�TSY���������MP>
����a���**1��ٹ��fgd��������� ��� 
# ����
A#"%����������������������������������������������������������������������������z���������������������������������������������
#FGOJIG ���������������a��������� ��������aa���������

e������� ���

?B4������,G7;&a��������� ���EEH���������������
����������������Ƹ��������������������������������������������������������������������������������������"?<N=<K
����a����

���!������a��
������
��� ��� 

 �������

��
KOO������LNP

���68B� �����
WZP������a���������’&0974����� ����� ������,+3#]*��������������������������������������������������������������������������������������������������������
,-:IIV"#,������ �������������a
���a�a

���������!���
 �������������
a����������ILG������!!"������$%  .0/�������� 

 �����������������������43>+,*±&����Ǿ��������������������������������������������������������������������������������������������##/GGW67>���e�������26-���
���������a  ���������  ����� ��������� �����������������CE-47&������



e���VWT�����������’+������
���������������������qq{e������������������������������������������������������������������������a�������������������������������������e??KDFM��a,0a���
����� �  a������������������������� ���������������#$7 ���./#��������妧����@@ �
a��������IL?���������� ��� ���e<�������
���������
NM[������������������������������������������������������������������������������������������
(&8FDQ897aa
aaa������!!��������
45.���
���������
a����������������������a������aa������" ���
������ ;;5���


���������26.���#*(( ���� 
���(‘������ 
�������41>����������������������������������������������������������������������������� a��������������
0,;ABL#!$’%"a
���
�����
 �a��������-/) '��������a���������������$&'���
������������
QN=
  ���
�������������� ������ ����������� ������
a ��������� a

a���!“������$.-:����������������������������������������������������������������������������

�������������=8FB@K"
 ���
������DE!a���
aa���dca����������������� ��������������
A></3(������$ ����a
��丷����������������%���������&*��� ���������������”&$������
&'���
���� 11.���FEQ�� ������������������������������������������������������������������������

����������������(+8PO[2-0

a�����
 a������228 ������������������ ������
��� 
������

���������
���������������05k
�����a������ 8;8�����
**��
���a�����*&(�������������.3�����������������"%

a��� e����������������������������������������������������������������������������������������������
������������ 22G`bh&'$ ��aa���������������G������������������a !������������
 RUH
a������
e���������
�����a ��������#�� �������!
�
 ���������
a
�����������������

 �����
a���$ #��������������������������������������������������������������������������������aaaa������������������
����.+8fbp!$  ��������e��� ��� ����������������e���  �����������a 11, (! ������!�������������a����������#%#  6&��AC*
���   �������������! ��������������a 

a
�����������! .-.++/��÷��������������������������������������������������������������������� ��������������+VUb’'$��� a  ���
����e ���������  ������e
������#"!   
���44+
aaa
 ������//. ������������������������������NN<e��  ������������� a������������
 !���!  ����������� e1/;!���������������������������������������������������������� aa
(cant fit all of the information into this prompt but this is gist of data of image)

–ChpTFsjzjxS3XL6TQwiM1fMXbUf6wqPINqOr84xo
Content-Disposition: form-data; name=“size”
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

256x256
–ChpTFsjzjxS3XL6TQwiM1fMXbUf6wqPINqOr84xo
Content-Disposition: form-data; name=“n”
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

1

Here is some coldfusion code provided below (dont expect anyone to know coldfusion, but it may help somewhat with the issue at hand)

<cfset LOCAL.httpRequest = CreateObject("java", "org.apache.http.client.methods.HttpPost").init(LOCAL.url) />

<cfset LOCAL.httpRequest.setHeader("Authorization", "#LOCAL.authorization#") />
<cfset LOCAL.httpRequest.setHeader("OpenAI-Organization", "#LOCAL.organization#") />
  
<cfset LOCAL.httpRequest.setHeader("Content-Type", "multipart/form-data") />
<cfset LOCAL.httpRequest.setHeader("Content-Type", "application/json") />
        
<cfset LOCAL.entityBuilder = CreateObject("java", "org.apache.http.entity.mime.MultipartEntityBuilder").create() />

<!-- Add the image file part -->
<cfset LOCAL.filePart = CreateObject("java", "org.apache.http.entity.mime.content.FileBody").init(
    CreateObject("java", "java.io.File").init(arguments.imagePath),
    "image/png"
) />

<cfset LOCAL.entityBuilder.addPart("image", LOCAL.filePart) />

<!-- Loop through the requestBody structure and add fields as text body parts -->
<cfloop collection="#arguments.requestBody#" item="LOCAL.fieldName">
    <cfset LOCAL.fieldValue = arguments.requestBody[LOCAL.fieldName]>
    <cfset LOCAL.entityBuilder.addTextBody(LOCAL.fieldName, LOCAL.fieldValue) />
</cfloop>


<!-- Create the HttpEntity and set it to the request -->
<cfset LOCAL.httpEntity = LOCAL.entityBuilder.build() />
<cfset LOCAL.httpRequest.setEntity(LOCAL.httpEntity) />

<cfset LOCAL.responseObj = LOCAL.httpClient.execute(LOCAL.httpRequest) />
<cfset LOCAL.respEntity = LOCAL.responseObj.getEntity() />
<cfset LOCAL.response = isDefined("LOCAL.respEntity") ? LOCAL.entityUtil.toString(LOCAL.respEntity, CreateObject("java", "java.nio.charset.StandardCharsets").UTF_8) : "" />

I think there is an issue with the Content-Transfer-Encoding: Binary, but the problem is I am using javas apache http library for this and I cannot disable this as the library sets this automatically- so I am thinking this is a bug on their end as I have a similar call with the exact same data and everything matches and it is working. Problem is I need to do the call this way for our code.