Skip to content

Lesson 15 ยท Google AI Studio

A Tour of Google AI Studio

Use Google AI Studio to test prompts, set system instructions and run settings, try structured output and tools, adjust safety settings and get code.

Google AI Studio is a web workspace for trying Gemini models directly. It sits between the chat app and the API: you experiment in the browser, then move working settings into code. The API terms require users to be 18 or older. Facts are as of December 2026.

What you can do there

Google's quickstart describes chat prompts plus other modes such as real-time streaming and media generation. The key parts for you are:

  • Chat prompts: test a conversation.
  • System instructions: standing rules for how the model behaves.
  • Run settings: choose a model and change options.
  • Tools: switches such as structured output, function calling, code execution and grounding.
  • Get code: export your setup as API code.
  • Save and share prompts.

Menu names and positions change, so look for these ideas rather than fixed buttons.

From idea to code

Prompt Try a request
Settings Rules, model, tools
Test Run hard cases
Get code Move to your app
1 / 2

System instructions

A system instruction describes the role and rules for the conversation. Keep it specific:

TEXT
You are a help desk assistant for a small library.
Answer only about library services, using the facts in these instructions.
If you do not know, say so and suggest contacting the front desk.
Reply in the user's language. Keep replies under 100 words.

System instructions guide the model but are not a security barrier. A determined user may get the model to ignore or reveal them. Never put secrets in them.

Models and thinking

Pick a model in the run settings. As of December 2026, the developer model list includes the Gemini 4 family. Examples are Gemini 4 Hydrogen (gemini-4-hydrogen), which Google presents as fast and suited to everyday coding and agent work, and stronger options such as Neon and Carbon. You can set a thinking level to trade speed and cost for more reasoning. The available levels depend on the model.

Google's prompting guide says that for Gemini 4, and for Gemini 3.6 and later, you should remove the old sampling settings temperature, top_p and top_k. Do not copy those settings from older tutorials.

Tools in the playground

Tool What it does Remember
Structured output Returns JSON that follows a schema Valid shape, not guaranteed truth
Function calling The model asks your code to run a function Your code runs it
Code execution The model runs Python in a sandbox Limited runtime and libraries
Grounding with Google Search Answers use search results with citations Check sources; usage may cost money

Safety settings

The API has adjustable safety filters for harassment, hate speech, sexually explicit content, dangerous content and jailbreak attempts. Thresholds range from off to stricter blocking. Google's documentation says the additional filters are off by default for Gemini 2.5 and later models, while some core protections cannot be adjusted. The filters rate how likely content is to be unsafe, not how severe the harm would be. Choose settings for your audience, and add your own checks for your use case.

In the API, a request blocked by safety filtering fails with an HTTP 400 error and a code that explains the type of block. Your app should handle this with a clear, calm message.

Test like an engineer

Before you copy code, collect a small set of test inputs:

  • Typical requests.
  • Edge cases: empty, very long, mixed languages.
  • Off-topic and hostile requests.
  • A question whose answer is not in your material.
Python Stand-in: run an assistant against test cases

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The last case fails because the user phrased the question differently. With a real model, wording also varies in the replies. Test for facts and behavior (such as "refers to the front desk"), not exact sentences, and read some outputs yourself.

Get code

When a prompt works, Get code gives you code in your chosen language for using the API. Review it before you use it. Confirm the model name, check that the API key is read from an environment variable, and remember that a playground test does not include your application's error handling. Your first API request explains the basic code.

Costs and data

Free is not the same as private. The API terms distinguish unpaid and paid services. They say direct use of AI Studio is generally unpaid; it counts as paid when your account has access to a Cloud project with active billing, or is a Workspace enterprise account. For unpaid services, Google may use your submitted content and responses to improve its products, and human reviewers may read them after the data is disconnected from your account. The terms say not to submit sensitive, confidential or personal information to unpaid services. Read the current terms before you use real data, including how they treat AI Studio and your region. See privacy, data controls and safe use.

Keep an experiment log

Playground work is easy to lose. For each serious experiment, record the model ID, the system instruction, the settings and tools, the test inputs and what you observed. Change one item at a time. When the result gets worse, your log shows what to undo.

Version Change Passed Note
1 First instruction (count) Too long
2 Added word limit (count) Check the tone

Save the instruction text with your project code as well, so that reviewers can see changes to it just as they see code changes. A saved prompt in a web tool is convenient, but your repository should remain the reliable copy for anything you ship.

Common mistake: testing with real customer messages in a free playground. Invent realistic but fake examples instead.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. What is true about system instructions?

    Users may be able to bypass or reveal them, so keep secrets out.
  2. 2. What does Google's prompting guide say about temperature and top_p on Gemini 4?

    The guide says to remove these sampling parameters for Gemini 4 and Gemini 3.6 and later.
  3. 3. What should you keep out of unpaid API services?

    Google's terms warn against sending such data to unpaid services.

Summary

  • AI Studio lets you test models, instructions, settings and tools before you write code.
  • System instructions shape behavior but are not security.
  • Test with hard cases, and review exported code.
  • Unpaid services have different data terms, so use fake data.

Next: Building Apps in AI Studio

Your progress is saved in this browser. No account needed.