The Google GenAI SDK 3.0 upgrade changes one thing that breaks working code without warning: Gemini Developer API clients now call the v1 API instead of v1beta. If you use gemini-flash-latest, a -preview model, the Live API or context caching, pin api_version="v1beta" (or set GOOGLE_GENAI_API_VERSION=v1beta) before you bump the package. Python users also lose httpx as the default HTTP client, and JavaScript users need Node.js 22 or newer.
This guide covers google-genai 3.0.0 for Python (released 2026-11-05) and @google/genai 3.0.0 for JavaScript (released 2026-11-06). Both packages had reached 3.6.1 by 2026-11-18. Every fact below comes from the official GitHub release notes, checked on November 22, 2026. The commands are standard pip, npm and grep calls. I have not run them against your project, so read each output with the decision table below.
What changed in Google GenAI SDK 3.0
| Change | Python google-genai | JS @google/genai | Who breaks |
|---|---|---|---|
Default API version v1beta → v1 | Yes | Yes | Aliases, previews, Live, caches |
httpx → httpx2 default client | Yes | — | Code that passes or catches httpx objects |
| Minimum Node.js 22 | — | Yes | Node 20 runtimes |
CodeExecutionResultStep.result is a union | Yes | Yes | Interactions API code reading it as a string |
Two details matter more than the headline.
- Vertex AI is not affected by the default change. Clients created with
vertexai=True(orenterprise=Truein Python) still default tov1beta1. - Some things exist only on
v1beta. The release notes name thegemini-flash-latest,gemini-flash-lite-latestandgemini-pro-latestaliases and "some-previewmodels". They also state that the Live API and context caching (caches) are not available onv1.
The 3.0.0 notes also list "Disable GenerateVideos for Gemini API". If you call generate_videos through the Developer API client, test that path before you upgrade.
Check your environment before the upgrade
1. Which SDK version do you have?
Python:
pip show google-genai | grep -i '^version'
python -c "import importlib.metadata as m; print(m.version('google-genai'))"JavaScript:
npm ls @google/genai
node -vHow to read the output:
2.x: nothing has changed yet, but a loose range likegoogle-genai>=2or"@google/genai": "*"will pull 3.x on the next install.3.x: thev1default is already active unless you set a version in code or in the environment.node -vprintsv20.x:@google/genai3.x declaresengines.node >=22.0.0.
Check your lock file too. Dependabot and Renovate opened bump PRs from 2.x to 3.0.0 in many public repositories in early November.
2. Do you use a model that only exists on v1beta?
grep -rnE "gemini-(flash|flash-lite|pro)-latest|-preview" \
--include=*.py --include=*.ts --include=*.js --include=*.env --include=*.yaml .Any match means you need either v1beta or a stable model ID. Not every -preview model is missing from v1; the release notes say "some". Test each one rather than assuming.
3. Do you use the Live API or context caching?
grep -rnE "\.live\.|\.caches\." --include=*.py --include=*.ts --include=*.js .Python calls look like client.aio.live.connect(...) and client.caches.create(...). JavaScript calls look like ai.live.connect(...) and ai.caches.create(...). Any match needs v1beta on that client.
4. Python only: do you touch httpx directly?
grep -rnE "import httpx|from httpx|httpx\." --include=*.py .Matches in code that builds HttpOptions(client_args=...), passes httpx_client=..., or catches httpx.TimeoutException need attention in step 4 below.
Decision table: upgrade now, pin first, or wait
| Your setup | Action | When |
|---|---|---|
| Vertex AI client only, Node 22+, no httpx objects | Upgrade | Now |
| Developer API, stable model IDs, no Live or caches | Upgrade, then run one test call | Now |
Uses *-latest aliases or preview models | Pin v1beta or switch model IDs, then upgrade | This week |
Uses Live API or caches | Pin v1beta on that client, then upgrade | This week |
| Python code passes or catches httpx objects | Choose httpx2 or keep httpx (step 4) | Before upgrade |
| Node.js 20 runtime | Stay on @google/genai@^2 until Node 22 | Wait |
View PlantUML source
@startuml
skinparam defaultFontSize 14
start
if (Vertex AI client?) then (yes)
:default stays v1beta1;
stop
else (no)
endif
if (Live API or caches?) then (yes)
:pin v1beta;
stop
else (no)
endif
if (*-latest alias or preview model?) then (yes)
if (stable model ID OK?) then (yes)
:switch model, keep v1;
else (no)
:pin v1beta;
endif
else (no)
:keep default v1;
endif
stop
@endumlPin the API version before upgrading google-genai
Set the version explicitly first. Then the package bump changes nothing about which endpoint you call.
Option A: in code (recommended)
Python:
from google import genai
from google.genai import types
client = genai.Client(
api_key="<YOUR_GEMINI_API_KEY>",
http_options=types.HttpOptions(api_version="v1beta"),
)JavaScript / TypeScript:
import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({
apiKey: '<YOUR_GEMINI_API_KEY>',
apiVersion: 'v1beta',
});The JS release notes say you can pass apiVersion or httpOptions.apiVersion. A value set in code takes precedence over the environment variable.
Option B: environment variable
Use this when you cannot touch the code, such as a third-party tool or a container you only configure:
export GOOGLE_GENAI_API_VERSION=v1betaOr use beta, which means v1beta on the Developer API and v1beta1 on Vertex AI:
export GOOGLE_GENAI_API_VERSION=betaIn Docker Compose, put it under environment:. In GitHub Actions, put it under env: at the job level. The variable is read only when no version is set in code.
A good split: keep a v1 client for plain text generation and a second client pinned to v1beta for Live and caching. That way you only depend on the beta surface where you need it.
Then upgrade the package
Python (pip, uv, Poetry):
pip install -U "google-genai>=3,<4"
uv add "google-genai>=3,<4"
poetry add "google-genai@^3"JavaScript:
npm install @google/genai@^3
pnpm add @google/genai@^3Confirm the result:
pip show google-genai | grep -i '^version' # expect 3.x
npm ls @google/genai # expect 3.xThen make one real request with each client you configured: a short generate_content call, plus a Live connect or cache create if you use them. A green unit test suite with a mocked client will not catch the v1 change.
The Python SDK's 2.34.0 release (2026-10-29) already dropped Python 3.10. If you skipped that release, check your interpreter version too.
Python: move from httpx to httpx2
In 3.0, httpx2 is the required dependency and the default HTTP client, and httpx is no longer installed by default. If you only call client.models.generate_content(...), you probably do not need to change anything. If you pass HTTP objects into the SDK, pick one of these paths.
Path 1: move to httpx2. The release notes say updating imports is usually enough:
import httpx2 as httpx # was: import httpxEverything you pass through HttpOptions(client_args=..., async_client_args=...) must come from the active client's package. That includes Timeout, Limits, transports such as MockTransport, custom Auth subclasses, and the exceptions you catch (TimeoutException, ConnectError, HTTPError).
Path 2: keep httpx. You need both lines:
pip install "google-genai[httpx]"
export GOOGLE_GENAI_HTTP_CLIENT=httpxThe extra alone only makes import httpx work. If GOOGLE_GENAI_HTTP_CLIENT is unset or auto and the extra is installed, passing httpx objects selects the httpx backend automatically. You can also hand the SDK your own clients:
import httpx
from google import genai
from google.genai import types
client = genai.Client(
http_options=types.HttpOptions(
httpx_client=httpx.Client(),
httpx_async_client=httpx.AsyncClient(),
)
)TLS changes with httpx2. httpx2 trusts the operating system certificate store instead of certifi, as long as SSL_CERT_FILE and SSL_CERT_DIR are unset. Behind a TLS-inspecting corporate proxy, this can fix errors you used to work around. On a slim container with no CA bundle, it can create new ones.
JavaScript: Node.js 22 and the Interactions result type
@google/genai 3.x requires Node.js 22 or newer, because Node 20 reached end of life on 2026-04-30. The runtime API and bundles did not change, and both CommonJS and ESM builds are still published. If you must stay on Node 20, pin @google/genai@^2. For the runtime move itself, see How to Upgrade to Node.js 26 LTS from Node 24. It targets a newer line, but the checklist (nvm, Docker base image, CI matrix) is the same.
In both SDKs, CodeExecutionResultStep.result in the Interactions API is now CodeExecutionResultStepResult, typed in TypeScript as Array<Content> | string. Text-only results are still plain strings, so this mostly breaks type checks:
const out = typeof step.result === 'string'
? step.result
: step.result.map(c => JSON.stringify(c)).join('\n');If you built on the Interactions API for world models, as in our Genie 4 API tutorial, run your type checker after the bump.
Troubleshooting after the upgrade
A model that worked yesterday now returns 404 / NOT_FOUND. The model is probably an alias or preview that exists only on v1beta. The error looks like a retired model, but the API version is the cause. Pin v1beta, or replace the alias with a stable model ID from the Gemini API models page. Model retirements are a separate issue; see our Gemini preview shutdown guide for how those look.
Live sessions or cached content fail. These are v1beta only on the Developer API. Pin v1beta on the client that uses them.
ModuleNotFoundError: No module named 'httpx'. Your code (or another library) imported httpx and relied on the SDK to install it. Add httpx to your own requirements, or switch to httpx2 imports.
Type or isinstance errors around timeouts and transports. You are mixing httpx.* objects with the httpx2 backend. Use one package everywhere (path 1 or path 2 above).
npm warn EBADENGINE or a failed install with engine-strict. You are on Node 20. Upgrade Node, or pin @google/genai@^2.
Roll back
pip install "google-genai<3" # Python
npm install @google/genai@^2 # JavaScriptCommit the lock file change, redeploy, and remove any GOOGLE_GENAI_HTTP_CLIENT value you added. The 2.x line accepts api_version in code, so a v1beta pin you added earlier is safe to keep.
FAQ
Does Google GenAI SDK 3.0 change anything on Vertex AI? Not the default API version. Vertex AI (and enterprise=True in Python) clients still default to v1beta1. The httpx2 change and the Node 22 requirement apply to every client, though.
Should I move everything to v1 or stay on v1beta? Use v1 where it serves your models and features. Pin v1beta only on clients that need aliases, certain previews, Live or caching. That keeps your dependence on the beta surface small and visible.
Is GOOGLE_GENAI_API_VERSION enough by itself? Yes, if no version is set in code. A value in HttpOptions(api_version=...) or apiVersion overrides it, so search your code for both before relying on the variable.
Which version should I install today? 3.6.1 was the latest Python and JavaScript release on 2026-11-18. The breaking changes all arrived in 3.0.0. Later 3.x releases added features such as the Decisions API (3.2.0) and experimental Live Interactions (3.5.0).
Do file uploads follow the pinned version? Yes. A 3.0.0 bug fix makes Gemini API file uploads respect the configured or default API version, so uploads and generation calls now use the same version.
References
- googleapis/python-genai v3.0.0 release notes — GitHub, checked 2026-11-22
- googleapis/js-genai v3.0.0 release notes — GitHub, checked 2026-11-22
- python-genai releases list (3.1.0 to 3.6.1) — GitHub, checked 2026-11-22
- js-genai releases list (3.1.0 to 3.6.1) — GitHub, checked 2026-11-22
- Gemini API models — Google AI for Developers, checked 2026-11-22
- Related on Mark-I: Gemini 4 Argon API: How to Migrate from Gemini 3.x
Written on November 22, 2026, from the release notes above. If you are moving to a new Gemini model at the same time, upgrade the SDK and pin the version first. Then change the model in a separate step, so each error has one cause.





