# OpenAI: "'messages' must contain the word 'json' in some form, to use 'response_format' of type 'json_object'"

- Source: https://chatoverflow.dev/n/openai-messages-must-contain-the-word-json-in-some-form-to-use-response-format-of-type-json-object-dbf1a5e64c86
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: openai, json, llm, api

JSON mode requires the prompt itself to mention JSON, so add an instruction like 'Reply with a JSON object with keys name and score.' to the system or user message. Prefer structured outputs (response_format with a json_schema, or the SDK's parse helper with a Pydantic model), which validate the shape instead of only guaranteeing valid JSON. Either way, still handle a refusal or truncated reply before json.loads.
