A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is a stream containing the file content.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GetFileInfoAsync(string, CancellationToken)
+
+
+
+
Gets a file's metadata by its ID asynchronously.
+
+
+
+
+
public Task<AnthropicResult<AnthropicFile>> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default)
A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is Page<T> where T is AnthropicFile.
A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is a stream containing the file content.
A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is Page<T> where T is AnthropicFile.
var result = await client.GetFileAsync("file_12345");
+
+if (result.IsSuccess)
+{
+ using var contentStream = result.Value;
+ using var reader = new StreamReader(contentStream);
+ var content = await reader.ReadToEndAsync();
+
+ Console.WriteLine("File content:");
+ Console.WriteLine(content);
+}
+
+
Delete a File
+
Remove a file from your account:
+
var result = await client.DeleteFileAsync("file_12345");
+
+if (result.IsSuccess)
+{
+ var deleteResponse = result.Value;
+ Console.WriteLine($"Deleted file: {deleteResponse.Id}");
+ Console.WriteLine($"Type: {deleteResponse.Type}");
+}
+
+
+
Note
+
The Files API has certain limitations on file size, supported file types, and usage quotas. Please refer to the Anthropic API Documentation for the most up-to-date information on these limitations.
+
Create a message
The AnthropicApiClient exposes a method named CreateMessageAsync that can be used to create a message. The method requires a MessageRequest or a StreamMessageRequest instance as a parameter. The MessageRequest class is used to create a message whose response is not streamed and the StreamMessageRequest class is used to create a message whose response is streamed. The MessageRequest instance's properties can be set to configure how the message is created.
Non-Streaming
diff --git a/docs/index.json b/docs/index.json
index c4c06cf..7cf826c 100644
--- a/docs/index.json
+++ b/docs/index.json
@@ -2,12 +2,12 @@
"api/AnthropicClient.AnthropicApiClient.html": {
"href": "api/AnthropicClient.AnthropicApiClient.html",
"title": "Class AnthropicApiClient | AnthropicClient",
- "summary": "Class AnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public class AnthropicApiClient : IAnthropicApiClient Inheritance object AnthropicApiClient Implements IAnthropicApiClient Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicApiClient(string, HttpClient) Initializes a new instance of the AnthropicApiClient class. public AnthropicApiClient(string apiKey, HttpClient httpClient) Parameters apiKey string The API key to use for the client. httpClient HttpClient The HTTP client to use for the client. Exceptions ArgumentNullException Thrown when the API key or HTTP client is null. Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. public Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. public Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. public Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. public IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. public Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. public Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. public Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. public Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. public Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. public IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. public IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. public Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. public Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel."
+ "summary": "Class AnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public class AnthropicApiClient : IAnthropicApiClient Inheritance object AnthropicApiClient Implements IAnthropicApiClient Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicApiClient(string, HttpClient) Initializes a new instance of the AnthropicApiClient class. public AnthropicApiClient(string apiKey, HttpClient httpClient) Parameters apiKey string The API key to use for the client. httpClient HttpClient The HTTP client to use for the client. Exceptions ArgumentNullException Thrown when the API key or HTTP client is null. Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. public Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. public Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateFileAsync(CreateFileRequest, CancellationToken) Creates a file asynchronously using the Files API. public Task> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default) Parameters request CreateFileRequest The file creation request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. public Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. public IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. public Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteFileAsync(string, CancellationToken) Deletes a file by its ID asynchronously. public Task> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFileDeleteResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. public Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetFileAsync(string, CancellationToken) Gets a file's content by its ID asynchronously. public Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get the content for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is a stream containing the file content. GetFileInfoAsync(string, CancellationToken) Gets a file's metadata by its ID asynchronously. public Task> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. public Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. public Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. public Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllFilesAsync(int, CancellationToken) Lists all files asynchronously, returning every page of results. public IAsyncEnumerable>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of files to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicFile. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. public IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. public IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListFilesAsync(PagingRequest?, CancellationToken) Lists files asynchronously, returning a single page of results. public Task>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the files. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicFile. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. public Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. public Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel."
},
"api/AnthropicClient.IAnthropicApiClient.html": {
"href": "api/AnthropicClient.IAnthropicApiClient.html",
"title": "Interface IAnthropicApiClient | AnthropicClient",
- "summary": "Interface IAnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public interface IAnthropicApiClient Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel."
+ "summary": "Interface IAnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public interface IAnthropicApiClient Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateFileAsync(CreateFileRequest, CancellationToken) Creates a file asynchronously using the Files API. Task> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default) Parameters request CreateFileRequest The file creation request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteFileAsync(string, CancellationToken) Deletes a file by its ID asynchronously. Task> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFileDeleteResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetFileAsync(string, CancellationToken) Gets a file's content by its ID asynchronously. Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get the content for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is a stream containing the file content. GetFileInfoAsync(string, CancellationToken) Gets a file's metadata by its ID asynchronously. Task> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllFilesAsync(int, CancellationToken) Lists all files asynchronously, returning every page of results. IAsyncEnumerable>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of files to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicFile. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListFilesAsync(PagingRequest?, CancellationToken) Lists files asynchronously, returning a single page of results. Task>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the files. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicFile. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel."
},
"api/AnthropicClient.Models.AnthropicError.html": {
"href": "api/AnthropicClient.Models.AnthropicError.html",
@@ -19,6 +19,16 @@
"title": "Class AnthropicEvent | AnthropicClient",
"summary": "Class AnthropicEvent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an event from the Anthropic API. public class AnthropicEvent Inheritance object AnthropicEvent Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicEvent(string, EventData) Initializes a new instance of the AnthropicEvent class. public AnthropicEvent(string type, EventData data) Parameters type string The type of the event. data EventData The data associated with the event. Properties Data The data associated with the event. public EventData Data { get; init; } Property Value EventData Type The type of the event. public string Type { get; init; } Property Value string"
},
+ "api/AnthropicClient.Models.AnthropicFile.html": {
+ "href": "api/AnthropicClient.Models.AnthropicFile.html",
+ "title": "Class AnthropicFile | AnthropicClient",
+ "summary": "Class AnthropicFile Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a file object from the Anthropic Files API. public class AnthropicFile Inheritance object AnthropicFile Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties CreatedAt Date file was created. [JsonPropertyName(\"created_at\")] public DateTimeOffset CreatedAt { get; init; } Property Value DateTimeOffset Downloadable Whether the file can be downloaded. [JsonPropertyName(\"downloadable\")] public bool Downloadable { get; init; } Property Value bool Id Unique object identifier. [JsonPropertyName(\"id\")] public string Id { get; init; } Property Value string MimeType MIME type of the file. [JsonPropertyName(\"mime_type\")] public string MimeType { get; init; } Property Value string Name Original filename of the uploaded file. [JsonPropertyName(\"filename\")] public string Name { get; init; } Property Value string Size Size of the file in bytes. [JsonPropertyName(\"size_bytes\")] public long Size { get; init; } Property Value long Type Object type. [JsonPropertyName(\"type\")] public string Type { get; init; } Property Value string"
+ },
+ "api/AnthropicClient.Models.AnthropicFileDeleteResponse.html": {
+ "href": "api/AnthropicClient.Models.AnthropicFileDeleteResponse.html",
+ "title": "Class AnthropicFileDeleteResponse | AnthropicClient",
+ "summary": "Class AnthropicFileDeleteResponse Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the response from deleting a file in the Anthropic API. public class AnthropicFileDeleteResponse Inheritance object AnthropicFileDeleteResponse Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Id Gets or sets the ID of the file that was deleted. public string Id { get; init; } Property Value string Type Gets or sets the response type public string Type { get; init; } Property Value string"
+ },
"api/AnthropicClient.Models.AnthropicFunction.html": {
"href": "api/AnthropicClient.Models.AnthropicFunction.html",
"title": "Class AnthropicFunction | AnthropicClient",
@@ -37,7 +47,7 @@
"api/AnthropicClient.Models.AnthropicModels.html": {
"href": "api/AnthropicClient.Models.AnthropicModels.html",
"title": "Class AnthropicModels | AnthropicClient",
- "summary": "Class AnthropicModels Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for the Anthropic models. public static class AnthropicModels Inheritance object AnthropicModels Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Claude35Haiku20241022 The Claude 3.5 Haiku model. public const string Claude35Haiku20241022 = \"claude-3-5-haiku-20241022\" Field Value string Claude35HaikuLatest The Claude 3.5 Haiku model. public const string Claude35HaikuLatest = \"claude-3-5-haiku-latest\" Field Value string Claude35Sonnet The Claude 3.5 Sonnet model. public const string Claude35Sonnet = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20240620 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20240620 = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20241022 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20241022 = \"claude-3-5-sonnet-20241022\" Field Value string Claude35SonnetLatest The Claude 3.5 Sonnet model. public const string Claude35SonnetLatest = \"claude-3-5-sonnet-latest\" Field Value string Claude3Haiku The Claude 3 Haiku model. public const string Claude3Haiku = \"claude-3-haiku-20240307\" Field Value string Claude3Haiku20240307 The Claude 3 Haiku model. public const string Claude3Haiku20240307 = \"claude-3-haiku-20240307\" Field Value string Claude3Opus The Claude 3 Opus model. public const string Claude3Opus = \"claude-3-opus-20240229\" Field Value string Claude3Opus20241022 The Claude 3 Opus model. public const string Claude3Opus20241022 = \"claude-3-opus-20240229\" Field Value string Claude3OpusLatest The Claude 3 Opus model. public const string Claude3OpusLatest = \"claude-3-opus-latest\" Field Value string Claude3Sonnet The Claude 3 Sonnet model. public const string Claude3Sonnet = \"claude-3-sonnet-20240229\" Field Value string Claude3Sonnet20240229 The Claude 3 Sonnet model. public const string Claude3Sonnet20240229 = \"claude-3-sonnet-20240229\" Field Value string"
+ "summary": "Class AnthropicModels Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for the Anthropic models. public static class AnthropicModels Inheritance object AnthropicModels Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Claude35Haiku20241022 The Claude 3.5 Haiku model. public const string Claude35Haiku20241022 = \"claude-3-5-haiku-20241022\" Field Value string Claude35HaikuLatest The Claude 3.5 Haiku model. public const string Claude35HaikuLatest = \"claude-3-5-haiku-latest\" Field Value string Claude35Sonnet The Claude 3.5 Sonnet model. public const string Claude35Sonnet = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20240620 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20240620 = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20241022 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20241022 = \"claude-3-5-sonnet-20241022\" Field Value string Claude35SonnetLatest The Claude 3.5 Sonnet model. public const string Claude35SonnetLatest = \"claude-3-5-sonnet-latest\" Field Value string Claude37Sonnet20250219 The Claude 3 Sonnet model public const string Claude37Sonnet20250219 = \"claude-3-7-sonnet-20250219\" Field Value string Claude37SonnetLatest The Claude 3 Sonnet model public const string Claude37SonnetLatest = \"claude-3-7-sonnet-latest\" Field Value string Claude3Haiku The Claude 3 Haiku model. public const string Claude3Haiku = \"claude-3-haiku-20240307\" Field Value string Claude3Haiku20240307 The Claude 3 Haiku model. public const string Claude3Haiku20240307 = \"claude-3-haiku-20240307\" Field Value string Claude3Opus The Claude 3 Opus model. public const string Claude3Opus = \"claude-3-opus-20240229\" Field Value string Claude3Opus20241022 The Claude 3 Opus model. public const string Claude3Opus20241022 = \"claude-3-opus-20240229\" Field Value string Claude3OpusLatest The Claude 3 Opus model. public const string Claude3OpusLatest = \"claude-3-opus-latest\" Field Value string Claude3Sonnet The Claude 3 Sonnet model. public const string Claude3Sonnet = \"claude-3-sonnet-20240229\" Field Value string Claude3Sonnet20240229 The Claude 3 Sonnet model. public const string Claude3Sonnet20240229 = \"claude-3-sonnet-20240229\" Field Value string ClaudeOpus40 The Claude 4 Opus model. public const string ClaudeOpus40 = \"claude-opus-4-0\" Field Value string ClaudeOpus420250514 The Claude 4 Opus model. public const string ClaudeOpus420250514 = \"claude-opus-4-20250514\" Field Value string ClaudeSonnet40 The Claude 4 Sonnet model. public const string ClaudeSonnet40 = \"claude-sonnet-4-0\" Field Value string ClaudeSonnet420250514 The Claude 4 Sonnet model. public const string ClaudeSonnet420250514 = \"claude-sonnet-4-20250514\" Field Value string"
},
"api/AnthropicClient.Models.AnyToolChoice.html": {
"href": "api/AnthropicClient.Models.AnyToolChoice.html",
@@ -154,6 +164,11 @@
"title": "Class CountMessageTokensRequest | AnthropicClient",
"summary": "Class CountMessageTokensRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a request to count the number of tokens in a message. public class CountMessageTokensRequest Inheritance object CountMessageTokensRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors CountMessageTokensRequest(string, List, ToolChoice?, List?, List?) Initializes a new instance of the CountMessageTokensRequest class. public CountMessageTokensRequest(string model, List messages, ToolChoice? toolChoice = null, List? tools = null, List? systemPrompt = null) Parameters model string The model ID to use for the request. messages List