Quickstart: Send text prompts to Gemini using Vertex AI Studio Stay organized with collections Save and categorize content based on your preferences.
You can use Vertex AI Studio to design, test, and manage prompts forGoogle'sGemini large language models(LLMs) and third-party models. Vertex AI Studio supports certainthird-party models that are offered on Vertex AI asmodels as aservice (MaaS), such asAnthropic Claude models and Meta's Llama models.
Note: On your initial use for third-party models, Vertex AI promptsyou to accept the third-party's terms and conditions. You must do this once foreach third-party provider to start using their models.In this quickstart, you:
- Send these prompts to the Gemini API using samples from thegenerative AI prompt gallery, including the following:
- A summarization text prompt
- A code generation prompt
- View the code used to generate the responses
Before you begin prompting in Vertex AI Studio
This quickstart requires you to complete the following steps to set up aGoogle Cloud project and enable the Vertex AI API.
To get the permissions that you need to complete the tasks in this quickstart,ask your administrator to grant you the followingIAM roles on your project:
- To enable the Vertex AI API if it isn't already enabled:serviceusage.serviceUsageAdmin
- To run prompts in Vertex AI Studio:Vertex AI User (
roles/aiplatform.user)
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- Create a project: To create a project, you need the Project Creator role (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Vertex AI API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- Create a project: To create a project, you need the Project Creator role (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Vertex AI API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.
Sample prompts in Vertex AI Studio
A prompt is a natural language request submitted to a language model thatgenerates a response. Prompts can contain questions, instructions, contextualinformation,few-shot examples,and partial input for the model to complete. After the model receives a prompt,depending on the type of model used, it can generate text, embeddings, code,images, videos, music, and more.
The sample prompts in Vertex AI Studioprompt galleryare predesigned to help demonstrate model capabilities. Each prompt ispreconfigured with specified model and parameter values so you can open thesample prompt and clickSubmit to generate a response.
Test the Gemini flash model using a summarization text prompt
Send a summarization text prompt to the Gemini API in Vertex AI. A summarizationtask extracts the most important information from text. You can provideinformation in the prompt to help the model create a summary, or ask the modelto create a summary on its own.
Go to thePrompt gallery page from the Vertex AIsection in the Google Cloud console.
Go to prompt galleryIn theTasks drop-down menu, selectSummarize.
Open theAudio summarization card.
This sample prompt includes an audio file and requests a summary of the filecontents in a bulleted list.

Notice that in the settings panel, the model's default value is set toGemini-2.0-flash-001. You can choose a different Gemini modelby clickingSwitch model.

ClickSubmit to generate the summary.

The output is displayed in the response.
To view the Vertex AI API code used to generate the transcriptsummary, clickBuild with code >Get code.
In theGet code panel, you can choose your preferred language to get thesample code for the prompt, or you can open the Python code in aColab Enterprise notebook.
Test the Gemini flash model using a code generation prompt
Send a code generation prompt to the Gemini API in Vertex AI. A code generation task generates codeusing a natural language description.
Go to thePrompt gallery page from the Vertex AIsection in the Google Cloud console.
Go to prompt galleryIn theTasks drop-down menu, selectCode.
Open theGenerate code from comments card.
This sample prompt includes asystem instructionthat tells the model how to respond and some incomplete Java methods.

Notice that in the settings panel, the model's default value is set toGemini-2.0-flash-001. You can choose a different Gemini modelby clickingSwitch model.

To complete each method by generating code in the areas marked
<WRITE CODE HERE>, clickSubmit .The output is displayed in the response.
To view the Vertex AI API code used to generate the transcriptsummary, clickBuild with code >Get code.
In theGet code panel, you can choose your preferred language to get thesample code for the prompt, or you can open the Python code in aColab Enterprise notebook.
Discover what's next with prompts
- To learn more about the capabilities in Vertex AI Studio, seeVertex AI Studiocapabilities.
- See anintroduction to prompt design.
- Learn aboutdesigning multimodal promptsandchat prompts.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.