> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage

> Run a minimal local agent loop on top of AI Stats Gateway with the C# Agent SDK.

## Install

```bash theme={null}
dotnet add package AI.Stats.Sdk
dotnet add package AI.Stats.AgentSdk
```

## Quickstart

```csharp theme={null}
using AiStatsAgentSdk;

var agent = AgentSdk.CreateAgent(new AgentDefinition
{
    Id = "quickstart-agent",
    Model = "openai/gpt-5.4-nano",
    Instructions = "Answer concisely and helpfully."
});

var result = await agent.Run(new RunOptions
{
    Input = "Give me one fun fact about cURL.",
    Client = AgentSdk.CreateGatewayAgentClient(),
});

Console.WriteLine(result.Output);
```

## What it ships

* `AgentSdk.CreateAgent(...)`
* `AgentSdk.DefineTool(...)`
* `AgentSdk.CreateGatewayAgentClient(...)`
* a bounded tool loop over the AI Stats `responses` API

## Related

* [Agent SDK overview](../agent-sdk/overview.mdx)
* [TypeScript Agent SDK](../typescript/agent-sdk.mdx)
