Google Gemini API: Setup and Usage on VPS

AI Agents on VPS · 19.04.2026
Google Gemini API: Setup and Usage on VPS

Google Gemini API: Setup and Usage

Gemini 1.5 Pro supports up to 1 million token context window. Gemini 1.5 Flash is fast and free for small volumes.

Python SDK

pip install google-generativeai
import google.generativeai as genai, os
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
model = genai.GenerativeModel("gemini-1.5-flash")
response = model.generate_content("Explain VPS hosting in 3 sentences.")
print(response.text)

Pricing (2025)

ModelInputOutput
Flash$0.075/1M$0.30/1M
Pro$3.50/1M$10.50/1M
Free tier: Flash is free up to 15 RPM — perfect for prototyping and small apps.
← Back to Knowledge Base Ask Support