Issues rendering markdown format when model was set to 'gpt-5-nano'

I’ve recently changed the model parameter from ‘gpt-4.1-mini’ to ‘gpt-5-nano’ and since then, I’ve started noticing few issues:

  1. The response time is too long even though OpenAI claims is to be the fastest in gpt-5 family.
  2. The bigger issue is how the response is returned by the model. Previous models like ‘gpt-4.1-mini’ used to return consistent markdown formatted response and I never faced issues rendering them in the UI. However, after switching to ‘gpt-5-nano’, the response was not formatted for responses requiring code (or mathematical equations). They were either simply rendered as plain text or inconsistent. I’m sharing the screenshots of original response (as returned from the API).

Note: The first image is the response text from gpt-4.1-mini and the second one from gpt-5-nano.

Please let me know if this is the case with anyone else.

Hi! Gpt-5 doesn’t support markdown by default.

You can find some tips on this post on how to enable it.

So, is modifying the instructions or system prompt to get the response in markdown format the only way? I meant to ask, aren’t there any reliable ways like using the api parameters to switch the output format to markdown?

Markdown formatting

By default, GPT-5 in the API does not format its final answers in Markdown, in order to preserve maximum compatibility with developers whose applications may not support Markdown rendering. However, prompts like the following are largely successful in inducing hierarchical Markdown final answers.

Source

gpt-5.1 has a less aggressive system instruction foisted on it about “no markdown” than gpt-5, so you can compare when your first instruction is directly “you DO output markdown formatting in all chats and documents, you have a rich text UI renderer for responses.”

No ‘nano’ equivalent, but o4-mini is your choice to not fight the AI at every turn.