Error parse JSON body your request

good morning everybody. I’m having an error when I use the api with the gpt-4 model. I pass the prompt and context parameters, it turns out that when I send the conversation history in the context parameter, I receive a JSON error (attachment). I have already cleaned the text of special characters, transformed the text into UTF-8, but the error persists. The strangest thing is that when I run the api with simple texts it doesn’t give an error. my application is in flutter, the input is a string, the variables used are in string. Would anyone have any suggestions to resolve this problem? Thank you in advance. Helvio

I am also intermittently receiving this error using gpt-4o. If I go back to gpt-3.5-turbo, I can send these requests all day long. I try using the same JSON payload through Postman and things work fine. Anyone else having intermittent issues with JSON parsing? It seems to be the longer prompts 1000-2000 characters or more complex formatting in the text.

Here is a payload that failed:
{“messages”:[{“role”:“system”,“content”:“You are a cheerful and accommodating tour guide to provide Entertainment and Engagement. Do not use emojis or markdown.”},{“role”:“user”,“content”:“Previous statement: Good morning, Mark! I’m Amy, the Adventurer. Are you ready for an adventure today? What type of adventure interests you? Here are a few options to consider:\n\n1. A historical city walking tour.\n2. A nature hike through scenic trails.\n3. Exploring a local museum with unique exhibits.\n\nWhich one excites you the most? Let\u0027s embark on an unforgettable journey together!”},{“role”:“user”,“content”:"Considering your previous statement and the response of 3, describe in 10 words or less the adventure they chose. "}],“model”:“gpt-4o”,“max_tokens”:1000,“frequency_penalty”:1,“presence_penalty”:1,“response_format”:{“type”:“text”},“temperature”:1}