https://github.com/anthropics/anthropic-sdk-csharp
Access to Anthropic's safety-first language model APIs in C#
https://github.com/anthropics/anthropic-sdk-csharp
Last synced: 3 months ago
JSON representation
Access to Anthropic's safety-first language model APIs in C#
- Host: GitHub
- URL: https://github.com/anthropics/anthropic-sdk-csharp
- Owner: anthropics
- License: mit
- Created: 2025-08-25T23:20:29.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2026-05-19T02:48:34.000Z (3 months ago)
- Last Synced: 2026-05-19T05:42:11.313Z (3 months ago)
- Language: C#
- Size: 7.33 MB
- Stars: 263
- Watchers: 7
- Forks: 81
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-claude - anthropic-sdk-csharp
README
# Claude SDK for C#
[](https://www.nuget.org/packages/Anthropic)
> [!IMPORTANT]
> 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`](https://www.nuget.org/packages/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](https://docs.anthropic.com/en/api/) from C# applications.
## Documentation
Full documentation is available at **[platform.claude.com/docs/en/api/sdks/csharp](https://platform.claude.com/docs/en/api/sdks/csharp)**.
## Installation
```bash
dotnet add package Anthropic
```
## Getting started
```csharp
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](./CONTRIBUTING.md).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.