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
Unverified
Commit
16bfae17
authored
Jul 20, 2026
by
feitianbubu
Committed by
GitHub
Jul 20, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: drop realtime beta header for ga models and register new ones (#6032)
parent
d0e23e1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
relay/channel/openai/adaptor.go
+9
-2
relay/channel/openai/constant.go
+2
-0
No files found.
relay/channel/openai/adaptor.go
View file @
16bfae17
...
...
@@ -201,19 +201,26 @@ func (a *Adaptor) SetupRequestHeader(c *gin.Context, header *http.Header, info *
}
}
if
info
.
RelayMode
==
relayconstant
.
RelayModeRealtime
{
// OpenAI 已下线 Realtime Beta API,GA 模型收到 beta 标识会以 beta_api_shape_disabled 拒绝;
// 仅对遗留 preview 模型保留 beta 标识
legacyRealtimeBeta
:=
strings
.
Contains
(
info
.
UpstreamModelName
,
"-realtime-preview"
)
swp
:=
c
.
Request
.
Header
.
Get
(
"Sec-WebSocket-Protocol"
)
if
swp
!=
""
{
items
:=
[]
string
{
"realtime"
,
"openai-insecure-api-key."
+
info
.
ApiKey
,
"openai-beta.realtime-v1"
,
}
if
legacyRealtimeBeta
{
items
=
append
(
items
,
"openai-beta.realtime-v1"
)
}
header
.
Set
(
"Sec-WebSocket-Protocol"
,
strings
.
Join
(
items
,
","
))
//req.Header.Set("Sec-WebSocket-Key", c.Request.Header.Get("Sec-WebSocket-Key"))
//req.Header.Set("Sec-Websocket-Extensions", c.Request.Header.Get("Sec-Websocket-Extensions"))
//req.Header.Set("Sec-Websocket-Version", c.Request.Header.Get("Sec-Websocket-Version"))
}
else
{
header
.
Set
(
"openai-beta"
,
"realtime=v1"
)
if
legacyRealtimeBeta
{
header
.
Set
(
"openai-beta"
,
"realtime=v1"
)
}
if
!
hasAuthOverride
{
header
.
Set
(
"Authorization"
,
"Bearer "
+
info
.
ApiKey
)
}
...
...
relay/channel/openai/constant.go
View file @
16bfae17
...
...
@@ -58,6 +58,8 @@ var ModelList = []string{
"gpt-realtime"
,
"gpt-realtime-2025-08-28"
,
"gpt-realtime-mini"
,
"gpt-realtime-mini-2025-10-06"
,
"gpt-realtime-mini-2025-12-15"
,
"gpt-realtime-1.5"
,
"gpt-realtime-2"
,
"gpt-realtime-2.1"
,
"gpt-realtime-2.1-mini"
,
"gpt-realtime-whisper"
,
"gpt-realtime-translate"
,
"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