YOUR FIRST AI FEATURE

Build your first .NET AI agent.

Build an AI agent in C# with Runiq.Net. Create a new ASP.NET Core application or use an existing project, connect a model, and try your first conversation in Studio.

.NET 10 SDKC# / ASP.NET CoreA model provider for AI responses

Where are you starting?

Let the CLI create the project structure and wire up Runiq for you.

01 Create your project

Install the CLI, then start the setup wizard.

.NET CLI
dotnet tool install --global Runiq.AI.Cli --version 1.0.0
runiq init MyRuniqApp

Choose your provider and enable starter sample code and Dashboard. The wizard can store your provider key in .NET user secrets; you can also configure it later.

You get a solution with an API project at src/MyRuniqApp.Api, ready for your application code.

02 Run the application

Start the generated API project from your new solution directory.

.NET CLI
cd MyRuniqApp
dotnet run --project src/MyRuniqApp.Api

The terminal prints your local application address. Keep it running for the next step.

03 Try your first conversation

Open /dashboard on the local address printed in your terminal. Choose a generated agent in the Playground and send a request that matches its instructions.

Configure your selected model provider before requesting an AI response. See model and provider setup if you skipped this in the wizard.

CLI setup walkthrough

Keep your ASP.NET Core project and add a small first agent alongside your services.

01 Add Runiq to your project

Run these commands in your .NET 10 web project directory. This example uses OpenAI; replace the placeholder with your own key.

.NET CLI
dotnet add package Runiq.AI.Agents --version 1.0.0
dotnet user-secrets init
dotnet user-secrets set "OpenAI:ApiKey" "YOUR_API_KEY"

02 Register an agent and Studio

Merge this setup into Program.cs: register Runiq before builder.Build() and configure the dashboard before app.Run(). Keep your existing services and endpoints.

Program.cs
using Runiq.AI.Agents;
using Runiq.AI.Core;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRuniqServer(options =>
{
    options.AddAgent(new Agent(
        id: "hello-agent",
        name: "Hello Agent",
        instructions: "Help users with concise, practical answers.",
        model: "openai/gpt-5",
        apiKey: builder.Configuration["OpenAI:ApiKey"]));
});

var app = builder.Build();

app.UseRuniqDashboard(options =>
{
    options.Path = "/dashboard";
    options.Authentication(auth =>
    {
        if (app.Environment.IsDevelopment()) auth.AllowAnonymous();
        else auth.RequireAuthenticatedUser();
    });
});

app.Run();

Anonymous Studio access is limited to Development. For other environments, connect your application's authentication using the Studio authentication guide.

03 Run and open Studio

Start your project with its Development launch profile so it loads the user secret you configured.

.NET CLI
dotnet run

Open /dashboard on the local address printed in the terminal. Select Hello Agent in the Playground and send your first message.

YOUR FIRST CHECKPOINT

An application you can build on.

Once your agent responds in Studio, your first model connection is working. Next, give your application the capabilities it needs.