Developer Lab Practical application development
without unnecessary complexity.
← Course Dashboard
Course Getting Started Lesson 2
📖 Lesson 🕒 15 minutes
02

Google AI Studio

Explore the workspace used to test Gemini models and prompts.

What Is Google AI Studio?

Google AI Studio is a browser-based workspace for experimenting with Gemini models before connecting them to your own application.

It gives you a place to test instructions, enter sample inputs, compare responses, adjust model settings, and inspect example API code.

Think of AI Studio as a testing laboratory

You can experiment with the intelligence behind an application before spending time building the application interface, server files, data storage, and user controls.

AI Studio, Gemini, and the Gemini API

These names are related, but they do not mean the same thing.

Gemini

Gemini is the family of AI models that processes your instructions and generates responses.

Google AI Studio

AI Studio is the visual workspace where you can test Gemini models, prompts, instructions, files, and model settings.

The Gemini API

The Gemini API is the connection your own application uses to send information to Gemini and receive a response.

The simple relationship

AI Studio helps you test the idea. The Gemini API helps you place that idea inside your own application.

Open Google AI Studio

Open Google AI Studio in a separate browser tab and sign in with your Google account.

Open Google AI Studio

The interface may change

Google updates AI Studio regularly. A button may move or receive a slightly different name, but the important concepts remain the same: select a model, provide instructions, enter input, run the prompt, and review the response.

The Two Main Work Areas

1. Playground

The Playground is where you directly test models and prompts. This is the primary area we will use during the course.

A Playground session usually contains:

  • A model selector
  • A prompt or chat input area
  • A generated response area
  • System instructions
  • Run settings
  • Optional tools and output controls
  • A Get code option

2. Build Mode

Build mode allows you to describe an application in natural language and have AI Studio generate its interface and code.

It can be useful for prototypes and experiments, but this course will not depend on it. We are learning how an AI application works, how its files are organized, and how it communicates with Gemini.

Why we are starting in the Playground

A generated application may look impressive without teaching you what its requests, files, settings, or server code are doing. The Playground lets us isolate and understand the AI behavior before we build around it.

Understanding the Playground

The Model Selector

The selected model determines which Gemini model processes your request. Different models may prioritize speed, reasoning, multimodal capabilities, or cost.

Model names change over time, so do not become overly attached to one specific model name. Learn how to select the appropriate model for the task.

The Prompt Input

The prompt input contains the immediate request you want Gemini to process.

For example:

Rewrite the following message in a professional and friendly tone:

hey lisa just checking if you got my last email

The Response Area

After running the prompt, Gemini's output appears in the response area. This allows you to judge whether the instructions produced the result you expected.

Run Settings

Run settings control how the model processes the request. Depending on the selected model and current interface, this area may include:

  • System instructions
  • Model parameters
  • Safety settings
  • Structured output
  • Function calling
  • Code execution
  • Google Search grounding

We will examine several of these features individually later in the course.

System Instructions

A system instruction defines the general behavior of the model throughout the current application or prompt session.

Instead of repeatedly telling Gemini what role to perform, you can place that behavior in the system instructions.

Open Run settings and locate the System Instructions area.

Enter this instruction:

You are a practical business communication assistant.

Rewrite messages so they are clear, professional, and friendly.

Preserve the original meaning.

Do not add claims, promises, dates, or information that was not
included by the user.

Return only the rewritten message.

Then enter this message into the normal prompt box:

hey lisa just checking if you got my last email

Run the prompt and review the result.

What just happened?

The system instruction established the application's permanent behavior. The prompt supplied the individual message that needed to be processed.

System Instruction Versus User Prompt

Separating these two types of information is an important application-development concept.

System Instruction

Defines what the application is, how it should behave, and what rules it should follow.

You are a professional email rewriting assistant.
Preserve the user's meaning.
Do not invent information.
Return only the rewritten email.

User Prompt

Contains the information or task supplied during one particular request.

Rewrite this message:

