Five ways my Gemini-for-Claude-Code setup broke, and the fixes
I set up Claude Code to hand research and review jobs to Gemini. Over two days of building I hit a retired model, overloaded endpoints, an exhausted quota, an empty reply from a thinking model, and an agent that wanted to print my API key. None of these is exotic. Anyone wiring a second model into a coding agent will meet them, so here's each failure, how to recognise it from the API response,…
Five issues arose while integrating Gemini into a Claude Code setup, each with its own solution. First, a retired model ID resulted in a 404 error, which can be prevented by checking which models are available with the current API key. Second, high demand caused 503 errors, which can be mitigated with jittered exponential backoff that respects Retry-After headers and switches to a fallback chain of models.
Third, 429 quota errors were initially treated like transient 503s, but this was corrected by classifying them separately and implementing a circuit breaker to stop calling the API when the quota is exhausted. Fourth, a thinking model returned an empty string despite an HTTP 200 response, which can be avoided by allocating more output tokens for thinking models, dropping the thought parts, and turning an empty answer into an error message indicating the cause.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.