AI engineering glossary · Prompt context engineering

What is JSON mode?

JSON mode: A provider option that guarantees the model's reply is syntactically valid JSON. It does not by itself guarantee that the fields, names or types match what your code expects, so validation is still needed.

Level: beginnerTopic: Prompt context engineering

JSON mode: an example

With JSON mode on, the reply always parses, but a field might be called 'total' instead of the 'amount' you wanted.

Related terms

More Prompt context engineering terms

Where you learn it

JSON mode is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.