From 43b6ece0a5a8f7142f02a1117ab3064930bf387a Mon Sep 17 00:00:00 2001
From: Timothy Carambat <rambat1010@gmail.com>
Date: Wed, 11 Sep 2024 13:08:10 -0700
Subject: [PATCH] Update OpenAI models and prices #2261 (#2269)

* Update OpenAI models

* Sort OpenAI models by created timestamp in ascending order

* Update OpenAI models price

* uncheck fallback listing (even if old)
closes #2261

* linting

---------

Co-authored-by: Yaner <1468275133@qq.com>
---
 .../utils/agents/aibitat/providers/openai.js  | 22 +++++++++++++------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/server/utils/agents/aibitat/providers/openai.js b/server/utils/agents/aibitat/providers/openai.js
index 2866a7592..04e3af032 100644
--- a/server/utils/agents/aibitat/providers/openai.js
+++ b/server/utils/agents/aibitat/providers/openai.js
@@ -9,10 +9,22 @@ const { RetryError } = require("../error.js");
 class OpenAIProvider extends Provider {
   model;
   static COST_PER_TOKEN = {
+    "gpt-3.5-turbo": {
+      input: 0.0015,
+      output: 0.002,
+    },
+    "gpt-3.5-turbo-16k": {
+      input: 0.003,
+      output: 0.004,
+    },
     "gpt-4": {
       input: 0.03,
       output: 0.06,
     },
+    "gpt-4-turbo": {
+      input: 0.01,
+      output: 0.03,
+    },
     "gpt-4o": {
       input: 0.005,
       output: 0.015,
@@ -21,13 +33,9 @@ class OpenAIProvider extends Provider {
       input: 0.06,
       output: 0.12,
     },
-    "gpt-3.5-turbo": {
-      input: 0.0015,
-      output: 0.002,
-    },
-    "gpt-3.5-turbo-16k": {
-      input: 0.003,
-      output: 0.004,
+    "gpt-4o-mini": {
+      input: 0.00015,
+      output: 0.0006,
     },
   };