← Google AI Studio
Guided lab · Google AI Studio
Ask a model for structured JSON
Get a model to answer in strict JSON that a program could read.
Prices, plans and screens change. This tool was last checked on 2026-10-15. Use the official site if a step looks different.
Open Official ToolBefore you start
A Google account. About 15 minutes.
Setup
- Open the official site with the Open Official Tool button and sign in.
- Start a new prompt (a blank chat or prompt box).
- If the tool lets you choose a model, pick any current general model.
Exercise
Paste this prompt, then press run:
You extract details from a support message.
Reply with JSON only, no extra words, using exactly these keys:
"customer_name", "issue", "urgency" (low, medium or high).
Message: "Hi, this is Ravi. My invoice shows the wrong amount and I need it fixed before Friday."
Expected result
A single JSON object, for example:
{"customer_name": "Ravi", "issue": "Invoice shows the wrong amount", "urgency": "high"}
The wording can differ. The three keys must be present and nothing else should surround the JSON.
Check your result
Troubleshooting
- Extra words around the JSON: add "Reply with JSON only" again and show an example.
- Wrong keys: repeat the exact key names in the prompt.
- Different results each run are normal. Improve the instructions, not the luck.
Security notes
Use made-up messages only. Never paste real customer data, passwords or API keys.
Challenge
Add a fourth key, "next_step", and make the model refuse to guess when the message has no clear issue.
Before you finish
Please log in to save your progress.