Developer Guide

Learn how to integrate Gemini 2.5 Flash Image into your applications. From basic setup to advanced features, everything you need is here.

API Integration Code Examples Best Practices Practical Tutorials

Quick Start

1. Get API Key

First, you need to get an API key from Google AI Studio to access Gemini 2.5 Flash Image.

2. Install SDK

npm install @google/generative-ai

3. Basic Usage Example

import { GoogleGenerativeAI } from "@google/generative-ai";

const genAI = new GoogleGenerativeAI(API_KEY);
const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-image" });

const result = await model.generateContent([
  "Generate an image of a mountain sunset",
  // Add image files if needed
]);

console.log(result.response.text());