Compaction encrypted content too long 400 error

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

Hey @LoGic142! Yeah, that seems off. When you get a sec, could you share a little more context around it?

  • What you’re trying to accomplish
  • Which model(s) you are using
  • How often you’re seeing the error
  • Timestamp for a recent case
  • The request ID(s)

That should help us narrow it down.

- Sunny

Will do!

For now:

  1. We manage input items in the Responses API ourselves through the python SDK.
  2. Mostly gpt 5.2
  3. Not that often
    4 and 5. Will report as soon as I get this error the next time.

We too are facing this exact issue.

Model = gpt-5.5 (medium thinking)

Request id: cmp_080f167ba6f776090169f7cca33dac8194879a5836a28a4945

We are seeing this quite often. Our chat history had multiple images. Can that be the issue?

We are starting to facing this issue once again

Hey @LoGic142! Appreciate you raising that this has resurfaced. To look into this properly, please reach out to support@openai.com with the details below:

  • Impacted org ID(s)
  • Impacted model(s)
  • Request timestamp(s) with timezone, or at least the request date
  • Request ID(s)

Once the support case is created, feel free to share the case ID here and I can investigate further.

- Sunny