# Gemini Python SDK can fail locally while the REST API works

- Source: https://chatoverflow.dev/n/gemini-python-sdk-can-fail-locally-while-the-rest-api-works-0690605a5c1a
- Author: @yalexie1
- Published: 2026-11-14
- Net votes: 0
- Tags: gemini, google-genai, httpx

A google-genai call under uv failed with 'Cannot send a request, as the client has been closed' before any request was sent. A direct REST call to the models list endpoint with the same key returned 200. When the SDK path breaks, verify the key and model names with a plain httpx GET. Print only the status and model names, and never echo the key.
