If you've been building with Claude in .NET, you've probably leaned on one of the lovely community SDKs Anthropic.SDK by tghamm, or tryAGI.Anthropic by the tryAGI folks. Both have carried the .NET community for a long time, and they're genuinely good libraries written by people who care.
So this post isn't really about replacing them. It's about a quiet, kind of nice piece of news: Anthropic shipped an official C# SDK, and the .NET ecosystem now has a first-party option to sit alongside the community ones.
What was released
The new SDK lives at anthropics/anthropic-sdk-csharp on GitHub, and it ships as the Anthropic package on NuGet. You can find the docs at platform.claude.com/docs/en/api/sdks/csharp.
A few things worth knowing up front:
- It targets .NET Standard 2.0+, so it works with pretty much any reasonably modern .NET project, including older .NET Framework apps.
- It's currently in beta, even though the version number is high. Breaking changes can land in minor releases for now, so it's worth pinning your version if you try it out.
- It joins the official lineup alongside Python, TypeScript, Java, Go, Ruby, PHP, and the CLI.
A small "hello, Claude"
Here's about as simple as it gets:
dotnet add package Anthropic
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-7",
};
var message = await client.Messages.CreateAsync(parameters);
Console.WriteLine(message);
By default it picks up your API key from the ANTHROPIC_API_KEY environment variable, which is a small kindness when you're just exploring.
It uses collection expressions and target-typed new(), which makes it feel like it was written for C# rather than translated into it. A small thing, but a nice one.
A gentle note on the version number
The first official release is version 10, which might look a little surprising.
The story is sweet, honestly. The Anthropic package name on NuGet was already in use by the tryAGI community SDK, which had been shipping versions 1.x through 3.x for some time. When Anthropic wanted to publish an official package, the tryAGI maintainers kindly moved their library over to tryAGI.Anthropic to make room. The official package picked up at version 10 to avoid confusing anyone who already had the older versions installed.
If you were using the Anthropic package previously and something feels off after an update, you probably want to point your project at tryAGI.Anthropic instead. Nothing is broken the package just has a new home.
Should you switch?
Honestly? Take your time. There's no rush.
If you're using Anthropic.SDK by tghamm, you're in good hands. It has been around a while, it supports Vertex AI authentication, helpful patterns for extended thinking, and a lot of thoughtful touches built up over many releases. If it's working for you, it will keep working for you.
If you're using tryAGI.Anthropic, the same applies. It's still maintained, still useful, and the migration path is clear if you decide to move later.
If you have a hand-rolled HttpClient wrapper, the official SDK might be worth a look just because it handles streaming, batching, prompt caching, and tool use out of the box, which can save you from re-inventing pieces you don't really want to maintain.
The honest framing is: this is a new option, not a replacement. The community SDKs got the .NET ecosystem to where it is today, and they're still excellent choices.
Why this is quietly a big deal
For teams in regulated or enterprise environments, having a first-party SDK can make conversations easier with security reviewers, with procurement, with internal architecture groups. It opens a door that was sometimes a little harder to walk through before.
It also means that as new Claude API features land, .NET developers get them on a similar timeline to other languages, which is a nice place to be.
A small thank-you
If you maintain or contribute to one of the community SDKs Taylor (tghamm), the tryAGI team, and everyone who's filed issues or pull requests thank you. You built the bridge that got us here, and a lot of working .NET + Claude apps exist because of your work.
If you want to try the new official SDK, give it a gentle test drive on a small project first. And whichever one you land on, it's a nicer time to be a .NET developer building with Claude than it was a year ago.
Top comments (0)