Getting Started with 2ndOpinion in 5 Minutes
Set up AI code review with Claude, Codex, and Gemini in your workflow — MCP, CLI, or API. Free tier included.
2ndOpinion gives you AI-to-AI code review — send your diffs to Claude, Codex, and Gemini, and get structured risk analysis, alternative approaches, and clear accept/review/reject recommendations. Here is how to set it up in under five minutes, whether you prefer MCP, the command line, or a raw API.
Option 1: MCP Server (Recommended for Claude Code and Cursor)
If you use Claude Code, Cursor, Windsurf, or any MCP-compatible editor, this is the fastest path. The MCP server gives you 10 review tools directly inside your editor.
Step 1: Get an API Key
Sign up at get2ndopinion.dev/signup and create an API key from your dashboard. Your key will look like sk_2op_....
Step 2: Install the MCP Server
Add this to your MCP configuration:
{
"mcpServers": {
"2ndopinion": {
"command": "npx",
"args": ["-y", "@2ndopinion/mcp@latest"],
"env": {
"SECONDOPINION_API_KEY": "sk_2op_your_key_here"
}
}
}
}
For Claude Code, this goes in ~/.claude/claude_desktop_config.json. For Cursor, add it in Settings > MCP.
Step 3: Use It
Once configured, you have access to these tools directly in your editor:
second_opinion— Get a single-model code review of your current diffconsensus_review— Run all three models and get a consensus analysisbug_hunt— Search for bugs with three models simultaneouslysecurity_audit— OWASP-aligned security analysisgenerate_tests— Generate runnable tests for your changesai_debate— Watch models debate the best approach to a problemask_other_model— Ask any model a freeform questionexplain_changes— Get plain-English explanations for technical or non-technical audiencesreview_pr— Review a GitHub pull request by URLget_usage— Check your remaining credits
Just ask your AI assistant something like "run a consensus review on my staged changes" and it will call the right tool automatically.
Option 2: CLI
The CLI works in any terminal and integrates with git. It auto-detects your staged or unstaged changes.
Step 1: Install
npm install -g 2ndopinion
Step 2: Authenticate
2ndopinion login
This opens a browser-based auth flow. Alternatively, log in with an API key:
2ndopinion login --api-key sk_2op_your_key_here
Step 3: Review Your Code
From inside any git repository:
# Review your current unstaged changes
2ndopinion review
# Review staged changes
2ndopinion review --staged
# Review with a specific model
2ndopinion review --model claude
# Ask a freeform question
2ndopinion ask "Is this rate limiting implementation correct?"
# Get a consensus review (uses 3 credits)
2ndopinion consensus
The CLI outputs structured results directly in your terminal — risk levels, affected files, explanations, and a final recommendation.
Useful CLI Options
# Set your preferred default model
2ndopinion config set defaultLlm codex
# Check your usage and remaining credits
2ndopinion status
# Review a specific file's diff
git diff src/auth.ts | 2ndopinion review --stdin
Option 3: HTTP API
If you want to integrate 2ndOpinion into CI/CD pipelines, custom tools, or scripts, you can call the API directly.
Authentication
Include your API key in the X-2ndOpinion-Key header:
curl -X POST https://get2ndopinion.dev/api/gateway/opinion \
-H "Content-Type: application/json" \
-H "X-2ndOpinion-Key: sk_2op_your_key_here" \
-d '{
"diff": "your git diff here",
"model": "claude"
}'
Key Endpoints
| Endpoint | What It Does | Credits |
|---|---|---|
POST /api/gateway/opinion |
Single-model review | 1 |
POST /api/gateway/consensus |
Three-model consensus | 3 |
POST /api/gateway/bug-hunt |
Three-model bug hunt | 3 |
POST /api/gateway/security-audit |
OWASP security audit | 1-3 |
POST /api/gateway/ask |
Freeform question | 1 |
POST /api/gateway/generate-tests |
Generate tests | 1 |
GET /api/gateway/status |
Account and usage info | 0 |
Example: Consensus Review
curl -X POST https://get2ndopinion.dev/api/gateway/consensus \
-H "Content-Type: application/json" \
-H "X-2ndOpinion-Key: sk_2op_your_key_here" \
-d '{
"diff": "'"$(git diff)"'"
}'
The response includes individual analyses from each model, clustered agreements and disagreements, and a final consensus recommendation.
Option 4: JavaScript and Python SDKs
For programmatic access in your applications:
JavaScript
npm install @2ndopinion/sdk
import { SecondOpinion } from '@2ndopinion/sdk';
const client = new SecondOpinion({ apiKey: 'sk_2op_...' });
const result = await client.review({
diff: gitDiff,
model: 'claude',
});
console.log(result.recommendation); // 'approve' | 'review' | 'reject'
Python
pip install secondopinion
from secondopinion import SecondOpinion
client = SecondOpinion(api_key="sk_2op_...")
result = client.review(diff=git_diff, model="claude")
print(result.recommendation)
Zero-Install: The Playground
If you want to try 2ndOpinion without installing anything, head to the playground. Paste a diff or code snippet, pick a tool, and see the results immediately. No API key required for the playground.
What You Get on the Free Tier
Every account starts with 5 credits per month. That is enough for:
- 5 single-model reviews, or
- 1 consensus review + 2 single-model reviews, or
- 1 bug hunt + 2 questions
If you need more, the Pro plan ($10/month) gives you 100 credits, Power ($25/month) gives you 500, and Agent ($49/month) gives you 1,000. You can also buy credit packs as one-time purchases if you do not want a subscription.
Next Steps
Once you are up and running, explore the full set of tools in the documentation. The skills marketplace has community-created review prompts for specific frameworks and patterns — things like React performance audits, SQL migration reviews, and API design checks.
If you build a custom integration, we would love to hear about it. Reach out on X/Twitter.