Documentation Index
Fetch the complete documentation index at: https://docs.naga.ac/llms.txt
Use this file to discover all available pages before exploring further.
Chat Completions API exposes structured outputs through response_format. Use this API when you need the OpenAI chat protocol rather than the newer Responses shape.
Use json_schema when the output must match a known shape. Use json_object when valid JSON is enough.
Request
Wire Response Shape
Raw HTTP responses keep the result inchoices[0].message.content as JSON text.
JSON Mode
If you only need valid JSON and not a full schema, use:Which mode should you use?
| Mode | Use it when |
|---|---|
json_schema | required fields and schema validation matter |
json_object | you only need valid JSON text |
Common mistakes
- expecting a native JSON object instead of parsing
choices[0].message.content - choosing Chat Completions for new work when Responses structured outputs would be the cleaner default
- using an open schema when downstream code expects strict shape guarantees