Installation
Basic Setup
Via OpenRouter (Recommended)
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:PDFs
Gemini has the highest PDF capacity:Extended Thinking
Gemini models support thinking mode for complex reasoning:- 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 usesresponseMimeType: 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