JSON mode
JSON mode is an LLM API parameter that guarantees the response is valid JSON — even when no specific schema is provided. It's the lighter version of structured output: the response will parse, but the shape isn't validated. Useful when the application can handle any well-formed JSON or when iterating before committing to a fixed schema.
JSON mode predates structured-output features and remains useful for prototyping and for applications where the response shape varies legitimately. The trade-offs vs full structured output: JSON mode doesn't constrain field names or types, so the consuming code must still validate; the same instructions that would shape the response in a structured-output schema must be encoded into the prompt manually. Most production applications have migrated from JSON mode to structured output as the latter becomes available on all major providers; JSON mode remains the right choice for free-form structured responses or for older API versions.
Related terms
- Structured output
Structured output is the LLM feature that guarantees the response matches a provided schema (JSON Schema, Zod, Pydantic) — eliminating the parsing failures and format drift that plagued early LLM applications.
- Function calling
Function calling lets an LLM invoke external tools by emitting a structured request matching a function specification provided in the prompt.
- System prompt
A system prompt is the initial instruction given to an LLM at the start of a session that sets behaviour, persona, output format, and constraints — distinct from user messages that follow.