MCPcopy Create free account

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

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

↓ 6 callersMethodFillUserById
()
model/user.go:961
↓ 6 callersFunctionFormatClaudeResponseInfo
(claudeResponse *dto.ClaudeResponse, oaiResponse *dto.ChatCompletionsStreamResponse, claudeInfo *ClaudeRespons
relay/channel/claude/relay-claude.go:82
↓ 6 callersFunctionGeminiChatHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:313
↓ 6 callersFunctionGenerateFinalUsageResponse
(id string, createAt int64, model string, usage dto.Usage)
relay/helper/common.go:217
↓ 6 callersFunctionGetActiveSystemTask
(taskType string)
model/system_task.go:132
↓ 6 callersMethodGetAutoBan
()
model/channel.go:338
↓ 6 callersFunctionGetContextKeyBool
(c *gin.Context, key constant.ContextKey)
common/gin.go:173
↓ 6 callersFunctionGetContextKeyString
(c *gin.Context, key constant.ContextKey)
common/gin.go:165
↓ 6 callersFunctionGetEnvOrDefaultString
(env string, defaultValue string)
common/env.go:21
↓ 6 callersMethodGetIdentifier
()
types/file_source.go:15
↓ 6 callersFunctionGetSubscriptionPlanById
(id int)
model/subscription.go:385
↓ 6 callersFunctionGetTaskAdaptor
(platform constant.TaskPlatform)
relay/relay_adaptor.go:141
↓ 6 callersMethodGetTools
GetTools 获取工具列表
dto/claude.go:402
↓ 6 callersMethodGetUsageMetadata
()
dto/gemini.go:495
↓ 6 callersFunctionGetUserSessionBySID
(sid string)
model/user_session.go:198
↓ 6 callersFunctionGetUserUsableGroups
(userGroup string)
service/group.go:11
↓ 6 callersFunctionHeaderNavModulePublicOrUserAuth
(module string)
middleware/header_nav.go:125
↓ 6 callersMethodInsert
()
model/topup.go:50
↓ 6 callersFunctionInvalidatePricingCache
()
model/pricing.go:80
↓ 6 callersFunctionLogDatabaseType
()
common/database.go:19
↓ 6 callersMethodMatchPathForModel
MatchPathForModel returns the first route whose IncomingPath and Models match. An empty Models list is a catch-all fallback for that incoming path.
dto/channel_settings.go:136
↓ 6 callersFunctionMidjourneyErrorWrapper
(code int, desc string)
service/error.go:20
↓ 6 callersFunctionMigrateRetiredFrontendOptions
MigrateRetiredFrontendOptions normalizes options that belonged to the removed dashboard frontend. Each legacy console setting is migrated in its own t
model/frontend_option_migration.go:20
↓ 6 callersFunctionOpenaiHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:222
↓ 6 callersFunctionQuotaRound
QuotaRound converts a float64 quota value to int using half-away-from-zero rounding with int32 saturation. Every tiered billing path (pre-consume, set
pkg/billingexpr/round.go:12
↓ 6 callersFunctionReloadPolicy
()
service/authz/enforcer.go:69
↓ 6 callersFunctionRemoveDisabledFields
RemoveDisabledFields 从请求 JSON 数据中移除渠道设置中禁用的字段 service_tier: 服务层级字段,可能导致额外计费(OpenAI、Claude、Responses API 支持) inference_geo: Claude 数据驻留推理区域字段(仅 Claude
relay/common/relay_info.go:822
↓ 6 callersFunctionSanitizeURLForLog
(rawURL string)
relay/common/relay_utils.go:40
↓ 6 callersFunctionSetMainDatabaseType
(databaseType DatabaseType)
common/database.go:23
↓ 6 callersMethodSetupRequestHeader
(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo)
relay/channel/adapter.go:19
↓ 6 callersFunctionShouldPreserveThinkingSuffix
ShouldPreserveThinkingSuffix 判断模型是否配置为保留 thinking/-nothinking/-low/-high/-medium 后缀
setting/model_setting/global.go:67
↓ 6 callersMethodSize
Size 获取数据大小
common/body_storage.go:20
↓ 6 callersMethodSource
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:16
↓ 6 callersMethodToBaseUser
()
model/user.go:115
↓ 6 callersFunctionUnmarshalMetadata
UnmarshalMetadata converts a map[string]any metadata to a typed struct via JSON round-trip. This replaces the repeated pattern: json.Marshal(metadata)
relay/channel/task/taskcommon/helpers.go:16
↓ 6 callersFunctionUpdateVideoTasks
UpdateVideoTasks 按渠道更新所有视频任务
service/task_polling.go:351
↓ 6 callersFunctionUsageFromChatUsage
(src *dto.Usage)
service/relayconvert/response_compat.go:91
↓ 6 callersMethodValidateNetworkTarget
ValidateNetworkTarget validates the host and port before dialing.
common/ssrf_protection.go:290
↓ 6 callersFunctionWithCompactModelSuffix
(modelName string)
setting/ratio_setting/compact_suffix.go:8
↓ 6 callersFunctionaddNewRecord
(type_ int, id int, value int)
model/utils.go:42
↓ 6 callersFunctionclearAuthentication
( synchronizeTabs = true, bootstrapState: AuthBootstrapState = 'complete' )
web/src/lib/auth-session.ts:185
↓ 6 callersFunctioncreateOAuthFlow
( provider: string, intent: 'login' | 'bind' )
web/src/features/auth/api.ts:141
↓ 6 callersFunctioncurrentEnforcer
()
service/authz/enforcer.go:63
↓ 6 callersFunctionfetchLogs
( endpoint: string, params: T, isAdmin: boolean )
web/src/features/usage-logs/api.ts:40
↓ 6 callersFunctionformatNumber
( value: number | null | undefined, locales?: Intl.LocalesArgument )
web/src/lib/format.ts:31
↓ 6 callersFunctionformatTokens
(value: number)
web/src/features/rankings/lib/format.ts:24
↓ 6 callersFunctionformatUptimePct
(pct: number)
web/src/features/performance-metrics/lib/format.ts:31
↓ 6 callersFunctiongetAuthenticatedUser
(c *gin.Context)
controller/passkey.go:654
↓ 6 callersFunctiongetCookie
(name: string)
web/src/lib/cookies.ts:29
↓ 6 callersFunctiongetCurrentVersion
(message: Message)
web/src/features/playground/lib/message/message-utils.ts:42
↓ 6 callersFunctiongetSuccessRateTextClass
(rate: number)
web/src/features/performance-metrics/lib/format.ts:88
↓ 6 callersFunctionhandleLoginSuccess
( bundle: AuthBundle, redirectTo?: string )
web/src/features/auth/hooks/use-auth-redirect.ts:40
↓ 6 callersFunctionhashStringToSeed
(input: string)
web/src/features/pricing/lib/seed.ts:30
↓ 6 callersFunctionisApiSuccess
(response: ApiResponse)
web/src/features/wallet/api.ts:51
↓ 6 callersFunctionisValidOtherRatio
(ratio float64)
types/price_data.go:106
↓ 6 callersFunctionmustStreamChunks
(t *testing.T, state *ResponsesToChatStreamState, event *dto.ResponsesStreamResponse)
service/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:443
↓ 6 callersFunctionnewAdvancedCustomModelListChannel
(baseURL string, key string, upstreamPath string, auth *dto.AdvancedCustomRouteAuth)
controller/channel_upstream_update_test.go:19
↓ 6 callersFunctionnewClientIPRouter
()
trusted_proxies_test.go:24
↓ 6 callersFunctionnewFakeSMTPServerWithSTARTTLSAdvertisement
(t *testing.T, advertiseSTARTTLS bool)
common/email_test.go:39
↓ 6 callersFunctionnormalizeJsonString
(value: string)
web/src/features/system-settings/models/utils.ts:32
↓ 6 callersFunctionnormalizeModelName
(model: string)
web/src/features/channels/lib/model-mapping-validation.ts:45
↓ 6 callersFunctionnoteQuotaClamp
noteQuotaClamp records the first quota saturation event onto relayInfo so it can later be attached to the consume/task log for admin auditing. First n
service/text_quota.go:194
↓ 6 callersFunctionparseLogOther
(other: string)
web/src/features/usage-logs/lib/format.ts:159
↓ 6 callersFunctionparseTags
(tagsString?: string)
web/src/features/pricing/lib/filters.ts:163
↓ 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)
service/relayconvert/internal/oai_chat/to_oai_responses_resp.go:222
↓ 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 callersFunctionsetupTokenControllerTestDB
(t *testing.T)
controller/token_test.go:107
↓ 6 callersFunctionstreamValuesFromAny
(value any)
service/relayconvert/response_registry.go:620
↓ 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
↓ 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 callersFunctionCapabilities
Capabilities returns the full resource/action matrix the subject is allowed.
service/authz/resolver.go:38
↓ 5 callersMethodConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/adapter.go:25
↓ 5 callersFunctionConvertRequestByID
(c *gin.Context, info *relaycommon.RelayInfo, converter string, request any)
service/relayconvert/request_registry.go:214
↓ 5 callersFunctionConvertStreamResponseChunk
(c *gin.Context, info *relaycommon.RelayInfo, state *ResponseStreamState, response any)
service/relayconvert/response_registry.go:299
↓ 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 callersFunctionFinalizeStreamResponse
(c *gin.Context, info *relaycommon.RelayInfo, state *ResponseStreamState)
service/relayconvert/response_registry.go:324
↓ 5 callersFunctionGenerateTextOtherInfo
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, modelRatio, groupRatio, completionRatio float64, cacheTo
service/log_info_generate.go:71
↓ 5 callersFunctionGetAudioCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:631
← previousnext →401–500 of 9,195, ranked by callers