support gpt-4o-mini

This commit is contained in:
Sakurasan
2024-07-19 12:10:49 +08:00
parent 1284ad9dec
commit c11824f5aa
2 changed files with 26 additions and 27 deletions

View File

@@ -97,6 +97,8 @@ func Cost(model string, promptCount, completionCount int) float64 {
cost = 0.01*float64(prompt/1000) + 0.03*float64(completion/1000)
case "gpt-4o", "gpt-4o-2024-05-13":
cost = 0.005*float64(prompt/1000) + 0.015*float64(completion/1000)
case "gpt-4o-mini", "gpt-4o-mini-2024-07-18":
cost = 0.00015*float64(prompt/1000) + 0.0006*float64(completion/1000)
case "whisper-1":
// 0.006$/min
cost = 0.006 * float64(prompt+completion) / 60