Can we move our meeting to Thursday afternoon?

In a finished application, the system instruction would normally be stored in your server code. The user's message would come from a form field.

Run a Simple Comparison

We are going to test how instructions affect the output.

Test 1 — Vague Prompt

Remove the system instruction temporarily and run:

Make this better:

i need the report tomorrow

Review the result. Gemini must decide what “better” means because the request provides very little direction.

Test 2 — Controlled Instructions

Restore the business communication system instruction and run:

Rewrite this message in a professional but direct tone:

i need the report tomorrow

Compare the two responses.

The lesson

Better instructions reduce how much the model must guess. They do not guarantee perfection, but they make the desired behavior clearer and more repeatable.

Testing Is an Iterative Process

One successful response does not prove that an instruction is reliable.

Test the same instruction with different types of input:

  • A short message
  • A long message
  • A poorly written message
  • A message that is already professional
  • A message containing dates or numbers
  • A message with missing information

Look for situations where Gemini changes the meaning, invents information, ignores the requested format, or becomes unnecessarily wordy.

Do not test only your best example

An application must survive normal users, incomplete input, unclear writing, accidental formatting, and unexpected requests. Test the difficult examples before calling the prompt finished.

Using Get Code

After testing a prompt, AI Studio can display example code for sending a similar request through the Gemini API.

Locate the Get code option and open it. The available language choices may vary as Google updates the platform.

The generated example typically shows:

  • The selected model
  • The system instruction
  • The prompt contents
  • Generation settings
  • The API request
  • How the response is read

You do not need to understand every line yet. For now, recognize that AI Studio is converting the visual settings into an API request that code can send.

Generated code is a starting point

Do not assume that generated code is a complete, secure, production-ready application. It still needs error handling, API-key protection, input validation, usage controls, and a user interface.

Why We Will Use PHP and REST

AI Studio may emphasize languages such as JavaScript or Python in its generated examples. Our course application uses PHP, so we will also learn how to send Gemini requests through its REST interface.

The underlying request still contains the same basic information:

{
    "model": "selected-model",
    "system_instruction": "Application behavior",
    "contents": "User input",
    "generation_config": "Output settings"
}

The programming language changes how the request is written, but it does not change the basic request-and-response process.

AI Studio Is Not the Finished Application

AI Studio can prove that an idea works, but your finished product still needs to decide:

  • Who may use the application
  • Where the API key is stored
  • What information the user may submit
  • How errors are displayed
  • How usage is tracked
  • How results are formatted
  • Whether information is saved
  • What happens when the API is unavailable

This is why a working prompt and a working application are not the same thing.

Common Beginner Mistakes

Changing too many settings at once

Change one instruction or setting, run the prompt again, and compare the result. Otherwise, you will not know which change caused the difference.

Judging a prompt from one response

Generative models can produce different wording across repeated requests. Test several examples before deciding that the prompt is reliable.

Copying generated code without understanding it

Generated code can be useful, but you should identify where the model, instructions, user input, API key, and response are handled.

Confusing the Playground with a product

The Playground is an excellent testing environment. It is not a replacement for the interface, security, routing, and controls of your finished application.

Practical Exercise

Before completing this lesson, perform the following exercise in Google AI Studio:

  1. Open a new Playground chat.
  2. Select an available Gemini text model.
  3. Open Run settings.
  4. Add the business communication system instruction from this lesson.
  5. Run at least three different poorly written messages.
  6. Modify one instruction and run the same messages again.
  7. Compare the original and revised results.
  8. Open Get code and locate the model, instructions, and prompt.

Completion goal

You should be able to explain the difference between the model, the system instruction, the user prompt, the generated response, and the code used to send the request.

Lesson Summary

Google AI Studio is a visual environment for testing Gemini models and application behavior. The Playground helps you refine prompts and instructions, while Get code shows how those settings become an API request.

AI Studio helps us prove what the AI portion should do. In later lessons, we will place that behavior inside a secure application that we control.