varapiKey=Environment.GetEnvironmentVariable("EDENAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("EDENAI_API_KEY environment variable is not found.");usingvarclient=newEdenAIClient(apiKey);// Create tools for chat, translation, image generation, summarization,// sentiment analysis, and language detection.varchatTool=client.AsChatTool();vartranslateTool=client.AsTranslateTool();vargenerateImageTool=client.AsGenerateImageTool();varsummarizeTool=client.AsSummarizeTool();varsentimentTool=client.AsSentimentAnalysisTool();vardetectLanguageTool=client.AsDetectLanguageTool();// These tools can be passed to any IChatClient that supports function calling.vartools=new[]{chatTool,translateTool,generateImageTool,summarizeTool,sentimentTool,detectLanguageTool};
Chat
Shows how to send a chat message to an AI provider via EdenAI.
1 2 3 4 5 6 7 8 9101112
usingvarclient=newEdenAIClient(apiKey);// Send a chat message through the EdenAI unified API,// specifying one or more providers to route the request to.varresponse=awaitclient.Chat.TextTextChatCreateAsync(request:newTextchatChatRequest{Providers=["openai"],Text="What is the capital of France?",ChatbotGlobalAction="You are a helpful geography assistant.",MaxTokens=100,});
Translation
Shows how to translate text between languages via EdenAI.
1 2 3 4 5 6 7 8 9101112
usingvarclient=newEdenAIClient(apiKey);// Translate text using the EdenAI unified API.// Multiple providers are supported including Google, Amazon, Microsoft, and DeepL.varresponse=awaitclient.AutomaticTranslation.TranslationTranslationAutomaticTranslationCreateAsync(request:newTranslationautomaticTranslationAutomaticTranslationRequest{Providers=["google"],Text="Hello, how are you?",TargetLanguage="fr",});
Image Generation
Shows how to generate images from text descriptions via EdenAI.
1 2 3 4 5 6 7 8 9101112
usingvarclient=newEdenAIClient(apiKey);// Generate images from text descriptions using the EdenAI unified API.// Supported providers include OpenAI (DALL-E), Stability AI, and Amazon.varresponse=awaitclient.Generation.ImageImageGenerationCreateAsync(request:newImagegenerationGenerationRequest{Providers=["openai"],Text="A serene mountain landscape at sunset",Resolution="1024x1024",NumImages=1,});
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.