Skip to main content
OpenAI provides a family of GPT models accessible via a REST API at https://api.openai.com. Rate limits are applied per organisation and scale automatically as your usage and spend increase.
Monitor your current tier, rate limits, and token usage in the OpenAI Platform dashboard.

Supported models

Garth supports the following OpenAI models for code review and scan requests.
ModelBest forContext window
gpt-4oRecommended. Highest accuracy for code review, security analysis, and large diffs128k tokens
gpt-4o-miniFast turnaround, lower cost, high-volume routine reviews128k tokens
gpt-4-turboComplex reasoning over large codebases128k tokens
gpt-4Baseline GPT-4 for standard reviews8k tokens
Use gpt-4o for security-sensitive pull requests and large diffs. Use gpt-4o-mini for high-volume, routine reviews where speed and cost matter more.

Usage tiers

OpenAI automatically advances your account through usage tiers as your cumulative spend increases. Higher tiers unlock greater rate limits.
TierRequirementMonthly spend limit
FreeAccount created, no payment method required$100
Tier 1$5 paid$100
Tier 2$50 paid and 7+ days since first payment$500
Tier 3$100 paid and 7+ days since first payment$1,000
Tier 4$250 paid and 14+ days since first payment$5,000
Tier 5$1,000 paid and 30+ days since first payment$200,000
You advance to the next tier as soon as your cumulative payments cross the threshold and the waiting period has elapsed. There is no manual upgrade process.

Rate limits by tier

Rate limits are measured in three dimensions:
  • RPM — requests per minute
  • TPM — tokens per minute
  • RPD — requests per day

Tier 1

ModelRPMTPMRPD
gpt-4o50030,00010,000
gpt-4o-mini500200,00010,000
gpt-4-turbo50030,00010,000

Tier 2

ModelRPMTPMRPD
gpt-4o5,000450,000
gpt-4o-mini5,0002,000,000
gpt-4-turbo5,000450,000

Tier 3

ModelRPMTPMRPD
gpt-4o5,000800,000
gpt-4o-mini5,0004,000,000
gpt-4-turbo5,000800,000

Tier 4

ModelRPMTPMRPD
gpt-4o10,0002,000,000
gpt-4o-mini10,00010,000,000
gpt-4-turbo10,0002,000,000

Tier 5

ModelRPMTPMRPD
gpt-4o10,00030,000,000
gpt-4o-mini30,000150,000,000
gpt-4-turbo10,00030,000,000

Choosing the right tier for your team

Tier 1 — Evaluation or very small teams

Fewer than 10 developers, infrequent PRs, or you are trialling BYOK before committing. Requires only $5 in total payments.

Tier 2 — Small to medium teams

10–50 developers with regular PR activity. The 5,000 RPM / 450,000 TPM limit on gpt-4o handles dozens of concurrent reviews comfortably.

Tier 3 — Large engineering orgs

50–200 developers or multiple busy repositories. Nearly doubles the TPM versus Tier 2.

Tier 4 / Tier 5 — High-velocity platforms

200+ developers, monorepos, or CI pipelines generating high PR volume. Tier 5 supports up to 30M TPM on gpt-4o.

Token consumption per review

Each Garth review consumes input tokens (your diff and context) and output tokens (the review comments). Estimates below are for gpt-4o.
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
Keeping PRs focused (under 400 lines changed) reduces token usage per review and generally improves comment accuracy.

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:
  • Increase your spend to advance to the next tier in the OpenAI Platform
  • Switch to gpt-4o-mini to reduce per-request token usage
  • Contact support if you need help sizing the right tier

Getting an OpenAI API key

1

Create an OpenAI account

Go to platform.openai.com and sign up or log in.
2

Add a payment method

Navigate to Settings → Billing and add a payment method. Purchase at least $5 in credits to activate Tier 1 and unlock rate limits beyond the free tier.
3

Generate an API key

Go to API Keys in the left sidebar and click Create new secret key. Give it a descriptive name such as garth-byok and set the permissions to All.
4

Copy and store the key

Copy the key — it is shown only once. Paste it into Garth’s Settings → Integrations → LLM under the OpenAI provider.
Never commit your OpenAI 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 OpenAI documentation for models, pricing, and rate limits.

OpenAI models

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

Rate limits

Official rate limit reference for all tiers and models.

Pricing

Per-token pricing for all OpenAI models.

API keys

Create and manage your OpenAI API keys.

Next steps

BYOK overview

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

OpenAI Platform — Limits

View your current tier and live rate limit usage in the OpenAI Platform dashboard.