Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d953b984
authored
Jan 03, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support gpt-4o-mini-realtime-preview
parent
16afc5b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
25 deletions
+34
-25
common/model-ratio.go
+32
-24
relay/channel/openai/constant.go
+2
-1
No files found.
common/model-ratio.go
View file @
d953b984
...
...
@@ -32,30 +32,34 @@ var defaultModelRatio = map[string]float64{
"gpt-4-0613"
:
15
,
"gpt-4-32k"
:
30
,
//"gpt-4-32k-0314": 30, //deprecated
"gpt-4-32k-0613"
:
30
,
"gpt-4-1106-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-0125-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-turbo-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-vision-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-1106-vision-preview"
:
5
,
// $10 / 1M tokens
"chatgpt-4o-latest"
:
2.5
,
// $5 / 1M tokens
"gpt-4o"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-audio-preview"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-audio-preview-2024-10-01"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-2024-05-13"
:
2.5
,
// $5 / 1M tokens
"gpt-4o-2024-08-06"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-2024-11-20"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-realtime-preview"
:
2.5
,
"o1"
:
7.5
,
"o1-2024-12-17"
:
7.5
,
"o1-preview"
:
7.5
,
"o1-preview-2024-09-12"
:
7.5
,
"o1-mini"
:
1.5
,
"o1-mini-2024-09-12"
:
1.5
,
"gpt-4o-mini"
:
0.075
,
"gpt-4o-mini-2024-07-18"
:
0.075
,
"gpt-4-turbo"
:
5
,
// $0.01 / 1K tokens
"gpt-4-turbo-2024-04-09"
:
5
,
// $0.01 / 1K tokens
"gpt-4-32k-0613"
:
30
,
"gpt-4-1106-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-0125-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-turbo-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-vision-preview"
:
5
,
// $10 / 1M tokens
"gpt-4-1106-vision-preview"
:
5
,
// $10 / 1M tokens
"chatgpt-4o-latest"
:
2.5
,
// $5 / 1M tokens
"gpt-4o"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-audio-preview"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-audio-preview-2024-10-01"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-2024-05-13"
:
2.5
,
// $5 / 1M tokens
"gpt-4o-2024-08-06"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-2024-11-20"
:
1.25
,
// $2.5 / 1M tokens
"gpt-4o-realtime-preview"
:
2.5
,
"gpt-4o-realtime-preview-2024-10-01"
:
2.5
,
"gpt-4o-realtime-preview-2024-12-17"
:
2.5
,
"gpt-4o-mini-realtime-preview"
:
0.3
,
"gpt-4o-mini-realtime-preview-2024-12-17"
:
0.3
,
"o1"
:
7.5
,
"o1-2024-12-17"
:
7.5
,
"o1-preview"
:
7.5
,
"o1-preview-2024-09-12"
:
7.5
,
"o1-mini"
:
1.5
,
"o1-mini-2024-09-12"
:
1.5
,
"gpt-4o-mini"
:
0.075
,
"gpt-4o-mini-2024-07-18"
:
0.075
,
"gpt-4-turbo"
:
5
,
// $0.01 / 1K tokens
"gpt-4-turbo-2024-04-09"
:
5
,
// $0.01 / 1K tokens
//"gpt-3.5-turbo-0301": 0.75, //deprecated
"gpt-3.5-turbo"
:
0.25
,
"gpt-3.5-turbo-0613"
:
0.75
,
...
...
@@ -431,6 +435,8 @@ func GetAudioRatio(name string) float64 {
return
20
}
else
if
strings
.
HasPrefix
(
name
,
"gpt-4o-audio"
)
{
return
40
}
else
if
strings
.
HasPrefix
(
name
,
"gpt-4o-mini-realtime"
)
{
return
10
/
0.6
}
return
20
}
...
...
@@ -438,6 +444,8 @@ func GetAudioRatio(name string) float64 {
func
GetAudioCompletionRatio
(
name
string
)
float64
{
if
strings
.
HasPrefix
(
name
,
"gpt-4o-realtime"
)
{
return
2
}
else
if
strings
.
HasPrefix
(
name
,
"gpt-4o-mini-realtime"
)
{
return
2
}
return
2
}
...
...
relay/channel/openai/constant.go
View file @
d953b984
...
...
@@ -15,7 +15,8 @@ var ModelList = []string{
"o1-mini"
,
"o1-mini-2024-09-12"
,
"o1"
,
"o1-2024-12-17"
,
"gpt-4o-audio-preview"
,
"gpt-4o-audio-preview-2024-10-01"
,
"gpt-4o-realtime-preview"
,
"gpt-4o-realtime-preview-2024-10-01"
,
"gpt-4o-realtime-preview"
,
"gpt-4o-realtime-preview-2024-10-01"
,
"gpt-4o-realtime-preview-2024-12-17"
,
"gpt-4o-mini-realtime-preview"
,
"gpt-4o-mini-realtime-preview-2024-12-17"
,
"text-embedding-ada-002"
,
"text-embedding-3-small"
,
"text-embedding-3-large"
,
"text-curie-001"
,
"text-babbage-001"
,
"text-ada-001"
,
"text-moderation-latest"
,
"text-moderation-stable"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment