Skip to main content
net8.0.NETStandard2.0.NETStandard2.1

This unofficial (RestEase based) client enables working with the Google Gemini REST Interface (https://ai.google.dev/gemini-api/docs)

Published
Jun 26, 2025
1y ago
Total Downloads
819
819

Install

dotnet add package Google-GenAI.SDK --version 0.0.1-preview-01
ProductVersions
.NET
net8.0
.NET Standard
netstandard2.0netstandard2.1

README

Google GenAI .NET SDK

Unofficial RestEase C# Client for Google Gemini.

Register

var configuration = new ConfigurationBuilder()
    .SetBasePath(Directory.GetCurrentDirectory())
    .AddJsonFile("appsettings.json")
    .AddJsonFile("appsettings.Development.json", optional: true)
    .Build();

services.AddGoogleGeminiSDK(configuration);

var serviceProvider = services.BuildServiceProvider();

Example

var api = serviceProvider.GetRequiredService<IGoogleGeminiApi>();

var result = await api.GenerateContentAsync("gemini-2.0-flash", new GeminiRequest
{
    Contents =
    [
        new Content
        {
            Parts =
            [
                new Part
                {
                    Text = "Explain how AI works in a few words"
                }
            ]
        }
    ]
}, cancellationToken); 

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.