Prompty.Anthropic
2.0.0-beta.1
This is a prerelease version of Prompty.Anthropic.
dotnet add package Prompty.Anthropic --version 2.0.0-beta.1
NuGet\Install-Package Prompty.Anthropic -Version 2.0.0-beta.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Prompty.Anthropic" Version="2.0.0-beta.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Prompty.Anthropic" Version="2.0.0-beta.1" />
<PackageReference Include="Prompty.Anthropic" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Prompty.Anthropic --version 2.0.0-beta.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Prompty.Anthropic, 2.0.0-beta.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Prompty.Anthropic@2.0.0-beta.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Prompty.Anthropic&version=2.0.0-beta.1&prerelease
#tool nuget:?package=Prompty.Anthropic&version=2.0.0-beta.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Prompty.Anthropic
Anthropic Claude provider for Prompty — executor and processor for Claude models via the Anthropic Messages API. Uses direct HTTP (no SDK dependency) for a lightweight footprint.
Installation
dotnet add package Prompty.Core
dotnet add package Prompty.Anthropic
Quick Start
using Prompty.Core;
using Prompty.Anthropic;
// One-time setup — registers renderers, parser, and Anthropic provider
new PromptyBuilder()
.AddAnthropic();
// Run a .prompty file
var result = await Pipeline.InvokeAsync("chat.prompty", new Dictionary<string, object>
{
["question"] = "Explain quantum computing in simple terms"
});
Console.WriteLine(result);
.prompty Configuration
---
name: claude-chat
model:
id: claude-sonnet-4-20250514
provider: anthropic
apiType: chat
connection:
kind: key
endpoint: https://api.anthropic.com
apiKey: ${env:ANTHROPIC_API_KEY}
options:
temperature: 0.7
maxOutputTokens: 1024
---
system:
You are a helpful assistant.
user:
{{question}}
Supported Models
Any model available through the Anthropic Messages API:
claude-sonnet-4-20250514claude-3-5-sonnet-20241022claude-3-haiku-20240307claude-3-opus-20240229
Features
| Feature | Supported |
|---|---|
| Chat completions | ✅ |
| Streaming (SSE) | ✅ |
| Tool calling | ✅ |
| Agent turns (tool loop) | ✅ |
| Structured output | ✅ |
| Image inputs (base64) | ✅ |
| System prompts | ✅ (extracted per Anthropic convention) |
Authentication
API Key
model:
connection:
kind: key
endpoint: https://api.anthropic.com # optional, this is the default
apiKey: ${env:ANTHROPIC_API_KEY}
Agent Turns (Tool Calling)
Anthropic's tool calling follows the same pattern as other providers:
var tools = new Dictionary<string, Func<string, Task<string>>>
{
["get_weather"] = async (args) => "72°F and sunny"
};
var result = await Pipeline.TurnAsync(
agent, inputs, tools, maxIterations: 10);
Architecture Notes
This package uses direct HTTP via HttpClient rather than an Anthropic SDK.
This means:
- Zero external package dependencies (only
Prompty.Core) - Full control over the Messages API wire format
- Lightweight — no SDK overhead
Documentation
Visit prompty.ai for full documentation.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Prompty.Core (>= 2.0.0-beta.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-beta.1 | 51 | 5/5/2026 |
| 2.0.0-alpha.11 | 49 | 5/5/2026 |
| 2.0.0-alpha.10 | 56 | 4/14/2026 |
| 2.0.0-alpha.9 | 60 | 4/13/2026 |
| 2.0.0-alpha.8 | 57 | 4/10/2026 |
| 2.0.0-alpha.7 | 62 | 4/9/2026 |
| 2.0.0-alpha.6 | 54 | 4/8/2026 |
| 2.0.0-alpha.2 | 58 | 4/8/2026 |
| 2.0.0-alpha.1 | 63 | 4/8/2026 |