You can include the required response format in your prompt. I've done this before so that I could get the response and put it through a mapping to generate Mendix Objects, rather than parsing a string response
Alternatively, you can interact with OpenAI using the activities provided by the OpenAI Connector rather than calling the REST API directly or using custom json_schema. You might want to try the OpenAI Connector available on the Mendix Marketplace: https://marketplace.mendix.com/link/component/220472