Google Gemini API
A hosted service with its own key and prices. This page lists the addresses it answers, the facts its documentation states, and the setup of each harness.
Addresses and facts
- Native API:
https://generativelanguage.googleapis.com/v1betaprovider documentation, read - OpenAI Chat Completions:
https://generativelanguage.googleapis.com/v1beta/openaiprovider documentation, read
- Authentication
- x-goog-api-key, or Authorization: Bearer on the OpenAI-compatible address, with the key in
GEMINI_API_KEYprovider documentation, read - Structured output
- provider documentation, read
- Tool calling
- provider documentation, read
- Rate limits
- Read the page provider documentation, read
- Prices
- Read the page provider documentation, read
- Data retention
- Content sent under the unpaid quota may be used to improve Google products. Paid use follows the paid services terms on the same page. Read the page provider documentation, read
- Documentation
- Unknown
- Output limits Baltor recorded
- Unknown
Harness setup
Replace deep-research-max-preview-04-2026 with the model you want.
OpenCode
Put this in opencode.json in your project folder:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"google": {
"npm": "@ai-sdk/openai-compatible",
"name": "Google Gemini API",
"options": {
"baseURL": "https://generativelanguage.googleapis.com/v1beta/openai",
"apiKey": "{env:GEMINI_API_KEY}"
},
"models": {
"deep-research-max-preview-04-2026": {
"name": "deep-research-max-preview-04-2026"
}
}
}
}
}- OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.
From OpenCode documentation, read .
Pi
Put this in ~/.pi/agent/models.json:
{
"providers": {
"google": {
"baseUrl": "https://generativelanguage.googleapis.com/v1beta/openai",
"api": "openai-completions",
"apiKey": "$GEMINI_API_KEY",
"models": [
{
"id": "deep-research-max-preview-04-2026"
}
]
}
}
}- The apiKey field can name an environment variable as $NAME.
From Pi documentation, read .
Codex
Codex speaks only the Responses API, and Google Gemini API documents no Responses address. A gateway that offers one can sit in between.
- Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.
From Codex documentation, read .
Claude Code
Claude Code sends Anthropic Messages requests, and Google Gemini API documents no such address. A gateway that translates to that API can sit in between.
- Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.
From Claude Code documentation, read .
Models it lists
Prices in US dollars per million tokens, input and output, as models.dev, read records them.
| Model | Input | Output | Context | As of |
|---|---|---|---|---|
Deep Research Max Preview (Apr-21-2026) deep-research-max-preview-04-2026 | 2.00 USD | 12.00 USD | 131,072 | older than 30 days |
Deep Research Preview (Apr-21-2026) deep-research-preview-04-2026 | 2.00 USD | 12.00 USD | 131,072 | older than 30 days |
Gemini 2.5 Computer Use Preview 10-2025 gemini-2.5-computer-use-preview-10-2025 | 1.25 USD | 10.00 USD | 128,000 | older than 30 days |
Gemini 2.5 Flash gemini-2.5-flash | 0.300 USD | 2.50 USD | 1,048,576 | older than 30 days |
Nano Banana gemini-2.5-flash-image | 0.300 USD | 30.00 USD | 32,768 | older than 30 days |
Gemini 2.5 Flash-Lite gemini-2.5-flash-lite | 0.100 USD | 0.400 USD | 1,048,576 | older than 30 days |
Gemini 2.5 Flash Preview TTS gemini-2.5-flash-preview-tts | 0.500 USD | 10.00 USD | 8,192 | older than 30 days |
Gemini 2.5 Pro gemini-2.5-pro | 1.25 USD | 10.00 USD | 1,048,576 | older than 30 days |
Gemini 2.5 Pro Preview TTS gemini-2.5-pro-preview-tts | 1.00 USD | 20.00 USD | 8,192 | older than 30 days |
Gemini 3 Flash Preview gemini-3-flash-preview | 0.500 USD | 3.00 USD | 1,048,576 | older than 30 days |
Nano Banana Pro gemini-3-pro-image | 2.00 USD | 120.00 USD | 65,536 | older than 30 days |
Nano Banana Pro gemini-3-pro-image-preview | 2.00 USD | 120.00 USD | 131,072 | older than 30 days |
Nano Banana 2 gemini-3.1-flash-image | 0.500 USD | 60.00 USD | 131,072 | older than 30 days |
Nano Banana 2 gemini-3.1-flash-image-preview | 0.500 USD | 60.00 USD | 65,536 | older than 30 days |
Gemini 3.1 Flash Lite gemini-3.1-flash-lite | 0.250 USD | 1.50 USD | 1,048,576 | older than 30 days |
Nano Banana 2 Lite gemini-3.1-flash-lite-image | 0.250 USD | 30.00 USD | 65,536 | older than 30 days |
Gemini 3.1 Flash Lite Preview gemini-3.1-flash-lite-preview | 0.250 USD | 1.50 USD | 1,048,576 | older than 30 days |
Gemini 3.1 Flash Live Preview gemini-3.1-flash-live-preview | 0.750 USD | 4.50 USD | 131,072 | older than 30 days |
Gemini 3.1 Flash TTS Preview gemini-3.1-flash-tts-preview | 1.00 USD | 20.00 USD | 8,192 | older than 30 days |
Gemini 3.1 Pro Preview gemini-3.1-pro-preview | 2.00 USD | 12.00 USD | 1,048,576 | older than 30 days |
Gemini 3.1 Pro Preview Custom Tools gemini-3.1-pro-preview-customtools | 2.00 USD | 12.00 USD | 1,048,576 | older than 30 days |
Gemini 3.5 Flash gemini-3.5-flash | 1.50 USD | 9.00 USD | 1,048,576 | older than 30 days |
Gemini 3.5 Flash Lite gemini-3.5-flash-lite | 0.300 USD | 2.50 USD | 1,048,576 | older than 30 days |
Gemini 3.5 Live Translate Preview gemini-3.5-live-translate-preview | 3.50 USD | 21.00 USD | 16,384 | older than 30 days |
Gemini 3.6 Flash gemini-3.6-flash | 0.750 USD | 3.75 USD | 1,048,576 | older than 30 days |
Gemini 3.7 Flash gemini-3.7-flash | 0.750 USD | 3.75 USD | 1,048,576 | older than 30 days |
Gemini 3.8 Flash gemini-3.8-flash | 0.750 USD | 3.75 USD | 1,048,576 | |
Gemini Embedding 001 gemini-embedding-001 | 0.150 USD | 0 USD | 2,048 | older than 30 days |
Gemini Embedding 2 gemini-embedding-2 | 0.200 USD | 0 USD | 8,192 | older than 30 days |
Gemini Flash Latest gemini-flash-latest | 0.750 USD | 3.75 USD | 1,048,576 | older than 30 days |
Gemini Flash-Lite Latest gemini-flash-lite-latest | 0.300 USD | 2.50 USD | 1,048,576 | older than 30 days |
Gemini Omni Flash Preview gemini-omni-flash-preview | 1.50 USD | 17.50 USD | 131,072 | older than 30 days |
Gemma 4 26B A4B IT gemma-4-26b-a4b-it | Unknown | Unknown | 262,144 | |
Gemma 4 31B IT gemma-4-31b-it | Unknown | Unknown | 262,144 | |
Lyria 3 Clip Preview lyria-3-clip-preview | 0 USD | 0 USD | 1,048,576 | older than 30 days |
Lyria 3 Pro Preview lyria-3-pro-preview | 0 USD | 0 USD | 1,048,576 | older than 30 days |
Veo 3.1 fast veo-3.1-fast-generate-preview | Unknown | Unknown | 480 | |
Veo 3.1 veo-3.1-generate-preview | Unknown | Unknown | 480 | |
Veo 3.1 lite veo-3.1-lite-generate-preview | Unknown | Unknown | 480 |
Sources of this page
- ai.google.dev/gemini-api/docs/openai, read
- ai.google.dev/gemini-api/docs/structured-output, read
- ai.google.dev/gemini-api/docs/function-calling, read
- ai.google.dev/gemini-api/docs/rate-limits, read
- ai.google.dev/gemini-api/docs/pricing, read
- ai.google.dev/gemini-api/terms, read
- models.dev/api.json, read
Paid links
No link in this directory is a paid link or an ad, and no listing is paid for. The order and the contents of every list come from the sources named on this page.