惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
雷峰网
雷峰网
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
V
V2EX
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium
Vercel News
Vercel News
美团技术团队
人人都是产品经理
人人都是产品经理
The Cloudflare Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
An Official Claude SDK for .NET? Yes, Really.
JKC · 2026-05-27 · via DEV Community

JKC

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

Enter fullscreen mode Exit fullscreen mode

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);

Enter fullscreen mode Exit fullscreen mode

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.