mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-16 13:13:41 +08:00
✨ feat: support zhipu new API (#44)
This commit is contained in:
@@ -78,6 +78,11 @@ func init() {
|
||||
"chatglm_pro": {0.7143, ChannelTypeZhipu}, // ¥0.01 / 1k tokens
|
||||
"chatglm_std": {0.3572, ChannelTypeZhipu}, // ¥0.005 / 1k tokens
|
||||
"chatglm_lite": {0.1429, ChannelTypeZhipu}, // ¥0.002 / 1k tokens
|
||||
"glm-3-turbo": {0.3572, ChannelTypeZhipu}, // ¥0.005 / 1k tokens
|
||||
"glm-4": {0.7143, ChannelTypeZhipu}, // ¥0.01 / 1k tokens
|
||||
"glm-4v": {0.7143, ChannelTypeZhipu}, // ¥0.01 / 1k tokens
|
||||
"embedding-2": {0.0357, ChannelTypeZhipu}, // ¥0.0005 / 1k tokens
|
||||
"cogview-3": {17.8571, ChannelTypeZhipu}, // ¥0.25 / 1张图片
|
||||
"qwen-turbo": {0.5715, ChannelTypeAli}, // ¥0.008 / 1k tokens // https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing
|
||||
"qwen-plus": {1.4286, ChannelTypeAli}, // ¥0.02 / 1k tokens
|
||||
"qwen-max": {1.4286, ChannelTypeAli}, // ¥0.02 / 1k tokens
|
||||
|
||||
@@ -231,7 +231,8 @@ func calculateToken(model string, size string, n int, quality string) (int, erro
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0, errors.New("size not supported for this image model")
|
||||
imageCostRatio = 1
|
||||
// return 0, errors.New("size not supported for this image model")
|
||||
}
|
||||
|
||||
return int(imageCostRatio*1000) * n, nil
|
||||
|
||||
Reference in New Issue
Block a user