Google Gemini API
Google Gemini API — free tier is generous, multimodal (image + video + text).
About this API
Gemini is Google's model family. Big pluses: a real free tier (60 rpm), multimodal including video, tight integration with the Google ecosystem. Gemini 1.5 Pro supports up to 2M tokens of context — the largest in market. Downside: Hebrew still trails GPT-4 and Claude.
Who it's for
Developers who want a free tier
Video/image processing
Huge-context tasks
Google-ecosystem integrations
How to use it
- 1Create a key at aistudio.google.com.
- 2Install `@google/generative-ai`.
- 3Call generateContent with a prompt (image/video attachments supported).
Installation & setup
`npm install @google/generative-ai` or `pip install google-generativeai`. SDK shape differs slightly from OpenAI.
Code examples
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
const result = await model.generateContent("הסבר בקצרה מה זה Next.js");
console.log(result.response.text());Sample response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "Next.js הוא פריימוורק React לבניית אתרים…"
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 12,
"candidatesTokenCount": 48
}
}FAQ
Yes — 60 rpm for Flash. Pro is more limited.
Tips & pitfalls
Gemini 1.5 Flash = cheap/fast, Pro = quality/expensive.
For truly huge documents — only Gemini offers 2M context.
Guides
Related APIs
OpenAI API
The API for ChatGPT, GPT-4 and DALL-E. The world's most-used AI API.
Anthropic Claude API
Claude's API — models particularly strong in code, long-form content and textual analysis.
Hugging Face Inference API
Access thousands of open-source models — from LLMs to image recognition — without self-hosting.