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
bc197184
authored
Sep 30, 2025
by
Seefs
Committed by
GitHub
Sep 30, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1926 from seefs001/fix/claude-beta
fix: claude beta=true
parents
65856164
946da497
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
relay/channel/claude/adaptor.go
+7
-2
relay/common/relay_info.go
+5
-1
No files found.
relay/channel/claude/adaptor.go
View file @
bc197184
...
@@ -52,11 +52,16 @@ func (a *Adaptor) Init(info *relaycommon.RelayInfo) {
...
@@ -52,11 +52,16 @@ func (a *Adaptor) Init(info *relaycommon.RelayInfo) {
}
}
func
(
a
*
Adaptor
)
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
func
(
a
*
Adaptor
)
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
baseURL
:=
""
if
a
.
RequestMode
==
RequestModeMessage
{
if
a
.
RequestMode
==
RequestModeMessage
{
return
fmt
.
Sprintf
(
"%s/v1/messages"
,
info
.
ChannelBaseUrl
),
nil
baseURL
=
fmt
.
Sprintf
(
"%s/v1/messages"
,
info
.
ChannelBaseUrl
)
}
else
{
}
else
{
return
fmt
.
Sprintf
(
"%s/v1/complete"
,
info
.
ChannelBaseUrl
),
nil
baseURL
=
fmt
.
Sprintf
(
"%s/v1/complete"
,
info
.
ChannelBaseUrl
)
}
}
if
info
.
IsClaudeBetaQuery
{
baseURL
=
baseURL
+
"?beta=true"
}
return
baseURL
,
nil
}
}
func
(
a
*
Adaptor
)
SetupRequestHeader
(
c
*
gin
.
Context
,
req
*
http
.
Header
,
info
*
relaycommon
.
RelayInfo
)
error
{
func
(
a
*
Adaptor
)
SetupRequestHeader
(
c
*
gin
.
Context
,
req
*
http
.
Header
,
info
*
relaycommon
.
RelayInfo
)
error
{
...
...
relay/common/relay_info.go
View file @
bc197184
...
@@ -105,7 +105,8 @@ type RelayInfo struct {
...
@@ -105,7 +105,8 @@ type RelayInfo struct {
UserQuota
int
UserQuota
int
RelayFormat
types
.
RelayFormat
RelayFormat
types
.
RelayFormat
SendResponseCount
int
SendResponseCount
int
FinalPreConsumedQuota
int
// 最终预消耗的配额
FinalPreConsumedQuota
int
// 最终预消耗的配额
IsClaudeBetaQuery
bool
// /v1/messages?beta=true
PriceData
types
.
PriceData
PriceData
types
.
PriceData
...
@@ -279,6 +280,9 @@ func GenRelayInfoClaude(c *gin.Context, request dto.Request) *RelayInfo {
...
@@ -279,6 +280,9 @@ func GenRelayInfoClaude(c *gin.Context, request dto.Request) *RelayInfo {
info
.
ClaudeConvertInfo
=
&
ClaudeConvertInfo
{
info
.
ClaudeConvertInfo
=
&
ClaudeConvertInfo
{
LastMessagesType
:
LastMessageTypeNone
,
LastMessagesType
:
LastMessageTypeNone
,
}
}
if
c
.
Query
(
"beta"
)
==
"true"
{
info
.
IsClaudeBetaQuery
=
true
}
return
info
return
info
}
}
...
...
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