
Anthropic SDK for C#
https://github.com/anthropics/anthropic-sdk-csharp- Category
- AI Tools
- Rank
- No. 387Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- anthropics
- GitHub
- 321 stars
- Latest release
- Anthropic-v12.46.0
- Date
About
Official C# client library for the Anthropic API — call Claude models from .NET applications.
What it does
It gives C# programs typed request and response models for sending messages to Claude. Developers construct a client, describe the model, token limit, role, and content, then await the returned message. Separate packages extend the workspace for several cloud providers and MCP.
Why it's ranked here
This is a strong default for Claude work inside .NET. Anthropic maintains it, distributes it through NuGet, targets .NET Standard 2.0 and later, and backs the core package with tests. Provider-specific projects also reduce friction for teams deploying through major cloud platforms.
What's good
The setup is compact, while typed message parameters keep model, role, content, and token limits explicit. The solution includes dedicated packages for Bedrock, Foundry, Vertex AI, AWS, Google Cloud, and MCP. Automated formatting, analyzer checks, mock-backed tests, and an MIT license strengthen adoption.
Tradeoffs
Most SDK code is generated, so manual patches can conflict with later generator output. The main documentation lives outside the repository. Package history also creates a migration trap: older community-built releases moved to a differently named package, so existing consumers must verify which client they use.
How to use it well
Use it when a C# service or application needs typed, asynchronous Claude requests, especially when cloud-provider packages match your deployment. Install the NuGet package, start from the small message example, and test changes against the supplied mock workflow. Choose another surface if you need a standalone command-line client rather than an embedded library.
Technical notes+
README.md installs the Anthropic NuGet package and requires .NET Standard 2.0+. Anthropic.sln contains the core src\Anthropic\Anthropic.csproj, tests at src\Anthropic.Tests\Anthropic.Tests.csproj, provider projects for Foundry, Bedrock, Vertex, AWS, and Google Cloud, plus src\Anthropic.Mcp\Anthropic.Mcp.csproj. CONTRIBUTING.md states that most SDK code is generated. .stats.yml records 130 configured endpoints and an OpenAPI specification URL. scripts/test starts the mock workflow when needed and runs dotnet test; scripts/lint checks CSharpier formatting, .NET style rules, and analyzers.
Observed
- License
- MIT License
- Primary language
- C#
- Distribution
- NuGet package named Anthropic
- Install surface
- Library package installed with the .NET package manager
- Platform support
- .NET Standard 2.0 and later
- Interface
- Typed C# library for the Claude API
- Provider packages
- Bedrock, Foundry, Vertex AI, AWS, and Google Cloud projects
- Repository structure
- Dedicated core test project and a streaming aggregation example project
Read from README.md, LICENSE, .stats.yml, SECURITY.md, CHANGELOG.md, Anthropic.sln, CONTRIBUTING.md, .csharpierignore, release-please-config.json, .release-please-manifest.json, scripts/lint, scripts/mock, scripts/test, scripts/format.
What it can do
Generate text responses using Claude models
Text prompts and conversation messages → AI-generated text responses
Conduct multi-turn conversations with Claude
Series of user messages and system prompts → Contextual conversation responses
Process and analyze images with Claude Vision
Image files and text prompts → Image analysis and descriptions
Generate code solutions
Programming requirements and specifications → Code snippets and implementations
Stream real-time responses from Claude
Text prompts with streaming enabled → Incremental text response chunks
Configure model parameters and behavior
Temperature, max tokens, and system prompts → Customized model response settings
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.