Repository navigation
Home
The unofficial .NET SDK for Google Gemini (Gemini API / Google AI Studio) and Vertex AI. It is a REST-based, NativeAOT-compatible client covering content generation, multimodal input, structured output, function calling, the Live API, the Interactions API, File Search, batch processing, tuning, RAG and more.
Version 4.0 brings parity with the latest Google APIs. Upgrading from 3.x? Start with the Migration Guide and the Release Notes.
| Package | Purpose |
|---|---|
Google_GenerativeAI |
Core SDK: models, clients and types for the Gemini API and Vertex AI. |
Google_GenerativeAI.Tools |
Function calling helpers, source-generated tools and MCP integration. |
Google_GenerativeAI.Auth |
OAuth, service account and Application Default Credentials authenticators. |
Google_GenerativeAI.Microsoft |
Microsoft.Extensions.AI implementations (IChatClient, embeddings, images). |
Google_GenerativeAI.Web |
Dependency injection and configuration for ASP.NET Core. |
Google_GenerativeAI.Live |
Real-time Multimodal Live API and Live Music over WebSockets. |
Supported frameworks: .NET 6, 7, 8, 9, 10 and 11, .NET Standard 2.0 and .NET Framework 4.6.2.
-
Initialization — create a
GoogleAiorVertexAIclient and a model. - Authentication — API keys, ADC, service accounts and OAuth.
- Generate Content — your first request, then Streaming and Chat Session.
- Supported Models — current model constants and their replacements for retired models.
| Area | Pages |
|---|---|
| Core | Generate Content · Chat Session · Streaming · Multimodal Features · JSON Mode · Function Calling · Embeddings · Context Caching |
| Gemini APIs | Interactions API · Multimodal Live API · File Search · Batch API · Model Tuning · Webhooks · Agent APIs · Image Generation · Video Generation · Speech Generation · Files Client · Model Client |
| Vertex AI | Vertex RAG Engine |
| Integrations | Microsoft.Extensions.AI · Model Context Protocol · ASP.NET Core / Web |
| Guides | Configuration & Error Handling · NativeAOT & Trimming · Migration Guide (v4) · Release Notes (v4) |
| Legacy | Semantic Retrieval (AQA) |
Runnable projects live in the repository's samples
folder: MCP integration, two-way audio (WPF, Live API), web application integration, Vertex RAG Q&A, semantic
retrieval and a JavaScript code-executor tool.
Issues and pull requests are welcome on GitHub. The SDK is released under the MIT License.
Getting Started
- Initialization
- Authentication
- Configuration & Error Handling
- Supported Models
- Migration Guide (v4)
- Release Notes (v4)
Core Features
- Generate Content
- Chat Session
- Streaming
- Multimodal Features
- JSON Mode
- Function Calling
- Embeddings
- Context Caching
Gemini APIs
- Interactions API
- Multimodal Live API
- File Search
- Batch API
- Model Tuning
- Webhooks
- Agent APIs
- Image Generation
- Video Generation
- Speech Generation
- Files Client
- Model Client
Vertex AI
Integrations
Guides
Legacy