RepoAnthropicAnthropicpublished Aug 25, 2025seen 6d

anthropics/anthropic-sdk-csharp

C#

Open original ↗

Captured source

source ↗
published Aug 25, 2025seen 6dcaptured 12hhttp 200method plain

anthropics/anthropic-sdk-csharp

Description: Access to Anthropic's safety-first language model APIs in C#

Language: C#

License: MIT

Stars: 294

Forks: 91

Open issues: 8

Created: 2025-08-25T23:20:29Z

Pushed: 2026-06-09T23:49:09Z

Default branch: main

Fork: no

Archived: no

README:

Claude SDK for C#

> [!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`. 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](https://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](./CONTRIBUTING.md).

License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Notability

notability 5.0/10

Official Anthropic SDK, moderate stars.