<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu" -->

---
title: Using the new Google Gen AI SDK for Kotlin | daily.dev
description: Google released version 1.0 of the Gen AI SDK for Kotlin, an idiomatic coroutine and Flow based client for the Gemini APIs, replacing the previous options of...
canonical: https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Using the new Google Gen AI SDK for Kotlin | daily.dev
og:description: Google released version 1.0 of the Gen AI SDK for Kotlin, an idiomatic coroutine and Flow based client for the Gemini APIs, replacing the previous options of...
og:url: https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu
og:image: https://api.daily.dev/og/posts/TZotBUJUu.png
og:image:alt: Using the new Google Gen AI SDK for Kotlin
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the new Google Gen AI SDK for Kotlin

**[John O'Reilly](https://daily.dev/sources/johnoreilly)** · 4 min read · 2 upvotes · 0 comments

## Summary

Google released version 1.0 of the Gen AI SDK for Kotlin, an idiomatic coroutine and Flow based client for the Gemini APIs, replacing the previous options of Firebase SDKs, community wrappers, agent frameworks like Koog, or hand-rolled REST calls. The post walks through swapping this SDK into a real command line tool from the FormAI project that generates coaching feedback from golf/basketball video clips and extracts structured JSON timestamps for keyframes. Adopting the SDK removed a hand-written DTO layer (63 lines), manual base64 encoding, and manual URL building, shrinking the main file from 315 to 294 lines while preserving behavior. It also covers other SDK features: streaming responses via Flow, multi-turn chat sessions, and automatic function calling.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://johnoreilly.dev/posts/genai-kotlin-sdk>

## Questions this post answers

### What does Google's new Gen AI SDK for Kotlin version 1.0 replace when calling the Gemini API from Kotlin?

It replaces hand-rolled REST calls, Firebase SDKs, community wrappers, or agent frameworks like Koog as the way to call Gemini from Kotlin. Built around coroutines and Flow, it is Google's own idiomatic Kotlin client, exposing a Client entry point, Blob for automatic base64 encoding of media, and Schema-based structured output support.

_Developers weighing Gemini client options in Kotlin can follow SDK migrations like this one on daily.dev._

### How much code does migrating from a hand-rolled Gemini REST integration to the Gen AI SDK for Kotlin save?

In one real migration, 63 lines of hand-written serializable DTOs were removed entirely, along with manual base64 encoding and URL building code. The main file dropped from 315 lines to 294 lines while producing identical output, since the SDK's Client, Blob, and GenerateContentConfig types absorb work previously done by hand.

_Teams estimating refactor effort for Gemini integrations can compare real migration outcomes on daily.dev._

### How do I get structured JSON output like timestamps from the Gemini API using the Kotlin Gen AI SDK?

Pass a Schema built from nested data classes and the Type enum into GenerateContentConfig when calling generateContent, so the model returns JSON matching that schema instead of free text. The response still arrives as a JSON string that must be deserialized manually into your own data class, such as a custom KeyframeTimestamps type.

_Developers implementing structured Gemini responses can track SDK patterns like this on daily.dev._

## Similar posts on daily.dev

- [How to Build AI-Powered Flutter Applications with Genkit Dart – Full Handbook for Devs](https://daily.dev/posts/how-to-build-ai-powered-flutter-applications-with-genkit-dart-full-handbook-for-devs-tmbbefsjr) · freeCodeCamp · 0 upvotes · 0 comments
- [Firebase \+ Genkit: How I Actually Brought AI Into My Mobile App \(Without Losing My Mind\)](https://daily.dev/posts/firebase-genkit-how-i-actually-brought-ai-into-my-mobile-app-without-losing-my-mind--ta6av8kvz) · Medium · 0 upvotes · 0 comments
- [Introduction to Google GenAI Chat and Spring AI](https://daily.dev/posts/introduction-to-google-genai-chat-and-spring-ai-h3wj5zlvx) · Baeldung · 1 upvotes · 0 comments

---

Tags: [#kotlin](https://daily.dev/tags/kotlin), [#llm](https://daily.dev/tags/llm)

[View this post on daily.dev](https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Using the new Google Gen AI SDK for Kotlin","url":"https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu"},"datePublished":"2026-09-05T17:08:22.796Z","dateModified":"2026-10-15T02:22:26.025Z","description":"Google released version 1.0 of the Gen AI SDK for Kotlin, an idiomatic coroutine and Flow based client for the Gemini APIs, replacing the previous options of...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/72622b3dfab58a6a03730bce0a36007c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/72622b3dfab58a6a03730bce0a36007c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"John O'Reilly","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"John O'Reilly","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/johnoreilly"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"kotlin,llm","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"John O'Reilly","item":"https://daily.dev/sources/johnoreilly"},{"@type":"ListItem","position":3,"name":"Using the new Google Gen AI SDK for Kotlin"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/using-the-new-google-gen-ai-sdk-for-kotlin-tzotbujuu#faq","mainEntity":[{"@type":"Question","name":"What does Google's new Gen AI SDK for Kotlin version 1.0 replace when calling the Gemini API from Kotlin?","acceptedAnswer":{"@type":"Answer","text":"It replaces hand-rolled REST calls, Firebase SDKs, community wrappers, or agent frameworks like Koog as the way to call Gemini from Kotlin. Built around coroutines and Flow, it is Google's own idiomatic Kotlin client, exposing a Client entry point, Blob for automatic base64 encoding of media, and Schema-based structured output support. Developers weighing Gemini client options in Kotlin can follow SDK migrations like this one on daily.dev."}},{"@type":"Question","name":"How much code does migrating from a hand-rolled Gemini REST integration to the Gen AI SDK for Kotlin save?","acceptedAnswer":{"@type":"Answer","text":"In one real migration, 63 lines of hand-written serializable DTOs were removed entirely, along with manual base64 encoding and URL building code. The main file dropped from 315 lines to 294 lines while producing identical output, since the SDK's Client, Blob, and GenerateContentConfig types absorb work previously done by hand. Teams estimating refactor effort for Gemini integrations can compare real migration outcomes on daily.dev."}},{"@type":"Question","name":"How do I get structured JSON output like timestamps from the Gemini API using the Kotlin Gen AI SDK?","acceptedAnswer":{"@type":"Answer","text":"Pass a Schema built from nested data classes and the Type enum into GenerateContentConfig when calling generateContent, so the model returns JSON matching that schema instead of free text. The response still arrives as a JSON string that must be deserialized manually into your own data class, such as a custom KeyframeTimestamps type. Developers implementing structured Gemini responses can track SDK patterns like this on daily.dev."}}]}
```

