diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Authorizations..g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Authorizations.ApiKeyInHeader.g.cs
similarity index 63%
rename from src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Authorizations..g.cs
rename to src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Authorizations.ApiKeyInHeader.g.cs
index d8572e5..8192fb9 100644
--- a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Authorizations..g.cs
+++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Authorizations.ApiKeyInHeader.g.cs
@@ -9,12 +9,16 @@ public sealed partial class AnthropicApi
/// Authorize using ApiKey authentication.
///
///
- public void AuthorizeUsingApiKey(
+ public void AuthorizeUsingApiKeyInHeader(
string apiKey)
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));
- _httpClient.DefaultRequestHeaders.Add("x-api-key", apiKey);
+ _authorization = new global::Anthropic.EndPointAuthorization
+ {
+ Name = "x-api-key",
+ Value = apiKey,
+ };
}
}
}
\ No newline at end of file
diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Constructors..g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Constructors..g.cs
index bd96e89..11c1346 100644
--- a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Constructors..g.cs
+++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.Constructors..g.cs
@@ -5,15 +5,16 @@ namespace Anthropic
{
public sealed partial class AnthropicApi
{
- ///
+ ///
public AnthropicApi(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null) : this(httpClient, baseUri)
+ global::System.Uri? baseUri = null,
+ global::Anthropic.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization)
{
Authorizing(_httpClient, ref apiKey);
- AuthorizeUsingApiKey(apiKey);
+ AuthorizeUsingApiKeyInHeader(apiKey);
Authorized(_httpClient);
}
diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.CreateMessage.g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.CreateMessage.g.cs
index cba4e2c..8bb6bf8 100644
--- a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.CreateMessage.g.cs
+++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.CreateMessage.g.cs
@@ -50,6 +50,13 @@ partial void ProcessCreateMessageResponseContent(
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+
+ if (_authorization != null)
+ {{
+ httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: _authorization.Name,
+ parameter: _authorization.Value);
+ }}
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
diff --git a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.g.cs b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.g.cs
index 852baf3..be8297e 100644
--- a/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.g.cs
+++ b/src/libs/Anthropic/Generated/Anthropic.AnthropicApi.g.cs
@@ -16,6 +16,7 @@ public sealed partial class AnthropicApi : global::Anthropic.IAnthropicApi, glob
public const string BaseUrl = "https://api.anthropic.com/v1";
private readonly global::System.Net.Http.HttpClient _httpClient;
+ private global::Anthropic.EndPointAuthorization? _authorization;
///
///
@@ -29,13 +30,16 @@ public sealed partial class AnthropicApi : global::Anthropic.IAnthropicApi, glob
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
///
///
- ///
+ ///
+ ///
public AnthropicApi(
global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null)
+ global::System.Uri? baseUri = null,
+ global::Anthropic.EndPointAuthorization? authorization = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
+ _authorization = authorization;
Initialized(_httpClient);
}
diff --git a/src/libs/Anthropic/Generated/Anthropic.PathBuilder.g.cs b/src/libs/Anthropic/Generated/Anthropic.PathBuilder.g.cs
index 46ca187..a3990a7 100644
--- a/src/libs/Anthropic/Generated/Anthropic.PathBuilder.g.cs
+++ b/src/libs/Anthropic/Generated/Anthropic.PathBuilder.g.cs
@@ -224,4 +224,20 @@ public PathBuilder AddOptionalParameter(
/// The constructed URL.
public override string ToString() => _stringBuilder.ToString();
}
+
+ ///
+ ///
+ ///
+ public class EndPointAuthorization
+ {
+ ///
+ ///
+ ///
+ public string Name { get; set; } = string.Empty;
+
+ ///
+ ///
+ ///
+ public string Value { get; set; } = string.Empty;
+ }
}
\ No newline at end of file