How to use structured outputs while working with threads and assistants

Pushkar Gaikwad 0 Reputation points
2025-01-20T06:09:36.2866667+00:00

I want the response as a JSON object. I'm using GPT-4o-mini (2024-07-18), and in the documentation, it’s mentioned that when making API calls, I need to provide the response_format as { type: 'json_schema', json_schema: {} }. Where exactly should I pass the response_format parameter? Should I include it while creating the messages, while creating the run, or when creating the thread?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,629 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.