Home / Blog / How to install Announcing the Google Gen AI SDK for Kotlin…
How-To

How to install Announcing the Google Gen AI SDK for Kotlin 1.0

Integrating modern generative AI capabilities into Kotlin applications shouldn't require juggling raw HTTP clients or bridging disparate Java libraries.

By Dillip Chowdary • Sep 03, 2026 • Source: Google Cloud Blog

At a glance

Product
Google Gen AI SDK for Kotlin (google-genai-kotlin)
Version
1.0.0 (com.google.genai:google-genai-kotlin:1.0.0)
Platforms
JVM and Android (Kotlin Multiplatform)
Backends
Gemini Developer API and Gemini Enterprise Agent Platform
Auth
GEMINI_API_KEY or GOOGLE_API_KEY; ADC for enterprise

01What happened

The announcement is on the Google Cloud Blog. I’ll read that post and the official SDK docs so the install steps stay factual.Integrating modern generative AI capabilities into Kotlin applications should not require juggling raw HTTP clients or bridging disparate Java libraries. Google Cloud announced the 1.0 release of the Google Gen AI SDK for Kotlin, published as google-genai-kotlin, so Kotlin teams can call Gemini through one idiomatic multiplatform library instead of that extra glue.

The SDK is a Kotlin Multiplatform library for the JVM and Android. One Client talks to the Gemini Developer API on Google AI Studio and to the Gemini Enterprise Agent Platform on Google Cloud, with only configuration changes between those backends. The rest of this guide covers the 1.0 surface, the builder workflow, install and upgrade steps, compatibility traps, and the checks to run after you add the coordinate.

JVM targets include backend services, serverless functions, and desktop. Android is a supported target from the same published coordinate. Switching between the Gemini Developer API and the Gemini Enterprise Agent Platform is a configuration change, not a second library.

JVM targets include backend services, serverless functions, and desktop. Android is a supported target from the same published coordinate. Switching between the Gemini Developer API and the Gemini Enterprise Agent Platform is a configuration change, not a second library.

02How it works

The Client class is the entry point. It manages HTTP connections and authentication from the environment, reading GEMINI_API_KEY or GOOGLE_API_KEY for Google AI Studio, or GOOGLE_GENAI_USE_ENTERPRISE set to true with standard Google Cloud Application Default Credentials for enterprise.

Unary generateContent, generateContentStream as a cold Flow of GenerateContentResponse, a chats service that keeps history and formats turns, multimodal Content with Google Search grounding, image generation and conversational image editing on the Gemini 3 image family, Gemini Live over client.live.connect, FunctionDeclaration tools, and Automatic Function Calling on chat all ship in this 1.0 drop. Source, runnable samples, and discussion live in the googleapis/kotlin-genai repository on GitHub.

Kotlin call sites no longer need a raw HTTP client or a Java library bridge. You construct Client, then call client.models.generateContent with a model name and text, or generateContentStream when you want token chunks as a Flow. The chats service replaces hand-maintained conversation arrays: create a session, call sendMessage, and the next turn includes prior context. sendMessageStream covers streaming chat.

03Why it matters

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

Moving from Google AI Studio to the Gemini Enterprise Agent Platform is an environment and Client configuration change, not a second dependency. Backend stacks named in the announcement include Ktor, Spring Boot, Quarkus, and Micronaut, sharing the same coordinate with Android and with Kotlin Multiplatform commonMain.

Tool use moved from manual JSON wiring to FunctionDeclaration plus Schema, and chat can take AutomaticFunctionCalling so the SDK invokes your function and continues the turn. Image work uses generateContent on gemini-3.1-flash-image or gemini-3-pro-image, with bytes delivered as a Blob part rather than through a separate download API.

Confirm Maven Central is in your repositories. For a Kotlin Multiplatform app, open build.gradle.kts and add implementation of com.google.genai:google-genai-kotlin:1.0.0 inside kotlin sourceSets commonMain.dependencies so shared code can import the SDK.

For a single-platform JVM or Android Kotlin project, add the same implementation line to the top-level dependencies block. Gradle Module Metadata then selects the JVM or Android variant.

Open a Client with the use extension so the network engine and HTTP connections are released. For the Gemini Developer API, export GEMINI_API_KEY or GOOGLE_API_KEY before process start. For enterprise, set GOOGLE_GENAI_USE_ENTERPRISE to true and use Application Default Credentials.

Open a Client with the use extension so the network engine and HTTP connections are released. For the Gemini Developer API, export GEMINI_API_KEY or GOOGLE_API_KEY before process start. For enterprise, set GOOGLE_GENAI_USE_ENTERPRISE to true and use Application Default Credentials.

04Who is affected

For a streaming check, call generateContentStream with the same model and collect the Flow, printing each chunk.text when it is present. For chat, call client.chats.create with that model and an optional GenerateContentConfig that sets a systemInstruction Content, then sendMessage for the first turn and sendMessage again for the follow-up so history is attached automatically. After the dependency change, recompile, run that smoke test on the JVM, and if you share KMP code, run the same Client calls from commonMain against an Android or JVM test target.

For a streaming check, call generateContentStream with the same model and collect the Flow, printing each chunk.text when it is present. For chat, call client.chats.create with that model and an optional GenerateContentConfig that sets a systemInstruction Content, then sendMessage for the first turn and sendMessage again for the follow-up so history is attached automatically. After the dependency change, recompile, run that smoke test on the JVM, and if you share KMP code, run the same Client calls from commonMain against an Android or JVM test target.

Gotchas and compatibility generateContentStream is a cold Flow, so it does nothing until you collect it. Always close Client through use.

Chat history is owned by the session, and a config passed on create applies across turns. Google Search grounding is enabled by putting a Tool with googleSearch in GenerateContentConfig.tools, then reading groundingMetadata for webSearchQueries and groundingChunks.

Image output is inline Blob data on response.parts, which you write to disk yourself. Live requires a persistent WebSocket via client.live.connect.

The announcement uses gemini-live-2.5-flash-native-audio when client.enterprise is true and gemini-3.1-flash-live-preview otherwise. FunctionDeclaration calls appear on response.functionCalls unless Automatic Function Calling is enabled on the chat session.

05What to watch next

Auth is environment-driven. Do not assume a second Kotlin wrapper is required for JVM versus Android when you use the unsuffixed google-genai-kotlin coordinate with Gradle.

Model names in the announcement include gemini-flash-latest for text, gemini-3.1-flash-image and gemini-3-pro-image for images, and the Live model pair above. Pin the documented 1.0.0 coordinate.

The SDK does not remove the choice between the Developer API and Enterprise. It only unifies the client.

Follow the googleapis/kotlin-genai GitHub repository for source and discussions, and work through the Kotlin Gen AI sample suite under examples in that repo. File issues, feature requests, and pull requests there.

After install, watch Client lifecycle in long-running Ktor, Spring Boot, Quarkus, or Micronaut services, Flow collection in UI code, and credential handling when you toggle GOOGLE_GENAI_USE_ENTERPRISE. Use the samples to verify chat, grounding, image parts, Live connect, and automatic function calling against the same 1.0 Client you just added.

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →