Shows how to use the Upstage Solar LLM for chat completions.
1 2 3 4 5 6 7 8 9101112131415161718192021222324
// Create an authenticated client using your Upstage API key.usingvarclient=newUpstageClient(apiKey);// Send a simple chat message to the Solar Mini model.// The `CreateChatCompletionAsync` method accepts a model name and a list of messages.varresponse=awaitclient.Chat.CreateChatCompletionAsync(model:"solar-mini",messages:[newChatMessage{Role=ChatMessageRole.System,Content="You are a helpful assistant.",},newChatMessage{Role=ChatMessageRole.User,Content="Hello! What is Upstage?",},]);// The response contains a unique ID, the model used, and a list of choices.// Each choice has a message with the assistant's reply.Console.WriteLine($"Response: {response.Choices[0].Message!.Content}");
Embeddings
Shows how to generate text embeddings using Upstage Solar Embedding models.
1 2 3 4 5 6 7 8 91011121314
// Create an authenticated client using your Upstage API key.usingvarclient=newUpstageClient(apiKey);// Generate an embedding for a text input using the Solar Embedding model.// The `input` parameter accepts a string or an array of strings.varresponse=awaitclient.Embeddings.CreateEmbeddingAsync(model:"solar-embedding-1-large",input:"Upstage is a leading AI company.");// The response contains a list of embedding data objects,// each with a vector of floating-point numbers.Console.WriteLine($"Model: {response.Model}");Console.WriteLine($"Embedding dimensions: {response.Data[0].Embedding!.Count}");
Groundedness Check
Shows how to verify whether an answer is grounded in a given context
using the Upstage Groundedness Check API.
1 2 3 4 5 6 7 8 910111213141516171819202122
// Create an authenticated client using your Upstage API key.usingvarclient=newUpstageClient(apiKey);// Define the context (source material) and an answer to verify.// The groundedness check determines whether the answer is supported by the context.varcontext="Upstage is a leading AI company based in South Korea. "+"They develop Solar LLM, a large language model optimized for "+"various natural language processing tasks.";varanswer="Upstage is a South Korean AI company that created Solar LLM.";// Call the `GroundednessCheckAsync` method with the context and answer.// You can optionally specify a model (default is "groundedness-check").varresponse=awaitclient.GroundednessCheck.GroundednessCheckAsync(context:context,answer:answer);// The response includes a boolean `Grounded` field, a confidence `Score`// between 0 and 1, and a `Reason` explaining the determination.Console.WriteLine($"Grounded: {response.Grounded}");Console.WriteLine($"Score: {response.Score}");Console.WriteLine($"Reason: {response.Reason}");
Translation
Shows how to translate text between languages using Upstage Solar Translation models.
1 2 3 4 5 6 7 8 9101112131415161718
// Create an authenticated client using your Upstage API key.usingvarclient=newUpstageClient(apiKey);// Translate English text to Korean using the Solar translation model.// The `TranslateAsync` method requires the model name, text, source language,// and target language.varresponse=awaitclient.Translation.TranslateAsync(model:"solar-1-mini-translate-enko",text:"Hello, how are you?",sourceLang:"en",targetLang:"ko");// The response contains the translated text along with the detected// source language and the target language.Console.WriteLine($"Translated text: {response.Output.Text}");Console.WriteLine($"Source language: {response.Output.SourceLang}");Console.WriteLine($"Target language: {response.Output.TargetLang}");
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.