Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task ShouldEndChatAsync()
Request.Create()
.UsingPost()
.WithPath("/api/chats/end")
.WithHeader("Authorization", $"Bearer {this.apiKey}")
.WithHeader("X-API-Key", this.apiKey)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBody(expectedBody)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task ShouldStartChatAsync()
Request.Create()
.UsingPost()
.WithPath("/api/chats/start")
.WithHeader("Authorization", $"Bearer {this.apiKey}")
.WithHeader("X-API-Key", this.apiKey)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBody(expectedBody))
.RespondWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task ShouldStreamChatAsync()
Request.Create()
.UsingPost()
.WithPath("/api/chats/stream")
.WithHeader("Authorization", $"Bearer {this.apiKey}")
.WithHeader("X-API-Key", this.apiKey)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBody(expectedBody))
.RespondWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task ShouldEndChatAsync()
Request.Create()
.UsingPost()
.WithPath("/api/v2/chats/end")
.WithHeader("Authorization", $"Bearer {this.apiKey}")
.WithHeader("X-API-Key", this.apiKey)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBody(expectedBody)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task ShouldStartChatAsync()
Request.Create()
.UsingPost()
.WithPath("/api/v2/chats/start")
.WithHeader("Authorization", $"Bearer {this.apiKey}")
.WithHeader("X-API-Key", this.apiKey)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBody(expectedBody))
.RespondWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task ShouldStreamChatAsync()
Request.Create()
.UsingPost()
.WithPath("/api/v2/chats/stream")
.WithHeader("Authorization", $"Bearer {this.apiKey}")
.WithHeader("X-API-Key", this.apiKey)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBody(expectedBody))
.RespondWith(
Expand Down
8 changes: 3 additions & 5 deletions Standard.AI.PeerLLM/Brokers/PeerLLMs/PeerLLMBroker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.Json;
Expand Down Expand Up @@ -106,10 +105,9 @@ private HttpClient SetupHttpClient()

if (!string.IsNullOrWhiteSpace(this.peerLLMConfiguration.ApiKey))
{
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
scheme: "Bearer",
parameter: this.peerLLMConfiguration.ApiKey);
httpClient.DefaultRequestHeaders.Add(
name: "X-API-Key",
value: this.peerLLMConfiguration.ApiKey);
}

return httpClient;
Expand Down