csharp changedcli-sdks-libraries/sdks/csharp
Nearest release: v2.1.312, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+10added
Lines−10removed
From line
53
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits15to this page, all time
The whole hunk
from line 53, old and new numbered
/
from line 53
5353}
5454```
5555
56For authentication options including Workload Identity Federation, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication). If your API key is a [personal or service account key](https://platform.claude.com/docs/en/manage-claude/authentication#key-types) that isn't scoped to a workspace, set the workspace ID in the `anthropic-workspace-id` request header; [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace) shows the per-request option for this SDK.
56For authentication options including Workload Identity Federation, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication). If your API key is a [personal or service account key](https://platform.claude.com/docs/en/manage-claude/authentication#key-types) that isn’t scoped to a workspace, set the workspace ID in the `anthropic-workspace-id` request header; [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace) shows the per-request option for this SDK.
5757
5858## Client configuration
5959
from line 110
110110
111111## Streaming
112112
113The SDK defines methods that return response "chunk" streams, where each chunk can be individually processed as soon as it arrives instead of waiting on the full response. Streaming methods generally correspond to [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) or [JSONL](https://jsonlines.org) responses.
113The SDK defines methods that return response “chunk” streams, where each chunk can be individually processed as soon as it arrives instead of waiting on the full response. Streaming methods generally correspond to [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) or [JSONL](https://jsonlines.org) responses.
114114
115A streaming method always has a `Streaming` suffix in its name, even if it doesn't have a non-streaming variant.
115A streaming method always has a `Streaming` suffix in its name, even if it doesn’t have a non-streaming variant.
116116
117117These streaming methods return [`IAsyncEnumerable`](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1):
118118
from line 156
156156
157157* `AnthropicIOException`: I/O networking errors.
158158
159* `AnthropicInvalidDataException`: Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.
159* `AnthropicInvalidDataException`: Failure to interpret successfully parsed data. For example, when accessing a property that’s supposed to be required, but the API unexpectedly omitted it from the response.
160160
161161* `AnthropicException`: Base class for all exceptions.
162162
from line 263
263263
264264## Response validation
265265
266In rare cases, the API might return a response that doesn't match the expected type. By default, the SDK does not throw an exception in this case. It throws `AnthropicInvalidDataException` only if you directly access the property.
266In rare cases, the API might return a response that doesn’t match the expected type. By default, the SDK does not throw an exception in this case. It throws `AnthropicInvalidDataException` only if you directly access the property.
267267
268268If you would prefer to check that the response is completely well-typed upfront, then either call `Validate`:
269269
from line 322
322322
323323## Requests and responses
324324
325To send a request to the Claude API, build an instance of a `Params` class and pass it to the corresponding client method. When the response is received, it's deserialized into an instance of a C# class.
325To send a request to the Claude API, build an instance of a `Params` class and pass it to the corresponding client method. When the response is received, it’s deserialized into an instance of a C# class.
326326
327327For example, `client.Messages.Create` takes an instance of `MessageCreateParams` and returns an instance of `Task<Message>`.
328328
from line 330
330330
331331### Binary responses
332332
333The SDK defines methods that return binary responses, which are used for API responses that shouldn't necessarily be parsed, such as non-JSON data.
333The SDK defines methods that return binary responses, which are used for API responses that shouldn’t necessarily be parsed, such as non-JSON data.
334334
335335These methods return `HttpResponse`:
336336
from line 405
405405
406406### OpenTelemetry tracing
407407
408When your application adds the SDK's sources to its OpenTelemetry tracer provider with `AddSource("com.anthropic.sdk.csharp*")`, the SDK emits a span for each request that it sends. To send the spans to your observability platform, see [Set up OpenTelemetry with the Claude SDK](https://platform.claude.com/docs/en/manage-claude/opentelemetry/sdk).
408When your application adds the SDK’s sources to its OpenTelemetry tracer provider with `AddSource("com.anthropic.sdk.csharp*")`, the SDK emits a span for each request that it sends. To send the spans to your observability platform, see [Set up OpenTelemetry with the Claude SDK](https://platform.claude.com/docs/en/manage-claude/opentelemetry/sdk).
409409
410410### Undocumented API functionality
411411
from line 443
443443This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backward-incompatible changes may be released as minor versions:
444444
4454451. Changes to library internals that are technically public but not intended or documented for external use.
4462. Changes that aren't expected to impact the vast majority of users in practice.
4462. Changes that aren’t expected to impact the vast majority of users in practice.
447447
448448Backward compatibility is taken seriously to ensure you can rely on a smooth upgrade experience.
449449
No line in this hunk matches that.