Skip to main content
net8.0net9.0.NETStandard2.0

The official .NET library for the Anthropic API.

Published
Jul 24, 2026
2mo ago
Total Downloads
5.1M
5,129,402

Install

dotnet add package Anthropic --version 12.39.0
ProductVersions
.NET
net8.0net9.0
.NET Standard
netstandard2.0

README

Claude SDK for C#

NuGet Version

As of version 10+, the Anthropic package is now the official Claude SDK for C#. Package versions 3.X and below were previously used for the tryAGI community-built SDK, which has moved to tryAGI.Anthropic. If you need to continue using the former client in your project, update your package reference to tryAGI.Anthropic.

The Claude SDK for C# provides access to the Claude API from C# applications.

Documentation

Full documentation is available at platform.claude.com/docs/en/api/sdks/csharp.

Installation

dotnet add package Anthropic

Getting started

using System;
using Anthropic;
using Anthropic.Models.Messages;

AnthropicClient client = new();

MessageCreateParams parameters = new()
{
    MaxTokens = 1024,
    Messages =
    [
        new()
        {
            Role = Role.User,
            Content = "Hello, Claude",
        },
    ],
    Model = "claude-opus-4-6",
};

var message = await client.Messages.Create(parameters);

Console.WriteLine(message);

Requirements

.NET Standard 2.0+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Changes from Previous Version

No structural changes between v12.38.0 and v12.39.0.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.