Bonjour Emma,
J'ai trouvé des postes similaires avec ce problème:
Introducing Structured Outputs
Error retrieving ‘completions’: 400 Bad Request
Ce même problème est aussi signalé comme un bug ici:
Azure OpenAI GPT-4o mini Structured Outputs response_format
not working
Vérifiez aussi les informations dans la section response_format de la documentation:
"Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length."
Cordialement,
Nina