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
ec8f3dce
authored
Apr 24, 2026
by
Calcium-Ion
Committed by
GitHub
Apr 24, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4412 from xyfacai/fix/image-n
fix(image): only price image model use N ratio
parents
65b16547
69ba18d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
relay/image_handler.go
+2
-0
No files found.
relay/image_handler.go
View file @
ec8f3dce
...
...
@@ -122,9 +122,11 @@ func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *type
// calculation (both price-based and ratio-based paths).
// Adaptors may have already set a more accurate count from the
// upstream response; only set the default when they haven't.
if
info
.
PriceData
.
UsePrice
{
// only price model use N ratio
if
_
,
hasN
:=
info
.
PriceData
.
OtherRatios
[
"n"
];
!
hasN
{
info
.
PriceData
.
AddOtherRatio
(
"n"
,
float64
(
imageN
))
}
}
if
usage
.
(
*
dto
.
Usage
)
.
TotalTokens
==
0
{
usage
.
(
*
dto
.
Usage
)
.
TotalTokens
=
1
...
...
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