MCPcopy Create free account

hub / github.com/QuantumNous/new-api / functions

Functions9,514 in github.com/QuantumNous/new-api

↓ 6 callersFunctionpaymentReturnPath
(suffix string)
controller/return_path.go:9
↓ 6 callersFunctionpopulateUserCache
(user User)
model/user_cache.go:76
↓ 6 callersFunctionpricingEndpointAdvancedCustomConfig
(routes ...dto.AdvancedCustomRoute)
model/pricing_endpoint_test.go:59
↓ 6 callersFunctionpricingEndpointTypesByModel
(t *testing.T)
model/pricing_endpoint_test.go:67
↓ 6 callersFunctionredisFixedWindowTake
(ctx context.Context, key string, maxRequestNum int, duration int64)
middleware/rate-limit.go:65
↓ 6 callersFunctionrefreshSubscriptionUserGroupCache
(userId int, operation string)
model/subscription.go:560
↓ 6 callersFunctionrequestContextDone
(c *gin.Context)
relay/helper/common.go:41
↓ 6 callersFunctionrequireOptionValue
(t *testing.T, db *gorm.DB, key string)
model/frontend_option_migration_test.go:30
↓ 6 callersFunctionresetSession
()
web/src/features/auth/hooks/use-oauth-login.ts:62
↓ 6 callersFunctionresponsesStreamEvent
(eventType string, payload dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:222
↓ 6 callersFunctionseedToken
(t *testing.T, db *gorm.DB, userID int, name string, rawKey string)
controller/token_test.go:163
↓ 6 callersFunctionseededRandom
(seed: number)
web/src/features/pricing/lib/seed.ts:39
↓ 6 callersFunctionsetCookie
( name: string, value: string, maxAge: number = DEFAULT_MAX_AGE )
web/src/lib/cookies.ts:44
↓ 6 callersFunctiontoIntlLocale
(value?: string | null)
web/src/i18n/languages.ts:86
↓ 6 callersFunctionupdateCurrentVersionContent
( message: Message, content: string )
web/src/features/playground/lib/message/message-utils.ts:63
↓ 6 callersFunctionuseChartTheme
()
web/src/lib/use-chart-theme.ts:32
↓ 6 callersFunctionuseDialogState
( initialState: T | null = null )
web/src/hooks/use-dialog.ts:97
↓ 6 callersFunctionuseFrontendOptionMigrationDB
(t *testing.T)
model/frontend_option_migration_test.go:14
↓ 6 callersFunctionuseOpenInContext
()
web/src/components/ai-elements/open-in-chat.tsx:206
↓ 6 callersFunctionuseRedemptions
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:66
↓ 6 callersFunctionuseResetForm
( form: UseFormReturn<TFieldValues>, values: DefaultValues<TFieldValues> | undefined )
web/src/features/system-settings/hooks/use-reset-form.ts:27
↓ 6 callersFunctionuseUsers
()
web/src/features/users/components/users-provider.tsx:60
↓ 6 callersFunctionuserSessionCacheDeadline
()
model/user_session.go:129
↓ 6 callersFunctionwithRelayHTTPTransportSettings
(t *testing.T)
service/http_client_transport_test.go:21
↓ 5 callersMethodApply
(query *gorm.DB)
model/channel.go:104
↓ 5 callersFunctionApplyChannelAffinityOverrideTemplate
ApplyChannelAffinityOverrideTemplate merges per-rule channel override templates onto the selected channel override config.
service/channel_affinity.go:533
↓ 5 callersFunctionAutoGroups2JsonString
()
setting/auto_group.go:39
↓ 5 callersFunctionCapabilities
Capabilities returns the full resource/action matrix the subject is allowed.
service/authz/resolver.go:38
↓ 5 callersMethodCloseIdleConnections
()
service/http_transport_sharded.go:97
↓ 5 callersMethodConvertImageRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest)
relay/channel/adapter.go:25
↓ 5 callersMethodConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/adapter.go:26
↓ 5 callersFunctionConvertRequestByID
(c context.Context, info convmeta.Meta, converter string, request any)
relaykit/relayconvert/request_registry.go:214
↓ 5 callersFunctionConvertStreamResponse
(c context.Context, info convmeta.Meta, target types.RelayFormat, response any)
relaykit/relayconvert/response_registry.go:247
↓ 5 callersFunctionCountTextToken
CountTextToken 统计文本的token数量,仅OpenAI模型使用tokenizer,其余模型使用估算
service/token_counter.go:402
↓ 5 callersMethodDelete
()
model/channel.go:601
↓ 5 callersFunctionEnableWorker
()
setting/system_setting/system_setting_old.go:8
↓ 5 callersMethodFlush
()
relay/channel/aws/relay_aws_test.go:55
↓ 5 callersFunctionGenerateTextOtherInfo
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, modelRatio, groupRatio, completionRatio float64, cacheTo
service/log_info_generate.go:72
↓ 5 callersFunctionGetAudioCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:631
↓ 5 callersFunctionGetAudioRatio
(name string)
setting/ratio_setting/model_ratio.go:623
↓ 5 callersFunctionGetBodyStorage
GetBodyStorage 获取请求体存储对象(用于需要多次读取的场景)
common/gin.go:86
↓ 5 callersFunctionGetByTaskId
(userId int, taskId string)
model/task.go:337
↓ 5 callersMethodGetCacheCreation1hTokens
()
relaykit/dto/claude.go:581
↓ 5 callersMethodGetCacheCreation5mTokens
()
relaykit/dto/claude.go:574
↓ 5 callersFunctionGetCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:436
↓ 5 callersFunctionGetConsoleSetting
GetConsoleSetting 获取 ConsoleSetting 配置实例
setting/console_setting/config.go:37
↓ 5 callersFunctionGetDiskCacheDir
GetDiskCacheDir 获取统一的磁盘缓存目录 注意:每次调用都会重新计算,以响应配置变化
common/disk_cache.go:25
↓ 5 callersFunctionGetDiskCachePath
GetDiskCachePath 获取磁盘缓存目录
common/disk_cache_config.go:65
↓ 5 callersFunctionGetEpayClient
()
controller/topup.go:135
↓ 5 callersFunctionGetGroupGroupRatio
(userGroup, usingGroup string)
setting/ratio_setting/group_ratio.go:88
↓ 5 callersMethodGetKeys
()
model/channel.go:175
↓ 5 callersMethodGetMaskedKey
()
model/token.go:80
↓ 5 callersFunctionGetModelPrice
GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false
setting/ratio_setting/model_ratio.go:360
↓ 5 callersMethodGetModels
()
model/channel.go:289
↓ 5 callersFunctionGetMonitorSetting
()
setting/operation_setting/monitor_setting.go:33
↓ 5 callersMethodGetNextEnabledKey
()
model/channel.go:199
↓ 5 callersMethodGetPage
()
common/page_info.go:29
↓ 5 callersFunctionGetTokenById
(id int)
model/token.go:270
↓ 5 callersFunctionGetTokenByKey
(key string, fromDB bool)
model/token.go:287
↓ 5 callersMethodGetTokenCountMeta
()
relaykit/dto/request_common.go:9
↓ 5 callersFunctionGetToolPrice
GetToolPrice is a convenience wrapper when no model name is needed.
setting/operation_setting/tools.go:217
↓ 5 callersFunctionGetToolPriceForModel
GetToolPriceForModel returns the price ($/1K calls) for a tool given a model name. Lookup: longest prefix match → tool default → 0.
setting/operation_setting/tools.go:192
↓ 5 callersFunctionGetTopupGroupRatio
(name string)
common/topup-ratio.go:32
↓ 5 callersFunctionGetUserUsableGroups
(userGroup string)
service/group.go:14
↓ 5 callersFunctionGetUsernameById
GetUsernameById gets username from Redis first, falls back to DB if needed
model/user.go:1372
↓ 5 callersFunctionHasGeminiUsageMetadataTokens
(metadata *GeminiUsageMetadata)
relaykit/dto/billing_usage.go:190
↓ 5 callersFunctionIncreaseTokenQuota
(tokenId int, key string, quota int)
model/token.go:405
↓ 5 callersMethodInsert
()
model/subscription.go:230
↓ 5 callersFunctionIssueAccessToken
(identity AuthIdentity)
service/auth_token.go:60
↓ 5 callersFunctionListModels
(c *gin.Context, modelType int)
controller/model.go:209
↓ 5 callersFunctionLoadFileSource
LoadFileSource 加载文件源数据 这是统一的入口,会自动处理缓存和不同的来源类型
service/file_service.go:47
↓ 5 callersMethodLoadFromDB
LoadFromDB 从数据库加载配置
setting/config/config.go:42
↓ 5 callersFunctionNewFileSourceFromData
(data string, mimeType string)
relaykit/types/file_source.go:134
↓ 5 callersFunctionNewGeminiChatBillingUsage
(metadata *GeminiUsageMetadata)
relaykit/dto/billing_usage.go:106
↓ 5 callersFunctionNewRWMap
()
types/rw_map.go:27
↓ 5 callersFunctionNewUserSortOptions
(sortBy string, sortOrder string)
model/user.go:36
↓ 5 callersFunctionOaiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:75
↓ 5 callersFunctionOaiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:104
↓ 5 callersFunctionOpenaiImageHandler
OpenaiImageHandler handles non-streaming OpenAI image responses (generations/edits), returning the parsed usage for billing.
relay/channel/openai/relay_image.go:34
↓ 5 callersFunctionPostConsumeQuota
(relayInfo *relaycommon.RelayInfo, quota int, preConsumedQuota int, sendEmail bool)
service/quota.go:411
↓ 5 callersFunctionPreConsumeBilling
PreConsumeBilling 根据用户计费偏好创建 BillingSession 并执行预扣费。 会话存储在 relayInfo.Billing 上,供后续 Settle / Refund 使用。
service/billing.go:20
↓ 5 callersFunctionRecordTopupLog
(userId int, content string, callerIp string, paymentMethod string, callbackPaymentMethod string)
model/log.go:254
↓ 5 callersFunctionRegister
Register registers an OAuth provider with the given name
oauth/registry.go:19
↓ 5 callersMethodReset
Reset clears pending observations (used when a terminal response fails).
relay/common/tool_usage.go:129
↓ 5 callersFunctionResponseChunkData
(c *gin.Context, resp dto.ResponsesStreamResponse, data string)
relay/helper/common.go:87
↓ 5 callersFunctionRevokeUserSession
(userID int, sid, reason string)
model/user_session.go:544
↓ 5 callersMethodSaveToDB
SaveToDB 将配置保存到数据库
setting/config/config.go:71
↓ 5 callersMethodSetAutoGroups
(groups []string)
model/token.go:46
↓ 5 callersMethodSetModelName
(modelName string)
relaykit/dto/request_common.go:11
↓ 5 callersMethodSetSetting
(setting dto.UserSetting)
model/user.go:153
↓ 5 callersFunctionSetupContextForToken
(c *gin.Context, token *model.Token, parts ...string)
middleware/auth.go:485
↓ 5 callersFunctionSha1
(data []byte)
common/hash.go:22
↓ 5 callersFunctionShouldPreserveThinkingSuffix
ShouldPreserveThinkingSuffix 判断模型是否配置为保留 thinking/-nothinking/-low/-high/-medium 后缀
setting/model_setting/global.go:67
↓ 5 callersMethodToResponse
()
model/system_task.go:416
↓ 5 callersFunctionTokenAuth
()
middleware/auth.go:352
↓ 5 callersMethodUpdate
()
model/topup.go:56
↓ 5 callersMethodUpdate
()
model/subscription.go:237
↓ 5 callersMethodUpdate
()
model/channel.go:532
↓ 5 callersMethodUpdateAbilities
UpdateAbilities updates abilities of this channel. Make sure the channel is completed before calling this function.
model/ability.go:243
↓ 5 callersFunctionUpdateChannelStatus
(channelId int, usingKey string, status int, reason string)
model/channel.go:712
← previousnext →501–600 of 9,514, ranked by callers