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
3a9f41ee
authored
Sep 04, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: temp disable /messages/count_tokens
parent
32c26192
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
router/relay-router.go
+2
-1
router/relay_router_test.go
+0
-14
No files found.
router/relay-router.go
View file @
3a9f41ee
...
@@ -85,7 +85,8 @@ func SetRelayRouter(router *gin.Engine) {
...
@@ -85,7 +85,8 @@ func SetRelayRouter(router *gin.Engine) {
httpRouter
.
Use
(
middleware
.
Distribute
())
httpRouter
.
Use
(
middleware
.
Distribute
())
// claude related routes
// claude related routes
httpRouter
.
POST
(
"/messages/count_tokens"
,
controller
.
CountClaudeTokens
)
// TODO: /messages/count_tokens is disabled. The current controller.CountClaudeTokens
// httpRouter.POST("/messages/count_tokens", controller.CountClaudeTokens)
httpRouter
.
POST
(
"/messages"
,
func
(
c
*
gin
.
Context
)
{
httpRouter
.
POST
(
"/messages"
,
func
(
c
*
gin
.
Context
)
{
controller
.
Relay
(
c
,
types
.
RelayFormatClaude
)
controller
.
Relay
(
c
,
types
.
RelayFormatClaude
)
})
})
...
...
router/relay_router_test.go
View file @
3a9f41ee
...
@@ -89,20 +89,6 @@ func TestListModelsSupportsOpenAIAndGeminiAuthentication(t *testing.T) {
...
@@ -89,20 +89,6 @@ func TestListModelsSupportsOpenAIAndGeminiAuthentication(t *testing.T) {
}
}
}
}
func
TestRelayRouterRegistersClaudeTokenCountingEndpoint
(
t
*
testing
.
T
)
{
gin
.
SetMode
(
gin
.
TestMode
)
engine
:=
gin
.
New
()
SetRelayRouter
(
engine
)
for
_
,
route
:=
range
engine
.
Routes
()
{
if
route
.
Method
==
http
.
MethodPost
&&
route
.
Path
==
"/v1/messages/count_tokens"
{
return
}
}
t
.
Fatal
(
"POST /v1/messages/count_tokens route is not registered"
)
}
func
setupRelayRouterTestDB
(
t
*
testing
.
T
)
{
func
setupRelayRouterTestDB
(
t
*
testing
.
T
)
{
t
.
Helper
()
t
.
Helper
()
...
...
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