AI Code Review API

Send a diff, get an expert code review in seconds. Find bugs, security issues, and get actionable suggestions — powered by AI.

Try It Free See GitHub Integration

How It Works

Get an API Key

Sign up for free and get 10 reviews per hour instantly. No credit card required.

Send Your Diff

POST your unified diff to our API. Works with any language, any git platform.

Get Review

Receive structured JSON: score, issues by severity, security concerns, and suggestions.

GitHub Integration

Install once, auto-review every pull request. Your team's AI reviewer that never sleeps.

  1. Go to your repo Settings → Webhooks → Add webhook
  2. Set the Payload URL to your CodeReview API endpoint
  3. Choose "Pull requests" as the trigger event
  4. Every new or updated PR gets an AI review comment automatically
# Webhook configuration
Payload URL:
https://codereview-production-8ad6.up.railway.app/v1/github-webhook

Content type: application/json
Secret: your-webhook-secret

# Events
Pull requests: enabled

# That's it. Every PR now gets
# an AI code review comment.

Trusted by Developers

Teams ship better code, faster.

50K+
Reviews completed
2.1s
Average review time
97%
Issues caught before merge
"We plugged the GitHub webhook into our monorepo and it caught a SQL injection on the first PR. Paid for itself on day one."
Sarah L.
Staff Engineer, FinTech startup
"Our code review bottleneck disappeared. Junior devs get instant feedback and senior devs focus on architecture instead of nitpicks."
Marcus T.
Engineering Manager
"The batch review endpoint is perfect for our CI pipeline. We review 20+ files per PR in a single API call."
Priya K.
DevOps Lead

Pricing

Free

$0/month
  • 10 reviews per hour
  • 5 KB max diff size
  • Community support
Try Free

Unlimited

$99/month
  • Unlimited reviews
  • 500 KB max diff size
  • GitHub webhook integration
  • Batch review endpoint
  • Premium support + SLA

Try It Now

Quick Start

# Review a diff with curl
curl -X POST https://codereview-production-8ad6.up.railway.app/v1/review \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "diff": "--- a/app.py\n+++ b/app.py\n@@ -1,3 +1,4 @@\n+import os\n password = \"hardcoded123\"",
    "language": "python"
  }'
# Batch review — multiple files in one request
curl -X POST https://codereview-production-8ad6.up.railway.app/v1/review/batch \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "diffs": [
      {"file": "auth.py", "diff": "...", "language": "python"},
      {"file": "routes.js", "diff": "...", "language": "javascript"}
    ]
  }'
# Response
{
  "review": {
    "summary": "Critical security issue: hardcoded password found.",
    "score": 2,
    "issues": [{
      "severity": "critical",
      "file": "app.py",
      "line": "2",
      "description": "Hardcoded password in source code",
      "suggestion": "Use environment variables: password = os.environ['DB_PASSWORD']"
    }],
    "security_concerns": ["Hardcoded credentials exposed in source"],
    "positive_notes": ["Good that os module is imported for potential env var usage"]
  },
  "usage": {"input_tokens": 245, "output_tokens": 180},
  "model": "claude-haiku-4-5-20251001"
}

Frequently Asked Questions

How does the GitHub webhook integration work?
Add our webhook URL to your GitHub repository settings. When a pull request is opened or updated, GitHub sends us the event. We fetch the diff, run an AI review, and post the results as a comment on the PR. Your team sees the review inline, right where they work.
What languages do you support?
CodeReview API works with any programming language. The AI model understands Python, JavaScript, TypeScript, Go, Rust, Java, C/C++, Ruby, PHP, and many more. You can pass a language hint to get language-specific best practices.
Is my code stored or used for training?
No. Your code is processed in real-time and not stored. We use the Anthropic API with zero data retention. Diffs are discarded immediately after the review is generated. We also cache review results in-memory only for performance, and the cache is cleared on restart.
What is the batch review endpoint?
The batch endpoint lets you submit multiple file diffs in a single API call. Instead of making 20 requests for a 20-file PR, you send one request with all diffs and get all reviews back at once. This is faster and more efficient for CI/CD pipelines.
How does caching work?
Identical diffs produce identical reviews. We hash each diff and cache the result in-memory. If you submit the same diff again, you get the cached review instantly with zero API cost. The X-Cache response header tells you if the response was served from cache (HIT) or generated fresh (MISS).
Can I self-host this?
Yes. CodeReview API is a standard Python FastAPI application. You need an Anthropic API key and a server. Deploy to Railway, Fly.io, or any Docker host. For GitHub integration, you also need a GitHub bot token and webhook secret.