Getting error code 400 on both Vision and PDF base64 input - Response API

Has been working flawlessly for over a year from gpt-5.1 to gpt-5.5 (for HTML and RTF and language translation output) up until today.

I also tested a 5.4 reversion to see if it was a 5.5 issue - same error.

Regular queries still work on 5.5, but response detail on complex subjects has seriously degraded.

Hi @jeffvpace,

I tested several PDF files and image formats with both 5.4 and 5.5, but I haven’t been able to reproduce the issue so far.

Could you please share a few more details, and any steps needed to reproduce it? If you’re able to provide a sample file or a minimal repro case, that would also be very helpful.

Testing vision against models and both chat endpoints: OK

(and Responses overbilling, the code not able to reverse the multiplier of higher expense)

model vision vision_mult chat input calculated responses input calculated
gpt-5.5 patch 1.2 2812 2337 3008 2500
gpt-5.4 patch 1.2 2812 2337 3008 2500
gpt-5.4-mini patch 1.2 2812 2337 3008 2500
gpt-5.4-nano patch 1.2 2812 2337 3008 2500
gpt-5.2 patch 1.2 2812 2337 3008 2500
gpt-5.1 tile - 637 630 637 630
gpt-4.1-2025-04-14 tile - 773 765 773 765
gpt-4o-2024-11-20 tile - 773 765 773 765

It looks like someone needs to keep OpenAI honest with regular audits of the billed and advertised pricing also.

— Testing gpt-5.5 (Responses)
gpt-5.5 Image usage: 3001 Image prompt tokens: 2500 Total Usage: 3008
Test received. How can I help?

input tokens: 3008 output tokens: 12
uncached: 3008 non-reasoning: 12
cached: 0 reasoning: 0

User message, Chat Completions:

[{'role': 'user', 'content': [{'type': 'text', 'text': 'Testing'}, {'type': 'image_url', 'image_url': {'url': 'data:image/webp;base64,UklGRhwAAABXRUJQVlA4TBAAAAAvP8aPAQcQ/e9//wMR0f8A', 'detail': 'high'}}]}]

A request instead for Responses:
{'model': 'gpt-5.5', 'input': [{'role': 'user', 'content': [{'type': 'input_text', 'text': 'Testing'}, {'type': 'input_image', 'image_url': 'data:image/webp;base64,UklGRhwAAABXRUJQVlA4TBAAAAAvP8aPAQcQ/e9//wMR0f8A', 'detail': 'high'}]}], 'max_output_tokens': 100, 'reasoning': {'effort': 'none'}, 'store': False, 'truncation': 'auto'}

You’ll get 400 failure if you try to send this vision shape only supported on Chat Completions (including a 1600px image)

[{'role': 'user', 'content': ['Testing', {'image': 'UklGRhwAAABXRUJQVlA4TBAAAAAvP8aPAQcQ/e9//wMR0f8A', 'resize': 1024}]}]

Thanks @_j glad you stepped in. Not using Chat Completions. Here is a Vision Response request:

{“model”: “gpt-5.5”,
“reasoning”: {“effort”: “medium”},
“text”: {“verbosity”: “medium”},
“instructions”: “HTML Instructions go here”,
“input”: [{“role”: “user”,“content”: [{“type”: “input_text”, “text”: “Describe the image”},
{“type”: “input_image”, “image_url”: “data:image/jpeg;base64, {base64_image}”, “detail”: “high”}]}]}

As you can see, nothing out of the ordinary. Similar for PDF:

{“model”: “gpt-5.5”,
“reasoning”: {“effort”: “medium”},
“text”: {“verbosity”: “medium”},
“instructions”: “HTML Instructions go here”,
“input”: [{“role”: “user”,“content”: [{“type”: “input_file”, “filename”: “Test.pdf”, “file_data”:“data:application/pdf;base64, base64_file”},
{“type”: “input_text”, “text”: “Perform a detailed analysis of the document”}]}]}

My dev box and three testing laptops were working fine on this stuff until late Wednesday. Going bonkers…

I captured the request into a text file (API-Request.txt) right up to the “responses” endpoint.

It looks good.

I also couldn’t repro an issue using the request shapes provided in the previous post.
Not sure how to proceed. Can you share the API-Request.txt?

Thanks for responding. Please note that I cannot reproduce the issue in the playground. All I know is that it has worked flawlessly on four test machines for over a year from 5.1 to 5.5.

API-Request.txt is over 4MB (has large base64 image). Glad to send it, but not sure how? If this is not possible, I have no problem with waiting until the current dust settles.

A 400 will also have an error message associated with it. For example, a wrong message construction:

— ERROR: gpt-5.5: Error code: 400 - {‘error’: {‘message’: “Invalid type for ‘input[0].content[0]’: expected an object, but got a string instead.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘input[0].content[0]’, ‘code’: ‘invalid_type’}}

What’s yours?

You can try store:false and see if they will go. Maybe OpenAI doesn’t want to be in the business of keeping your 4MB x every request you make, forever?

Thanks - I’ll try store:false

No error message, just loHTTP.Status which is 400.

For over a year now, I have used Vision to send up to 15 images at once for story creation with no issues:

The return error message will be the “body” of an http request.
Response headers also may show some values useful for diagnosis vs successful API requests, such as the in-flight and processing time.

However, that something changed resulting in an error means…something changed.

I sent 15 of my images of small in-transit size in a request to gpt-5.5 (now at “original” as default, up to 6000px and 10k patches before any downsizing budgeting done for you). Still okay. 45022 tokens input. Then two at 4800px. Then also “store”:true didn’t cause a fault.

If you want to poke at things in your control, you can try against a new project, its defaults, and API key. Check that base64 isn’t a corrupted format and can be decoded.

In a previous post, I said:

I captured the request into a text file (API-Request.txt) right up to the “responses” endpoint

Well, I cut out the base64 from the response and decoded it and here it is:

So, it looks like that is not the problem.

What you pasted has a space in the data URI.
Mine does not.
You’d also know if the type is correct or mismatched (although even completely omitting the type string completely has worked in the past).

Hey @_j Thanks for your help. Not pursuing this any further as I am convinced that this is an OIA issue. Who knows what’s really going on - maybe they are changing specs.