From 00311d914fd4f683b853469e44e1e39b5bc19e67 Mon Sep 17 00:00:00 2001 From: Pavel Zhur Date: Wed, 10 Jul 2024 15:02:04 +0300 Subject: [PATCH] gpt-4o billing support --- OneShelf.Billing/OneShelf.Billing.Api/Functions/All.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OneShelf.Billing/OneShelf.Billing.Api/Functions/All.cs b/OneShelf.Billing/OneShelf.Billing.Api/Functions/All.cs index 62fd634e..000390cf 100644 --- a/OneShelf.Billing/OneShelf.Billing.Api/Functions/All.cs +++ b/OneShelf.Billing/OneShelf.Billing.Api/Functions/All.cs @@ -48,18 +48,19 @@ protected override async Task Execute(AllRequest allRequest) "dall-e-3" => x.Count * .04f, "dall-e-2" => x.Count * .018f, "gpt-4-1106-preview" or "gpt-4-0125-preview" => .01f * x.InputTokens / 1000 + .03f * x.OutputTokens / 1000, + "gpt-4o" => (.01f * x.InputTokens / 1000 + .03f * x.OutputTokens / 1000) * 0.5f, _ => null, }, Category = x.UseCase switch { "own chatter" => x.Model switch { - "gpt-4-1106-preview" => "chat text", + "gpt-4-1106-preview" or "gpt-4-0125-preview" or "gpt-4o" => "chat text", _ => "chat images", }, _ => x.Model switch { - "gpt-4-1106-preview" => "song text", + "gpt-4-1106-preview" or "gpt-4-0125-preview" or "gpt-4o" => "song text", _ => "song images", }, }