Skip to main content
Google’s Gemini models are available via the Gemini API at https://generativelanguage.googleapis.com. Free-tier access is provided through Google AI Studio, while paid usage is billed through a Google Cloud project.
Monitor your current quota and usage in Google AI Studio or in the Google Cloud Console if you are using a Cloud billing account.

Supported models

Garth supports the following Gemini models for code review and scan requests.
ModelBest forContext window
gemini-2.0-flashRecommended. Fast, accurate reviews with low latency1M tokens
gemini-1.5-proComplex reasoning over very large diffs and full-repository context2M tokens
gemini-1.5-flashHigh-volume, lower-cost reviews where speed is the priority1M tokens
gemini-1.5-flash-8bLightest model for simple, routine reviews1M tokens
Use gemini-1.5-pro for large or security-sensitive pull requests where maximum context and accuracy matter. Use gemini-2.0-flash as the default — it balances speed and quality for most teams.

Usage tiers

The Gemini API provides a free tier for evaluation, and three paid tiers that unlock higher rate limits based on your billing history and cumulative spend.
TierQualificationsFeatures
FreeAvailable to eligible countries; no credit card requiredNo charge. Requests may be used to improve Google products. Lower rate limits.
Tier 1Billing account linked to the projectRequests are not used for product improvement. Paid per token. Standard limits.
Tier 2Total spend of at least $250 + 30 days since successful paymentHigher rate limits for growing applications.
Tier 3Total spend of at least $1,000 + 30 days since successful paymentMaximum rate limits for enterprise-scale workloads.
For production use, Garth requires at least Tier 1. This removes data usage restrictions and unlocks significantly higher rate limits for concurrent pull request reviews. New accounts must use prepaid billing and will be subject to a monthly spend cap.

Rate limits

Free tier

ModelRPMTPMRPD
gemini-2.0-flash151,000,0001,500
gemini-1.5-pro232,00050
gemini-1.5-flash151,000,0001,500
gemini-1.5-flash-8b151,000,0001,500

Tier 1 and above (Paid tiers)

Upon linking a billing account (Tier 1), rate limits increase substantially. Limits scale further as you reach Tiers 2 and 3. Representative Tier 1 limits:
ModelRPMTPMRPD
gemini-2.0-flash2,0004,000,000
gemini-1.5-pro1,0004,000,000
gemini-1.5-flash2,0004,000,000
gemini-1.5-flash-8b4,0004,000,000
RPM = requests per minute · TPM = tokens per minute · RPD = requests per day. Paid tier limits can be further increased by requesting a quota increase in the Google Cloud Console.

Choosing the right tier for your team

Free tier — Evaluation only

Fewer than 5 developers trialling Gemini BYOK. The free tier’s low RPM and RPD caps make it unsuitable for sustained team use.

Tier 1 / Tier 2 — Small to medium teams

10–100 developers with regular PR activity. The 2,000 RPM limit on gemini-2.0-flash handles dozens of concurrent reviews. Enable Cloud billing to unlock Tier 1.

Tier 3 & Quota increases — Large engineering orgs

100+ developers or monorepos. If Tier 3 limits are insufficient, request a TPM or RPM increase through the Google Cloud Console quotas page.

Token consumption per review

Each Garth review consumes input tokens (your diff and context) and output tokens (the review comments). Estimates below are for gemini-2.0-flash.
Review sizeTypical input tokensTypical output tokens
Small PR (1–5 files, < 200 lines)3,000 – 8,000500 – 1,500
Medium PR (5–20 files, 200–800 lines)8,000 – 25,0001,500 – 4,000
Large PR (20+ files, 800+ lines)25,000 – 80,0004,000 – 10,000
Gemini’s large context window (1M–2M tokens) means Garth can include broad repository context in each review. This improves accuracy but increases token usage — monitor your TPM if you have many concurrent reviews.

Rate limit errors

If your account hits a rate limit, Garth retries automatically with exponential backoff. Sustained limits may delay when review comments are posted. What you will see:
  • A delayed review comment once the retry succeeds
  • A dashboard notification if retries are exhausted and the review is dropped
How to resolve:
  • Enable Cloud billing to upgrade from the free tier to pay-as-you-go
  • Request a quota increase in the Google Cloud Console
  • Switch to gemini-2.0-flash or gemini-1.5-flash to reduce per-request cost and increase throughput
  • Contact support if you need help sizing the right plan

Getting a Gemini API key

1

Sign in to Google AI Studio

Go to aistudio.google.com and sign in with your Google account.
2

Create an API key

Click Get API key in the left sidebar, then click Create API key. Choose an existing Google Cloud project or create a new one to associate the key with.
3

Enable Cloud billing (recommended)

To unlock pay-as-you-go rate limits, open the Google Cloud Console, select your project, and link a billing account. This upgrades your quota automatically.
4

Copy and store the key

Copy the generated key — it starts with AIza. Paste it into Garth’s Settings → Integrations → LLM under the Gemini provider.
Never commit your Gemini API key to a repository. Garth’s secure vault is the correct place to store it. Garth’s own code scan will flag any key found in source code.

Provider references

Official Google documentation for Gemini models, pricing, and rate limits.

Gemini models

Full list of available Gemini models with context windows and capabilities.

Rate limits

Official rate limit reference for free and pay-as-you-go tiers.

Pricing

Per-token pricing for all Gemini models.

Google AI Studio — API keys

Create and manage your Gemini API keys in Google AI Studio.

Next steps

BYOK overview

Add your Gemini key to Garth’s secure vault and set it as your active provider.

Google AI Studio — API keys

Manage your Gemini API keys and view usage in Google AI Studio.