500 error on chat completions messages GET

I had for weeks and months similar issues, but with the Assistants API, where failed responses just said: “Sorry, something went wrong”. In my case, it was caused by curly braces in my instructions, used as example data to guide the assistant. It was for month an issue, and has gotten worse and worse over time. A couple of days ago, i stumbled coincidentally over the solution.