All Guides5 steps · 10 min

Gemini AI Setup Guide

Get started with Gemini 2.0 Flash - ultra-fast multimodal AI with native code execution.

Native Code Execution

Run Python code in a sandboxed environment directly within Gemini.

Multimodal Generation

Generate images alongside code and text in a single response.

1M Token Context

Process entire codebases with Gemini's massive context window.

1

Get Your Gemini API Key

Create an API key from Google AI Studio.

Visit Google AI Studio to create your free API key:

Open Google AI Studio

Free tier available

Gemini offers a generous free tier for development.

2

Install Gemini CLI (Optional)

Install the Gemini CLI for terminal-based workflows.

npm install -g @google/gemini-cli

Or use the SDK directly in your code:

npm install @google/generative-ai
3

Configure Environment

Set up your API key in environment variables.

Add to your environment:

export GEMINI_API_KEY="AIzaSy..."

Or in your .env file:

GEMINI_API_KEY=AIzaSy...
4

Quick Start Code

Test your setup with a simple API call.

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

const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
const model = genAI.getGenerativeModel({ model: "gemini-2.0-flash" });

const result = await model.generateContent("Hello, Gemini!");
console.log(result.response.text());
5

Install gICM Gemini Agents

Add Gemini-optimized agents from the marketplace.

npx @gicm/cli add agent/gemini-vibe-coder --platform=gemini
npx @gicm/cli add agent/gemini-visual-builder --platform=gemini
Browse all Gemini agents