1
0

feat: Implement OpenRouter API client for managing headers and retrieving model pricing.

This commit is contained in:
2026-03-05 11:52:08 +01:00
parent 5fb914dbc8
commit 941894761a
3 changed files with 29 additions and 1 deletions

View File

@@ -88,9 +88,13 @@ AnsiConsole.Write(infoTable);
AnsiConsole.WriteLine();
// ── Build the chat client with tool-calling support ─────────────────────
var httpClient = new HttpClient();
OpenRouterHeaders.ApplyTo(httpClient);
var openAiClient = new OpenAIClient(new ApiKeyCredential(apiKey), new OpenAIClientOptions
{
Endpoint = new Uri(endpoint)
Endpoint = new Uri(endpoint),
Transport = new System.ClientModel.Primitives.HttpClientPipelineTransport(httpClient)
});
IChatClient innerClient = openAiClient.GetChatClient(model).AsIChatClient();