ThinkFacility

Error messages

Error when talking to Gemini API

The message

Error when talking to Gemini API
Gemini CLI 0.61.0 read September 26, 2026Gemini CLIGoogleGemini API

What it means

A request to Gemini failed and Gemini CLI saved a report about it to a temp file. The line itself doesn't say what failed; the error text after the file path does.

What to do

Read the words after the .json path: fetch failed is your network, API key not valid is your key, a 429 is quota. Fix that one, and keep the report file private.

This is how it looks in a March 2026 report from a Mac:

✖  Error when talking to Gemini API Full report available at: /var/folders/.../T/gemini-client-error-Turn.run-sendMessageStream-2026-03-10T19-50-46-399Z.json TypeError: fetch failed

That line turns up in 103 issues on the Gemini CLI tracker as of September 26, 2026, and it isn't one error. We read where it comes from in the v0.61.0 source. When a request to the model throws, Gemini CLI catches it, writes a report, and prints this fixed sentence with the report's path glued on. Whatever went wrong is the text after the path (TypeError: fetch failed above). The chat also shows it on its own, usually as [API Error: ...].

What's in the report file

The file lands in your system temp folder (/tmp on Linux, a /var/folders/... path on macOS) and is named gemini-client-error-Turn.run-sendMessageStream- plus a timestamp. It holds the error message and stack trace, and also the whole conversation so far plus the request that failed.

That last part matters. The file is easy to attach to a bug report, and it can hold your code and anything you pasted in (plus the contents of every file the model read). Open it and read the error block at the top. Share that block if you need help, not the file.

Reading the error after the path

These are the tails that come up most in the tracker, and where each one points:

When it keeps happening

A sign-in problem isn't wrapped this way (the code rethrows it so you get a login prompt), so if you see this line the CLI thinks you're signed in. Run /about and note the version, model and auth type it lists, because that's the first thing anyone will ask for.

If your company sends API traffic through its own endpoint, Gemini CLI reads GOOGLE_GEMINI_BASE_URL (and GOOGLE_VERTEX_BASE_URL for Vertex AI) to send requests through a different endpoint. For a report upstream, the Gemini CLI team asks for /about output and reproduction steps, and several of these threads closed for lack of them.

Other lines the same feature prints

Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.

  • Error when talking to Gemini API Full report available at: /tmp/gemini-client-error-Turn.run-sendMessageStream-.json
  • Error when talking to Gemini API Full report available at:
  • gemini-client-error-Turn.run-sendMessageStream
  • [API Error: exception TypeError: fetch failed sending request]