2024-11-19 20:13:35 +00:00
<!DOCTYPE html>
2024-07-07 16:16:55 -05:00
< html >
< head >
< meta charset = "utf-8" >
< title > Class AnthropicApiClient | AnthropicClient </ title >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< meta name = "title" content = "Class AnthropicApiClient | AnthropicClient " >
< meta name = "description" content = "Represents a client for interacting with the Anthropic API." >
< link rel = "icon" href = "../favicon.ico" >
< link rel = "stylesheet" href = "../public/docfx.min.css" >
< link rel = "stylesheet" href = "../public/main.css" >
< meta name = "docfx:navrel" content = "../toc.html" >
< meta name = "docfx:tocrel" content = "toc.html" >
< meta name = "docfx:rel" content = "../" >
2024-07-07 16:46:36 -05:00
< meta name = "docfx:docurl" content = "https://github.com/StevanFreeborn/anthropic-client/new/main/apiSpec/new?filename=AnthropicClient_AnthropicApiClient.md&value=---%0Auid%3A%20AnthropicClient.AnthropicApiClient%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" >
2024-07-07 16:16:55 -05:00
< meta name = "loc:inThisArticle" content = "In this article" >
< meta name = "loc:searchResultsCount" content = "{count} results for "{query}"" >
< meta name = "loc:searchNoResults" content = "No results for "{query}"" >
< meta name = "loc:tocFilter" content = "Filter by title" >
< meta name = "loc:nextArticle" content = "Next" >
< meta name = "loc:prevArticle" content = "Previous" >
< meta name = "loc:themeLight" content = "Light" >
< meta name = "loc:themeDark" content = "Dark" >
< meta name = "loc:themeAuto" content = "Auto" >
< meta name = "loc:changeTheme" content = "Change theme" >
< meta name = "loc:copy" content = "Copy" >
< meta name = "loc:downloadPdf" content = "Download PDF" >
< script type = "module" src = "./../public/docfx.min.js" ></ script >
< script >
const theme = localStorage . getItem ( 'theme' ) || 'auto'
document . documentElement . setAttribute ( 'data-bs-theme' , theme === 'auto' ? ( window . matchMedia ( '(prefers-color-scheme: dark)' ). matches ? 'dark' : 'light' ) : theme )
</ script >
</ head >
< body class = "tex2jax_ignore" data-layout = "" data-yaml-mime = "ManagedReference" >
< header class = "bg-body border-bottom" >
< nav id = "autocollapse" class = "navbar navbar-expand-md" role = "navigation" >
< div class = "container-xxl flex-nowrap" >
< a class = "navbar-brand" href = "../index.html" >
< img id = "logo" class = "svg" src = "../logo.svg" alt = "AnthropicClient" >
AnthropicClient
</ a >
< button class = "btn btn-lg d-md-none border-0" type = "button" data-bs-toggle = "collapse" data-bs-target = "#navpanel" aria-controls = "navpanel" aria-expanded = "false" aria-label = "Toggle navigation" >
< i class = "bi bi-three-dots" ></ i >
</ button >
< div class = "collapse navbar-collapse" id = "navpanel" >
< div id = "navbar" >
< form class = "search" role = "search" id = "search" >
< i class = "bi bi-search" ></ i >
2024-11-19 20:13:35 +00:00
< input class = "form-control" id = "search-query" type = "search" disabled placeholder = "Search" autocomplete = "off" aria-label = "Search" >
2024-07-07 16:16:55 -05:00
</ form >
</ div >
</ div >
</ div >
</ nav >
</ header >
< main class = "container-xxl" >
< div class = "toc-offcanvas" >
< div class = "offcanvas-md offcanvas-start" tabindex = "-1" id = "tocOffcanvas" aria-labelledby = "tocOffcanvasLabel" >
< div class = "offcanvas-header" >
< h5 class = "offcanvas-title" id = "tocOffcanvasLabel" > Table of Contents</ h5 >
< button type = "button" class = "btn-close" data-bs-dismiss = "offcanvas" data-bs-target = "#tocOffcanvas" aria-label = "Close" ></ button >
</ div >
< div class = "offcanvas-body" >
< nav class = "toc" id = "toc" ></ nav >
</ div >
</ div >
</ div >
< div class = "content" >
< div class = "actionbar" >
< button class = "btn btn-lg border-0 d-md-none" type = "button" data-bs-toggle = "offcanvas" data-bs-target = "#tocOffcanvas" aria-controls = "tocOffcanvas" aria-expanded = "false" aria-label = "Show table of contents" >
< i class = "bi bi-list" ></ i >
</ button >
< nav id = "breadcrumb" ></ nav >
</ div >
< article data-uid = "AnthropicClient.AnthropicApiClient" >
< h1 id = "AnthropicClient_AnthropicApiClient" data-uid = "AnthropicClient.AnthropicApiClient" class = "text-break" >
2025-05-19 20:34:34 +00:00
Class AnthropicApiClient < a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L13" >< i class = "bi bi-code-slash" ></ i ></ a >
2024-07-07 16:16:55 -05:00
</ h1 >
< div class = "facts text-secondary" >
< dl >< dt > Namespace</ dt >< dd >< a class = "xref" href = "AnthropicClient.html" > AnthropicClient</ a ></ dd ></ dl >
< dl >< dt > Assembly</ dt >< dd > AnthropicClient.dll</ dd ></ dl >
</ div >
< div class = "markdown summary" >< p > Represents a client for interacting with the Anthropic API.</ p >
</ div >
< div class = "markdown conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public class AnthropicApiClient : IAnthropicApiClient</ code ></ pre >
</ div >
< dl class = "typelist inheritance" >
< dt > Inheritance</ dt >
< dd >
< div >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object" > object</ a ></ div >
< div >< span class = "xref" > AnthropicApiClient</ span ></ div >
</ dd >
</ dl >
< dl class = "typelist implements" >
< dt > Implements</ dt >
< dd >
< div >< a class = "xref" href = "AnthropicClient.IAnthropicApiClient.html" > IAnthropicApiClient</ a ></ div >
</ dd >
</ dl >
< dl class = "typelist inheritedMembers" >
< dt > Inherited Members</ dt >
< dd >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)" > object.Equals(object)</ a >
</ div >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)" > object.Equals(object, object)</ a >
</ div >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.gethashcode" > object.GetHashCode()</ a >
</ div >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.gettype" > object.GetType()</ a >
</ div >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone" > object.MemberwiseClone()</ a >
</ div >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.referenceequals" > object.ReferenceEquals(object, object)</ a >
</ div >
< div >
< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.object.tostring" > object.ToString()</ a >
</ div >
</ dd ></ dl >
< h2 class = "section" id = "constructors" > Constructors
</ h2 >
< a id = "AnthropicClient_AnthropicApiClient__ctor_" data-uid = "AnthropicClient.AnthropicApiClient.#ctor*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient__ctor_System_String_System_Net_Http_HttpClient_" data-uid = "AnthropicClient.AnthropicApiClient.#ctor(System.String,System.Net.Http.HttpClient)" >
AnthropicApiClient(string, HttpClient)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L38" >< i class = "bi bi-code-slash" ></ i ></ a >
2024-07-07 16:16:55 -05:00
</ h3 >
< div class = "markdown level1 summary" >< p > Initializes a new instance of the < a class = "xref" href = "AnthropicClient.AnthropicApiClient.html" > AnthropicApiClient</ a > class.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public AnthropicApiClient(string apiKey, HttpClient httpClient)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > apiKey</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The API key to use for the client.</ p >
</ dd >
< dt >< code > httpClient</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.net.http.httpclient" > HttpClient</ a ></ dt >
< dd >< p > The HTTP client to use for the client.</ p >
</ dd >
</ dl >
< h4 class = "section" > Exceptions</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.argumentnullexception" > ArgumentNullException</ a ></ dt >
< dd >< p > Thrown when the API key or HTTP client is null.</ p >
</ dd >
</ dl >
< h2 class = "section" id = "methods" > Methods
</ h2 >
2025-01-15 16:33:05 +00:00
< a id = "AnthropicClient_AnthropicApiClient_CancelMessageBatchAsync_" data-uid = "AnthropicClient.AnthropicApiClient.CancelMessageBatchAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_CancelMessageBatchAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.CancelMessageBatchAsync(System.String,System.Threading.CancellationToken)" >
CancelMessageBatchAsync(string, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L304" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Cancels a message batch asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< MessageBatchResponse>> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > batchId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the message batch to cancel.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > .</ p >
</ dd >
</ dl >
2025-01-03 02:56:41 +00:00
< a id = "AnthropicClient_AnthropicApiClient_CountMessageTokensAsync_" data-uid = "AnthropicClient.AnthropicApiClient.CountMessageTokensAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_CountMessageTokensAsync_AnthropicClient_Models_CountMessageTokensRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.CountMessageTokensAsync(AnthropicClient.Models.CountMessageTokensRequest,System.Threading.CancellationToken)" >
CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L352" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-03 02:56:41 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Counts the tokens in a message asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< TokenCountResponse>> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-03 02:56:41 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.CountMessageTokensRequest.html" > CountMessageTokensRequest</ a ></ dt >
< dd >< p > The count message tokens request.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-03 02:56:41 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.TokenCountResponse.html" > TokenCountResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.TokenCountResponse.html" > TokenCountResponse</ a > .</ p >
</ dd >
</ dl >
2025-07-15 04:30:56 +00:00
< a id = "AnthropicClient_AnthropicApiClient_CreateFileAsync_" data-uid = "AnthropicClient.AnthropicApiClient.CreateFileAsync*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient_CreateFileAsync_AnthropicClient_Models_CreateFileRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest,System.Threading.CancellationToken)" >
CreateFileAsync(CreateFileRequest, CancellationToken)
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L385" >< i class = "bi bi-code-slash" ></ i ></ a >
</ h3 >
< div class = "markdown level1 summary" >< p > Creates a file asynchronously using the Files API.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< AnthropicFile>> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.CreateFileRequest.html" > CreateFileRequest</ a ></ dt >
< dd >< p > The file creation request.</ p >
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > .</ p >
</ dd >
</ dl >
2024-07-07 16:16:55 -05:00
< a id = "AnthropicClient_AnthropicApiClient_CreateMessageAsync_" data-uid = "AnthropicClient.AnthropicApiClient.CreateMessageAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_CreateMessageAsync_AnthropicClient_Models_MessageRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.CreateMessageAsync(AnthropicClient.Models.MessageRequest,System.Threading.CancellationToken)" >
CreateMessageAsync(MessageRequest, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L57" >< i class = "bi bi-code-slash" ></ i ></ a >
2024-07-07 16:16:55 -05:00
</ h3 >
< div class = "markdown level1 summary" >< p > Creates a message asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< MessageResponse>> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default)</ code ></ pre >
2024-07-07 16:16:55 -05:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.MessageRequest.html" > MessageRequest</ a ></ dt >
< dd >< p > The message request to create.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2024-07-07 16:16:55 -05:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageResponse.html" > MessageResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > .</ p >
</ dd >
</ dl >
< a id = "AnthropicClient_AnthropicApiClient_CreateMessageAsync_" data-uid = "AnthropicClient.AnthropicApiClient.CreateMessageAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_CreateMessageAsync_AnthropicClient_Models_StreamMessageRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.CreateMessageAsync(AnthropicClient.Models.StreamMessageRequest,System.Threading.CancellationToken)" >
CreateMessageAsync(StreamMessageRequest, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L80" >< i class = "bi bi-code-slash" ></ i ></ a >
2024-07-07 16:16:55 -05:00
</ h3 >
< div class = "markdown level1 summary" >< p > Creates a message asynchronously and streams the response.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public IAsyncEnumerable< AnthropicEvent> CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default)</ code ></ pre >
2024-07-07 16:16:55 -05:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.StreamMessageRequest.html" > StreamMessageRequest</ a ></ dt >
< dd >< p > The message request to create.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2024-07-07 16:16:55 -05:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1" > IAsyncEnumerable</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicEvent.html" > AnthropicEvent</ a > > </ dt >
< dd >< p > An asynchronous enumerable that yields the response event by event.</ p >
</ dd >
</ dl >
2025-01-15 16:33:05 +00:00
< a id = "AnthropicClient_AnthropicApiClient_CreateMessageBatchAsync_" data-uid = "AnthropicClient.AnthropicApiClient.CreateMessageBatchAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_CreateMessageBatchAsync_AnthropicClient_Models_MessageBatchRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.CreateMessageBatchAsync(AnthropicClient.Models.MessageBatchRequest,System.Threading.CancellationToken)" >
CreateMessageBatchAsync(MessageBatchRequest, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L272" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Creates a batch of messages asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< MessageBatchResponse>> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.MessageBatchRequest.html" > MessageBatchRequest</ a ></ dt >
< dd >< p > The message batch request to create.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > .</ p >
</ dd >
</ dl >
2025-07-15 04:30:56 +00:00
< a id = "AnthropicClient_AnthropicApiClient_DeleteFileAsync_" data-uid = "AnthropicClient.AnthropicApiClient.DeleteFileAsync*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient_DeleteFileAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.DeleteFileAsync(System.String,System.Threading.CancellationToken)" >
DeleteFileAsync(string, CancellationToken)
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L435" >< i class = "bi bi-code-slash" ></ i ></ a >
</ h3 >
< div class = "markdown level1 summary" >< p > Deletes a file by its ID asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< AnthropicFileDeleteResponse>> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > fileId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the file to delete.</ p >
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicFileDeleteResponse.html" > AnthropicFileDeleteResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicFileDeleteResponse.html" > AnthropicFileDeleteResponse</ a > .</ p >
</ dd >
</ dl >
2025-01-15 16:33:05 +00:00
< a id = "AnthropicClient_AnthropicApiClient_DeleteMessageBatchAsync_" data-uid = "AnthropicClient.AnthropicApiClient.DeleteMessageBatchAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_DeleteMessageBatchAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.DeleteMessageBatchAsync(System.String,System.Threading.CancellationToken)" >
DeleteMessageBatchAsync(string, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L312" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Deletes a message batch asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< MessageBatchDeleteResponse>> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > batchId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the message batch to delete.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchDeleteResponse.html" > MessageBatchDeleteResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchDeleteResponse.html" > MessageBatchDeleteResponse</ a > .</ p >
</ dd >
</ dl >
2025-07-15 04:30:56 +00:00
< a id = "AnthropicClient_AnthropicApiClient_GetFileAsync_" data-uid = "AnthropicClient.AnthropicApiClient.GetFileAsync*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient_GetFileAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.GetFileAsync(System.String,System.Threading.CancellationToken)" >
GetFileAsync(string, CancellationToken)
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L418" >< i class = "bi bi-code-slash" ></ i ></ a >
</ h3 >
< div class = "markdown level1 summary" >< p > Gets a file's content by its ID asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< Stream>> GetFileAsync(string fileId, CancellationToken cancellationToken = default)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > fileId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the file to get the content for.</ p >
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.io.stream" > Stream</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is a stream containing the file content.</ p >
</ dd >
</ dl >
< a id = "AnthropicClient_AnthropicApiClient_GetFileInfoAsync_" data-uid = "AnthropicClient.AnthropicApiClient.GetFileInfoAsync*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient_GetFileInfoAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.GetFileInfoAsync(System.String,System.Threading.CancellationToken)" >
GetFileInfoAsync(string, CancellationToken)
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L410" >< i class = "bi bi-code-slash" ></ i ></ a >
</ h3 >
< div class = "markdown level1 summary" >< p > Gets a file's metadata by its ID asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< AnthropicFile>> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > fileId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the file to get.</ p >
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > .</ p >
</ dd >
</ dl >
2025-01-15 16:33:05 +00:00
< a id = "AnthropicClient_AnthropicApiClient_GetMessageBatchAsync_" data-uid = "AnthropicClient.AnthropicApiClient.GetMessageBatchAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_GetMessageBatchAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.GetMessageBatchAsync(System.String,System.Threading.CancellationToken)" >
GetMessageBatchAsync(string, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L279" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Gets a message batch asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< MessageBatchResponse>> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > batchId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the message batch to get.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > .</ p >
</ dd >
</ dl >
< a id = "AnthropicClient_AnthropicApiClient_GetMessageBatchResultsAsync_" data-uid = "AnthropicClient.AnthropicApiClient.GetMessageBatchResultsAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_GetMessageBatchResultsAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.GetMessageBatchResultsAsync(System.String,System.Threading.CancellationToken)" >
GetMessageBatchResultsAsync(string, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L320" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Gets the results of a message batch asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< IAsyncEnumerable< MessageBatchResultItem>>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > batchId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the message batch to get the results for.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1" > IAsyncEnumerable</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchResultItem.html" > MessageBatchResultItem</ a > >>> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1" > IAsyncEnumerable< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchResultItem.html" > MessageBatchResultItem</ a > .</ p >
</ dd >
</ dl >
2025-01-06 04:04:17 +00:00
< a id = "AnthropicClient_AnthropicApiClient_GetModelAsync_" data-uid = "AnthropicClient.AnthropicApiClient.GetModelAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_GetModelAsync_System_String_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.GetModelAsync(System.String,System.Threading.CancellationToken)" >
GetModelAsync(string, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L377" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-06 04:04:17 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Gets a model by its ID asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< AnthropicModel>> GetModelAsync(string modelId, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-06 04:04:17 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > modelId</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.string" > string</ a ></ dt >
< dd >< p > The ID of the model to get.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-06 04:04:17 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicModel.html" > AnthropicModel</ a > >> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicModel.html" > AnthropicModel</ a > .</ p >
</ dd >
</ dl >
2025-07-15 04:30:56 +00:00
< a id = "AnthropicClient_AnthropicApiClient_ListAllFilesAsync_" data-uid = "AnthropicClient.AnthropicApiClient.ListAllFilesAsync*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient_ListAllFilesAsync_System_Int32_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.ListAllFilesAsync(System.Int32,System.Threading.CancellationToken)" >
ListAllFilesAsync(int, CancellationToken)
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L401" >< i class = "bi bi-code-slash" ></ i ></ a >
</ h3 >
< div class = "markdown level1 summary" >< p > Lists all files asynchronously, returning every page of results.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public IAsyncEnumerable< AnthropicResult< Page< AnthropicFile>>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > limit</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.int32" > int</ a ></ dt >
< dd >< p > The maximum number of files to return in each page.</ p >
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1" > IAsyncEnumerable</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > >>> </ dt >
< dd >< p > An asynchronous enumerable that yields the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > .</ p >
</ dd >
</ dl >
2025-01-15 16:33:05 +00:00
< a id = "AnthropicClient_AnthropicApiClient_ListAllMessageBatchesAsync_" data-uid = "AnthropicClient.AnthropicApiClient.ListAllMessageBatchesAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_ListAllMessageBatchesAsync_System_Int32_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.ListAllMessageBatchesAsync(System.Int32,System.Threading.CancellationToken)" >
ListAllMessageBatchesAsync(int, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L295" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Lists all message batches asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public IAsyncEnumerable< AnthropicResult< Page< MessageBatchResponse>>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > limit</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.int32" > int</ a ></ dt >
< dd >< p > The maximum number of message batches to return in each page.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1" > IAsyncEnumerable</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > >>> </ dt >
< dd >< p > An asynchronous enumerable that yields the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > .</ p >
</ dd >
</ dl >
2025-01-06 04:04:17 +00:00
< a id = "AnthropicClient_AnthropicApiClient_ListAllModelsAsync_" data-uid = "AnthropicClient.AnthropicApiClient.ListAllModelsAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_ListAllModelsAsync_System_Int32_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.ListAllModelsAsync(System.Int32,System.Threading.CancellationToken)" >
ListAllModelsAsync(int, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L368" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-06 04:04:17 +00:00
</ h3 >
2025-05-19 20:34:34 +00:00
< div class = "markdown level1 summary" >< p > Lists all models asynchronously, returning every page of results.</ p >
2025-01-06 04:04:17 +00:00
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public IAsyncEnumerable< AnthropicResult< Page< AnthropicModel>>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-06 04:04:17 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > limit</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.int32" > int</ a ></ dt >
< dd >< p > The maximum number of models to return in each page.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-06 04:04:17 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.collections.generic.iasyncenumerable-1" > IAsyncEnumerable</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicModel.html" > AnthropicModel</ a > >>> </ dt >
< dd >< p > An asynchronous enumerable that yields the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicModel.html" > AnthropicModel</ a > .</ p >
</ dd >
</ dl >
2025-07-15 04:30:56 +00:00
< a id = "AnthropicClient_AnthropicApiClient_ListFilesAsync_" data-uid = "AnthropicClient.AnthropicApiClient.ListFilesAsync*" ></ a >
< h3 id = "AnthropicClient_AnthropicApiClient_ListFilesAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken)" >
ListFilesAsync(PagingRequest?, CancellationToken)
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L392" >< i class = "bi bi-code-slash" ></ i ></ a >
</ h3 >
< div class = "markdown level1 summary" >< p > Lists files asynchronously, returning a single page of results.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< Page< AnthropicFile>>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default)</ code ></ pre >
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.PagingRequest.html" > PagingRequest</ a ></ dt >
< dd >< p > The paging request to use for listing the files.</ p >
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > >>> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicFile.html" > AnthropicFile</ a > .</ p >
</ dd >
</ dl >
2025-01-15 16:33:05 +00:00
< a id = "AnthropicClient_AnthropicApiClient_ListMessageBatchesAsync_" data-uid = "AnthropicClient.AnthropicApiClient.ListMessageBatchesAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_ListMessageBatchesAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.ListMessageBatchesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken)" >
ListMessageBatchesAsync(PagingRequest?, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L286" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-15 16:33:05 +00:00
</ h3 >
< div class = "markdown level1 summary" >< p > Lists the message batches asynchronously.</ p >
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< Page< MessageBatchResponse>>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-15 16:33:05 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.PagingRequest.html" > PagingRequest</ a ></ dt >
< dd >< p > The paging request to use for listing the message batches.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-15 16:33:05 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page</ a > < < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > >>> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.MessageBatchResponse.html" > MessageBatchResponse</ a > .</ p >
</ dd >
</ dl >
2025-01-06 04:04:17 +00:00
< a id = "AnthropicClient_AnthropicApiClient_ListModelsAsync_" data-uid = "AnthropicClient.AnthropicApiClient.ListModelsAsync*" ></ a >
2025-05-19 20:34:34 +00:00
< h3 id = "AnthropicClient_AnthropicApiClient_ListModelsAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_" data-uid = "AnthropicClient.AnthropicApiClient.ListModelsAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken)" >
ListModelsAsync(PagingRequest?, CancellationToken)
2025-07-15 04:30:56 +00:00
< a class = "header-action link-secondary" title = "View source" href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L359" >< i class = "bi bi-code-slash" ></ i ></ a >
2025-01-06 04:04:17 +00:00
</ h3 >
2025-05-19 20:34:34 +00:00
< div class = "markdown level1 summary" >< p > Lists models asynchronously, returning a single page of results.</ p >
2025-01-06 04:04:17 +00:00
</ div >
< div class = "markdown level1 conceptual" ></ div >
< div class = "codewrapper" >
2025-05-19 20:34:34 +00:00
< pre >< code class = "lang-csharp hljs" > public Task< AnthropicResult< Page< AnthropicModel>>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default)</ code ></ pre >
2025-01-06 04:04:17 +00:00
</ div >
< h4 class = "section" > Parameters</ h4 >
< dl class = "parameters" >
< dt >< code > request</ code > < a class = "xref" href = "AnthropicClient.Models.PagingRequest.html" > PagingRequest</ a ></ dt >
< dd >< p > The paging request to use for listing the models.</ p >
2025-05-19 20:34:34 +00:00
</ dd >
< dt >< code > cancellationToken</ code > < a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken" > CancellationToken</ a ></ dt >
< dd >< p > A token to cancel the asynchronous operation.</ p >
2025-01-06 04:04:17 +00:00
</ dd >
</ dl >
< h4 class = "section" > Returns</ h4 >
< dl class = "parameters" >
< dt >< a class = "xref" href = "https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1" > Task</ a > < < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult</ a > < < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page</ a > < < a class = "xref" href = "AnthropicClient.Models.AnthropicModel.html" > AnthropicModel</ a > >>> </ dt >
< dd >< p > A task that represents the asynchronous operation. The task result contains the response as an < a class = "xref" href = "AnthropicResult-1.html" > AnthropicResult< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.Page-1.html" > Page< T> </ a > where T is < a class = "xref" href = "AnthropicClient.Models.AnthropicModel.html" > AnthropicModel</ a > .</ p >
</ dd >
</ dl >
2024-07-07 16:16:55 -05:00
</ article >
< div class = "contribution d-print-none" >
2025-05-19 20:34:34 +00:00
< a href = "https://github.com/StevanFreeborn/anthropic-client/blob/main/src/AnthropicClient/AnthropicApiClient.cs/#L13" class = "edit-link" > Edit this page</ a >
2024-07-07 16:16:55 -05:00
</ div >
</ div >
< div class = "affix" >
< nav id = "affix" ></ nav >
</ div >
</ main >
< div class = "container-xxl search-results" id = "search-results" ></ div >
< footer class = "border-top text-secondary" >
< div class = "container-xxl" >
< div class = "flex-fill" >
< span > Made with < a href = "https://dotnet.github.io/docfx" > docfx</ a ></ span >
</ div >
</ div >
</ footer >
</ body >
</ html >