# Dart Client for Genkit

DevFeed: [Dart Client for Genkit](<https://devfeed.tech/articles/dart-client-for-genkit-23886.md>)

Original publisher: [Read original article](<https://medium.com/firebase-developers/dart-client-for-genkit-call-genkit-flows-from-flutter-dart-b5a2c9b9400e?source=rss----8e8b7dc6774d---4>)

Author: Nozomi Koborinai

Published: 2025-10-23T10:49:27Z

Content type: tutorial

Language: en

Sources: [Firebase Developers - Medium](<https://devfeed.tech/sources/firebase-developers-medium.md>)

Topics: [Genkit](<https://devfeed.tech/topics/genkit.md>), [Dart](<https://devfeed.tech/topics/dart.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Flutter](<https://devfeed.tech/topics/flutter.md>), [AI Development](<https://devfeed.tech/topics/ai-development.md>), [Cloud Functions](<https://devfeed.tech/topics/cloud-functions.md>), [Cloud Run](<https://devfeed.tech/topics/cloud-run.md>)

Tags: [ai-development](<https://devfeed.tech/tags/ai-development.md>), [apis](<https://devfeed.tech/tags/apis.md>), [client-library](<https://devfeed.tech/tags/client-library.md>), [dart](<https://devfeed.tech/tags/dart.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [genkit](<https://devfeed.tech/tags/genkit.md>), [google-cloud-platform](<https://devfeed.tech/tags/google-cloud-platform.md>), [http](<https://devfeed.tech/tags/http.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [server-sent-events-sse](<https://devfeed.tech/tags/server-sent-events-sse.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

## AI overview

This article introduces a Dart client library for calling Genkit flows deployed on a server from Flutter or other Dart applications. It explains that the library handles Genkit request and response conventions, reduces repeated HTTP client code, supports authentication mechanisms, and simplifies streaming responses through Server-Sent Events. The client can call flows implemented with Genkit JS, TypeScript, or Go when their server endpoints are accessible.

## Source excerpt

Introducing the Dart Client for GenkitCalling Genkit Flows from Flutter/DartDart client for Genkit I'm a big fan of Firebase and often choose Flutter as my front-end framework. Since Google I/O 2024, I've been continuously exploring Genkit. Developed by the Firebase team, Genkit is an open-source framework from Google that simplifies the definition of AI-powered processing sequences on the server-side as Flows. Genkit | Open-source AI development framework by Google However, calling a server-defined flow from a Dart/Flutter client application required some extra effort. To bridge this gap, I developed the Dart client for Genkit package. genkit | Dart package Note: This library is not for defining Genkit flows themselves. It is specifically designed for easily and securely calling flows deployed on a server from a Dart client.Library overview As mentioned above, this library is a dedicated client for easily calling Genkit flows deployed on a server (e.g., as Web APIs on platforms like Cloud Functions for Firebase, Cloud Run, or GKE). It is not for implementing Genkit flows in Dart. The challenges before Previously, calling a Genkit flow from Dart/Flutter required manually implementing an HTTP client according to a set of conventions. For example, here's a typical piece of code using the dio package to call an image generation flow defined in Genkit. Future<String> generateImage({required String imageDescription}) async { try { final response = await dio.post( 'https://<YOUR_GENKIT_ENDPOINT>/generateImage', data: { 'data': { 'imageDescription': imageDescription, }, }, ); if (response.statusCode == 200) { return response.data['result']['url'] as String; } throw Exception('Failed to generate image: ${response.statusCode}'); } on DioException catch (e) { throw Exception('Failed to generate image: ${e.message}'); } } This code presents several challenges: When sending a request, the input must be wrapped in {'data': ...}, and when receiving a response, the result must be ex