Skip to main content
Google Gemini models offer excellent performance with the largest context windows and competitive pricing.

Installation

Basic Setup

Native API

Available Models

OpenRouter Model IDs

When using OpenRouter, use the full model path:

Configuration Options

Capabilities

Input Formats

Images

Gemini supports more image formats than other providers:
Image limits: 20MB per image, 3072x3072 max (auto-scaled).

PDFs

Gemini has the highest PDF capacity:
PDF limits: 50MB per file, up to 1000 pages.

Extended Thinking

Gemini models support thinking mode for complex reasoning:
Thinking budget limits:
  • Gemini 2.5 Flash: 0-24576 tokens (default: auto, up to 8192)
  • Gemini 2.5 Pro: Higher limits available

Large Document Processing

Gemini’s 1M token context makes it ideal for large documents:

Production Setup

Pricing

Via OpenRouter (approximate): Gemini is typically the most cost-effective option for high-volume processing.

Example: Multi-Page Report

Structured Output Notes

Gemini uses responseMimeType: application/json for JSON output. The SDK embeds the schema in the prompt for reliable structured output, as Gemini’s native responseSchema has limitations with complex schemas.

Next Steps

OpenAI

GPT-4 models

Anthropic

Claude models