Compaction encrypted content too long 400 error
OpenAI Developer Community
April 27, 2026
Error code: 400 - {‘error’: {‘message’: “Invalid ‘input[1535].encrypted_content’: string too long. Expected a string with maximum length 10485760, but got a string with length 17599352 instead.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘input[1535].encrypted_content’, ‘code’: ‘string_above_max_length’}}
We enable server side compaction in responses api, and append the items returned by the API as is to the input array, but in some cases on appending compaction items back to the input item array, we face this error, whereas we are just appending the input array with the items that OpenAI API itself returned.
What to do in this case?
Thanks in advance
Discussion in the ATmosphere