---
title: A second AI opinion inside Claude Code — Gemini over curl, no arena apps
date: 2026-08-02
tags: claude-code, gemini, curl, multi-agent, workflow, api-key
type: success
reproducible: true
---

# A second AI opinion inside Claude Code — Gemini over curl, no arena apps

I work with one agent all day, and one agent means one set of blind spots. I
wanted a second opinion from a model trained differently — not an "arena" app
where models compete side by side, just a colleague my agent could consult
mid-session when I say "ask Gemini what it thinks."

The surprise was what it did NOT require. I had a paid Google AI Pro
subscription and assumed that was the price of API access. Wrong twice: the
subscription covers the Gemini app, not the API — my key showed quota zero on
every pro model despite the paid account. And the free tier turned out to be
enough all along: creating an API key at aistudio.google.com costs nothing, no
card, and the free quota (hundreds of flash-model calls a day) is far more than
a second-opinion habit ever uses. The paid account I thought was the
requirement was irrelevant to the whole setup.

The wiring is three pieces. The key goes in ~/.zshenv — not .zshrc, which cost
me a broken afternoon: scripted shells skip .zshrc, so the agent's calls saw an
empty variable while my terminal worked fine. The call is one curl to the
generateContent endpoint, with the prompt written to a JSON file first (long
prompts inside shell quotes end in tears). And the habit lives in my agent's
global instructions: trigger phrases like "ask Gemini," a table of which models
my key actually serves, and one behavioral rule — present both views and say
where they disagree, never just relay.

Two gotchas the docs won't tell you: older model names may be retired for new
keys (mine 404 on the 2.5 generation — check what your key lists, not what
blog posts say), and each model has its own daily quota, so use the generous
cheap one by default and save the scarce smarter one for hard questions.

Since then, the second opinion has killed a product hypothesis I was about to
build, stress-tested a pivot, and voted on my logo. It disagrees with my main
agent regularly. That is the point.

## Reproduce this

Prerequisites: any agent that can run shell commands (Claude Code, Cursor…), a
Google account. No paid subscription needed.

Your agent will need from you: the API key you create at
aistudio.google.com/apikey (2 minutes), and where your shell keeps environment
variables for non-interactive sessions (~/.zshenv on zsh, ~/.profile on bash).

Steps: create the key; export it as GEMINI_API_KEY in the non-interactive env
file; list your key's models (GET /v1beta/models) and note which respond;
write the curl call pattern into your agent's global instructions with trigger
phrases and a default cheap model; add the rule "present both views, note
disagreements."

Verify: in a fresh agent session say "ask Gemini whether this plan has holes"
— you should get two genuinely different perspectives, and the agent should
tell you where they diverge.
