Back to library
AI
best practice

Rapidly Prototype Using the Gemini API Quickstart

Get your first AI script running in minutes with AI Studio.

Jumpstart your AI development by generating a free API key in Google AI Studio and using the 'google-genai' library for rapid prototyping.

Google Gemini

The Scenario

You want to build a small script to automate the categorization of customer support emails but don't know where to start.

Before & after

The old way

Researching how to integrate AI and manually testing different complex vendor platforms can take several hours or days of reading documentation.

With AI

Quickly set up a free API key at AI Studio and use the Python or Node.js SDKs to run a 'generateContent' script in under 5 minutes.

The Prompt

To make your first request in Python:

import google.generativeai as genai
import os

genai.configure(api_key="[YOUR_API_KEY]")
model = genai.GenerativeModel('gemini-pro')
response = model.generate_content("[INSERT_PROMPT_HERE]")
print(response.text)

Google AI Studio provides a 'no-setup' environment to get a key and test ideas before moving to full enterprise production in Google Cloud.

Source

Release notes  |  Gemini API  |  Google AI for Developers
"Create one on AI Studio for free to get started: Create a Gemini API Key"