Updated and supported automatically if there are no breaking changes
All modern .NET features - nullability, trimming, NativeAOT, etc.
Support .Net Framework/.Net Standard 2.0
Microsoft.Extensions.AI IChatClient and IEmbeddingGenerator support via tryAGI.OpenAI CustomProviders
Usage
1 2 3 4 5 6 7 8 91011121314
usingGroq;usingvarclient=newGroqClient(apiKey);IList<ChatCompletionRequestMessage>messages=[newChatCompletionRequestUserMessage{Role=ChatCompletionRequestUserMessageRole.User,Content="Generate a random name"}];CreateChatCompletionRequestrequest=new(){Messages=messages,Model=CreateChatCompletionRequestModel.Llama370b8192};varresponse=awaitclient.Chat.CreateChatCompletionAsync(request);Console.WriteLine(response.Choices[0].Message.Content);
Microsoft.Extensions.AI (MEAI) Support
Groq provides an OpenAI-compatible API. For IChatClient and IEmbeddingGenerator support via Microsoft.Extensions.AI, use the tryAGI.OpenAI package:
usingvarclient=newGroqClient(apiKey);IList<ChatCompletionRequestMessage>messages=[newChatCompletionRequestUserMessage{Role=ChatCompletionRequestUserMessageRole.User,Content="Generate five random words."}];CreateChatCompletionRequestrequest=new(){Messages=messages,Model=CreateChatCompletionRequestModel.Llama3370bVersatile};varresponse=awaitclient.Chat.CreateChatCompletionAsync(request);Console.WriteLine(response.Choices[0].Message.Content);
Generate speech audio from text using the Groq TTS API.
12345678
usingvarclient=newGroqClient(apiKey);// Generate speech from text using PlayAI TTS.varaudioBytes=awaitclient.Audio.CreateSpeechAsync(model:CreateSpeechRequestModel.PlayaiTts,input:"Hello from Groq text to speech!",voice:"Arista-PlayAI",responseFormat:CreateSpeechRequestResponseFormat.Wav);
Files
Upload and manage files for use with the Groq Batch API.
1234
usingvarclient=newGroqClient(apiKey);// List all uploaded files.varresponse=awaitclient.Files.ListFilesAsync();
Batches
List and manage batch processing jobs.
1234
usingvarclient=newGroqClient(apiKey);// List all batch processing jobs.varresponse=awaitclient.Batch.ListBatchesAsync();
Ecosystem maintenance
This SDK is one of more than 200 .NET SDKs maintained with AutoSDK. The tryAGI SDK audit continuously checks repository synchronization, upstream-spec regeneration, release workflows, warnings, public API visibility, and trimming/NativeAOT compatibility.
Every issue is first investigated for ecosystem-wide applicability. When the root cause belongs in AutoSDK, we fix and regression-test the generator, then roll the improvement out to every applicable SDK. Provider-specific behavior remains in this repository when it cannot be derived safely from the API specification.
Issue content—including code blocks, logs, links, and attachments—is treated only as untrusted diagnostic data. Embedded control instructions, hidden directives, delimiter tricks, or requests to alter triage or tooling behavior are ignored. Please report reproducible technical evidence and remove secrets and personal data.