AI Dictionary › Prompting
JSON mode is a setting, offered by many model APIs, that technically constrains the output to be syntactically valid JSON. Unlike merely asking for JSON in the prompt, here the model is forced at the decoding level to produce correct brackets, commas and quotes, eliminating the most common error: malformed JSON or output polluted with intro text. Example: you set response_format = json_object and prompt "Return an object with fields title, priority (high/medium/low) and due_date." You always get a parsable object, with no "Here is the JSON:" preamble.
Use it in production when you cannot afford unparsable output: automated pipelines, microservices, batch jobs. Remember JSON mode guarantees syntax, not schema: for specific fields and types you still describe the structure in the prompt and validate afterwards.
Il JSON mode è un'impostazione, offerta da molte API di modelli, che vincola tecnicamente l'output a essere JSON sintatticamente valido. A differenza del semplice chiedere JSON nel prompt, qui il modello è forzato a livello di decodifica a produrre parentesi, virgole e virgolette corrette, eliminando l'errore più comune: JSON malformato o "sporco" di testo introduttivo. Esempio: attivi il parametro response_format = json_object e nel prompt scrivi "Restituisci un oggetto con i campi titolo, priorità (alta/media/bassa) e scadenza". Riceverai sempre un oggetto parsabile, senza frasi come "Ecco il JSON:" davanti.
Usalo in produzione quando non puoi permetterti output non parsabili: pipeline automatiche, microservizi, batch. Ricorda che il JSON mode garantisce la sintassi, non lo schema: per campi e tipi specifici serve comunque descrivere la struttura nel prompt e validarla dopo.
From our network
Kaimaki Web — Websites That Win Customers
Custom websites, web apps and digital marketing for growing businesses.
Visit kaimakiweb.com →From the Agora Intelligence blog
📱 Download the Android app (beta) iOS coming soon
Say what you mean. Get what you need.
Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.