llmreference
Google AI Studio

Using Gemini 1.5 Flash on Google AI Studio

Implementation guide · Gemini 1.5 · Google DeepMind

Serverless

Quick Start

  1. 1
    Create an account at Google AI Studio and generate an API key.
  2. 2
    Use the Google AI Studio SDK or REST API to call gemini-1.5-flash — see the documentation for request format.

Code Examples

Install
pip install google-genai
API key
GOOGLE_API_KEY
Model ID
gemini-1.5-flash

Use the model name directly, e.g. "gemini-2.0-flash", "gemini-1.5-pro", or "gemini-2.5-pro-preview-05-06".

import os
from google import genai

client = genai.Client(api_key=os.environ["GOOGLE_API_KEY"])
response = client.models.generate_content(
    model="gemini-1.5-flash",
    contents="Hello"
)
print(response.text)

About Google AI Studio

Google AI Studio is a model prototyping environment and API access point for Gemini models, offering an inference playground for developers to test and build AI applications.

Pricing on Google AI Studio

Capabilities

Structured Outputs

About Gemini 1.5 Flash

Gemini 1.5 Flash is a large language AI model by Google, crafted for speed and efficiency in high-volume scenarios 145. As a lightweight model, it's optimized for fast processing and cost-effectiveness, making it ideal for real-time applications and high-frequency tasks 567. With its multimodal capabilities, Gemini 1.5 Flash effectively processes and reasons across multiple data types, including text, images, audio, video, and PDFs 145. Despite its smaller size compared to Gemini 1.5 Pro, it excels in tasks like summarization, chat applications, and data extraction from lengthy documents, employing "knowledge distillation" to transfer essential knowledge from larger models 5. Additionally, it features an extensive context window of up to 1 million tokens, allowing it to manage large information volumes effectively 456.

Model Specs

Released2024-05-14
Context1M
ArchitectureDecoder Only
Knowledge cutoff2024-05