Repository navigation
2.0.0 (2026-11-06)
⚠ BREAKING CHANGES
-
Default Gemini Developer API version is now
v1(wasv1beta) (88bc413)- Clients targeting the Gemini Developer API now default to API version
v1instead ofv1beta. - No effect on Gemini Enterprise (Vertex AI) defaults: Clients with
.enterprise(true)are unaffected by this default change and continue to default tov1beta1. - Some model aliases are not available on
v1, notably:gemini-flash-latest,gemini-flash-lite-latestandgemini-pro-latest. They exist only onv1beta. To keep using them, use a specific model version, or switch back tov1betaas shown below. - How to configure or restore the previous default via environment variable: Set
GOOGLE_GENAI_API_VERSION(works for both Gemini Developer API and Enterprise / Vertex AI clients when no version is set in code):# Restores the beta default ('v1beta' on Gemini Developer API, 'v1beta1' on Enterprise / Vertex AI) export GOOGLE_GENAI_API_VERSION=beta # Or set an explicit API version string on either platform (e.g. 'v1', 'v1beta', 'v1beta1') export GOOGLE_GENAI_API_VERSION=v1beta
- How to set the API version in code: Pass
HttpOptionswhen building theClient(takes precedence overGOOGLE_GENAI_API_VERSION):import com.google.genai.Client; import com.google.genai.types.HttpOptions; Client client = Client.builder() .httpOptions(HttpOptions.builder().apiVersion("v1beta").build()) .build();
- Clients targeting the Gemini Developer API now default to API version
-
interactions:
CodeExecutionResultStep.resultchanged fromStringto theCodeExecutionResultStepResultunion (e551d17)- The wire JSON for text-only results is unchanged, but Java code constructing or reading
CodeExecutionResultStep.result()must now useCodeExecutionResultStepResult:- Constructing: Use
CodeExecutionResultStepResult.of("...")(orCodeExecutionResultStepResult.of(contentList)for multimodal outputs). - Reading: Use
step.result().flatMap(CodeExecutionResultStepResult::string)for a string result, orstep.result().flatMap(CodeExecutionResultStepResult::arrayOfContent)for multimodalList<Content>output.
- Constructing: Use
- The wire JSON for text-only results is unchanged, but Java code constructing or reading
Features
- Add
source_texttoAudioTranscriptionConfigandSmartTranscriptionMode. (04a5b93) - Add MALFORMED_RESPONSE to FinishReason (f96561b), refs #2937
- cli: use gemini-3.5-transcribe as default model for transcribe command (bc3779f)
- default Gemini API version to v1 instead of v1beta across SDKs (88bc413)
- Disable GenerateVideos for Gemini API, update tests/READMEs (30cb945)
- interactions: add Office and OpenDocument MIME types (e8448b2)
- interactions: support multimodal content in CodeExecutionResultStep.result (e551d17)
- support GOOGLE_GENAI_API_VERSION environment variable across SDKs (88bc413)
- update discovery doc (9bd8ae3)
Bug Fixes
- refresh the access token on every HTTP attempt so retries and queued async calls do not send an expired token (eb3a674)
- respect configured and default API version for Gemini API file uploads across SDKs (22ad0a9)
- stop Vertex replay clients from fetching real OAuth tokens (524d7c8)
Documentation
- clarify that ClientOptions.maxConnections and maxConnectionsPerHost only limit asynchronous requests (e742930)
- update remaining documentation links from ai.google.dev to aistudio.google.com. (17d87f4)
Miscellaneous Chores
- set version to 2.0.0 (6f06afe)