Skip to content

Google AI Studio: Prototype Prompts Before You Write Code

Google AI Studio lets you try Gemini models and prompts in a browser, then hand off working code. Here's how chat prompts, Run settings, and Get code fit together.

CurrentLast verified

Platforms

  • Google AI Studio (web)

What the official documentation says

  • Google AI Studio lets you quickly try out models and experiment with different prompts; selecting "Get code" and a programming language hands off a working prompt to the Gemini API.

    Google AI Studio quickstart
  • AI Studio provides several prompt interfaces for different use cases, including Chat prompts (for conversational, multi-turn experiences), Realtime streaming, and Video gen, among others.

    Google AI Studio quickstart
  • The Run settings panel lets you adjust model parameters and safety settings, and toggle on tools such as structured output, function calling, code execution, and grounding.

    Google AI Studio quickstart
  • A chat prompt is built by opening the Playground (a new chat prompt is open by default), expanding Run settings, and entering text in the System Instructions field to steer the model's persona and behavior.

    Google AI Studio quickstart
  • System instructions are modifiable after a chat session has already started — you can keep the same session or start a new one when you change them.

    Google AI Studio quickstart
  • Every message between the model and the user is included in the prompt, so conversational prompts grow longer as the conversation continues and can eventually hit the model's token limit.

    Google AI Studio quickstart
  • Once a prompt is prototyped, the Get code button turns it into starter code, or the prompt can be saved to work on later and share with others.

    Google AI Studio quickstart

What AI Studio is for

Google AI Studio is where you try a model and a prompt before you commit either to code. You type, you run, you read the response, you adjust — and once a prompt actually does what you want, Get code turns it into a starting point in Python, JavaScript, or another supported language, ready to call the Gemini API directly.

AI Studio offers several prompt interfaces built for different jobs — this tutorial focuses on Chat prompts, the one for building conversational, multi-turn experiences. Realtime streaming, Video gen, and others exist for their own use cases.

Build a chat prompt

The example the official quickstart walks through is a chatbot that talks like an alien living on Europa, one of Jupiter's moons — useful less for the bit and more because it shows exactly how much a single instruction changes behavior.

Step 1 — create the prompt. Open AI Studio; the Playground opens with a new chat prompt by default. Click Run settings in the top-right corner to expand the panel, and find System Instructions. Paste in:

You are an alien that lives on Europa, one of Jupiter's moons.

Ask something like What's the weather like? and click Run. You'll get an answer, but on a single loose instruction it tends to run long and wander.

Step 2 — tighten it up. Change the system instructions to something more specific:

You are Tim, an alien that lives on Europa, one of Jupiter's moons.

Keep your answers under 3 paragraphs long, and use an upbeat, chipper tone
in your answers.

Re-run the same question. System instructions are editable mid-session — you don't have to start over to see the effect, though starting a fresh chat gives you a cleaner before/after comparison.

Step 3 — decide what's next. Once the prompt behaves the way you want, click Get code to generate a starting point in your language of choice, or save the prompt to keep iterating later or hand it to someone else.

Run settings is where the tools live

Everything that isn't the prompt text itself — model parameters, safety settings, and whether function calling, structured output, code execution, or grounding are active — lives in the Run settings panel, not in the prompt. If a capability you expect isn't showing up in a response, this is the first place to check: it is very likely just not toggled on for that prompt.

Watch your token budget in long sessions

A chat prompt resends the entire conversation so far on every turn — that's how the model stays consistent about what "Tim" said three messages ago. It also means a long test conversation can climb toward the model's token limit faster than a one-off prompt would. If you're stress-testing a chatbot persona, keep an eye on how long the conversation has gotten, not just how the latest response reads.

From prototype to code

The point of prototyping in AI Studio is to never hand-write the API call for something you already got working in the browser. Once a chat prompt does what you need, Get code is the documented path to a real integration — see Getting started with the Gemini API for what that call looks like once it's in your own codebase.

How to do it

  1. Go to aistudio.google.com and open the Playground — a new chat prompt is open by default.
  2. Expand Run settings and enter text in the System Instructions field to steer the model's persona and behavior.
  3. Send messages and iterate on the system instructions, adding specifics like tone and length limits if answers are inconsistent.
  4. Toggle on any tools you need in Run settings — structured output, function calling, code execution, or grounding — and adjust model parameters or safety settings.
  5. Once the prompt behaves the way you want, click Get code and pick a language to hand it off as starter code, or save the prompt to share or continue later.

On Windows

N/AGoogle AI Studio is a web application at aistudio.google.com; it has no OS-specific install step.

On mobile

N/AThe quickstart documents the desktop browser Playground workflow and does not describe a mobile-specific experience.

Use cases

  • Iterating on a chatbot's system instructions and tone in the browser before writing any application code.
  • Comparing how a prompt behaves with and without a tool (grounding, function calling, code execution) toggled on in Run settings.
  • Prototyping a prompt, then using Get code to generate a starting point in your target language instead of writing the API call by hand.

Common mistakes

  • Treating a single system instruction as enough for a consistent persona. The documented example shows a bare instruction produces long, inconsistent answers until you add specifics like tone and length limits.
  • Forgetting that every prior turn is resent as part of the prompt in a chat session, then being surprised by rising token usage or hitting the token limit in a long test conversation.
  • Skipping Run settings entirely and assuming tools like function calling or grounding are already on — they are toggled per prompt, not enabled globally.
  • Never using Get code, and hand-transcribing a working AI Studio prompt into an API call — a step that AI Studio already automates and that is easy to get subtly wrong by hand.

FAQ

Is Google AI Studio the same as the Gemini API?
No — AI Studio is a browser-based tool for trying models and prompts. Once you're happy with a prompt, "Get code" hands it off as working code that calls the Gemini API in your chosen language.
What's the difference between a Chat prompt and the other prompt types?
The documentation describes Chat prompts as built for conversational experiences with multiple input and response turns. AI Studio also offers other interfaces — such as Realtime streaming and Video gen — designed for different use cases.
Can I change a chatbot's personality mid-conversation?
Yes. System instructions are modifiable after the chat session has already started; you can edit them in place or start a new chat to test the change from a clean slate.
How do I turn on function calling or grounding for a prompt I'm testing?
Open Run settings in the top-right corner of the Playground. It's where you adjust model parameters, safety settings, and toggle on tools including structured output, function calling, code execution, and grounding.
What happens to my prompt once I'm done prototyping?
Two documented options — use Get code to generate starter code in your preferred language, or save the prompt to come back to later or share with others.

Official sources

These are the pages this tutorial is checked against. Follow them if you need the vendor's exact wording.

Source status