Skip to content

Commit

Permalink
Merge pull request #35 from pavel-zhur/feature/gpt4o
Browse files Browse the repository at this point in the history
gpt-4o billing support
  • Loading branch information
pavel-zhur authored Jul 10, 2024
2 parents 88bcacd + 00311d9 commit 46b4405
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OneShelf.Billing/OneShelf.Billing.Api/Functions/All.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,19 @@ protected override async Task<AllResponse> 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",
},
}
Expand Down

0 comments on commit 46b4405

Please sign in to comment.