Welcome to Portkey Forum

Updated 4 weeks ago

OpenAI API JSON Responses Suddenly Include json Prefix

Edit: Ended up just adding in a response parser to catch the change, but FYI to anyone parsing the JSON object directly:

Hey everyone! I'm running into an issue within the last 15-20 minutes where JSON formatted responses from the OpenAI API are returning with "json" at the front of them, which wasn't happening previously. Not sure if it's a Portkey change or something changed within the OpenAI API, any suggestions would be really helpful! For context: the past few weeks and even today, they've been returning like this:

"message": {
"role": "assistant",
"content": "{\n "overallSummary":

But as of 15-20 minutes ago, starting to come through like this:

"message": {
"role": "assistant",
"content": "```json\n{\n "overallSummary"
Q
V
G
4 comments
you can add it in your system prompt to "not specify markdown syntax highlighting" or msth similar
Interesting, thanks @jbianchini1 for sharing the fix. cc @Griphook | Portkey
Hey @Qutäy I can confirm that this is not a change from portkey, this could be changes from openai model updates, if you need consistent responses, I'd suggest you to use a checkpoint model like gpt-4o-2024-11-20 and not chatgpt-4o-latest
Add a reply
Sign up and join the conversation on Discord