Jump to Content
Developers & Practitioners

Introducing Google Gen AI .NET SDK

October 23, 2025
https://storage.googleapis.com/gweb-cloudblog-publish/images/image.max-2500x2500.jpg
Mete Atamel

Cloud Developer Advocate

Last year, we announced the Google Gen AI SDK as the new unified library for Gemini on Google AI (via the Gemini Developer API) and Vertex AI (via the Vertex AI API). At the time, it was only a Python SDK. Since then, the team has been busy adding support for Go, Node.js, and Java but my favorite language, C#, was missing until now. 

Today, I’m happy to announce that we now have a Google Gen AI .NET SDK! This SDK enables C#/.NET developers use Gemini from Google AI or Vertex AI with a single unified library.

Let’s take a look at the details. 

Installation

To install the library, run the following command in your .NET project directory:

Loading...

Import it to your code as follows:

Loading...

Create a client

First, you need to create a client to talk to Gemini. 

You can target Gemini on Google AI (via the Gemini Developer API):

Loading...

Or you can target Gemini on Vertex AI (via the Vertex AI API):

Loading...

Generate text

Once you have the client, you can generate text with a unary response:

Loading...

You can also generate text with a streaming response:

Loading...

Generate image

Generating images is also straightforward with the new library:

Loading...

https://storage.googleapis.com/gweb-cloudblog-publish/images/skateboard.max-1100x1100.png

Configuration

Of course, all of the text and image generation is highly configurable. 

For example, you can define a response schema and a generation configuration with system instructions and other settings for text generation as follows:

Loading...

Similarly, you can specify image generation configuration:

Loading...

Conclusion

In this blog post, we introduced the Google Gen AI .NET SDK as the new unified SDK to talk to Gemini.

Here are some links to learn more:

Posted in