MCPcopy Create free account

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

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

↓ 4 callersFunctionsetupDashboardAuthMiddlewareTest
(t *testing.T)
middleware/auth_test.go:24
↓ 4 callersFunctionsetupFlowControllerTestDB
(t *testing.T)
controller/usedata_flow_test.go:20
↓ 4 callersFunctionsideDrawerSwitchItemClassName
(className?: string)
web/src/components/drawer-layout.ts:54
↓ 4 callersFunctionsimulatePollBilling
=========================================================================== CAS + Billing integration tests Simulates the flow in updateVideoSingleTas
service/task_billing_test.go:573
↓ 4 callersFunctionsplitRefreshToken
(raw string)
service/auth_session.go:361
↓ 4 callersFunctiontestConn
(t *testing.T)
service/protected_fetch_client_test.go:32
↓ 4 callersFunctiontoCustomOAuthProviderResponse
(p *model.CustomOAuthProvider)
controller/custom_oauth.go:49
↓ 4 callersMethodtoolDelta
(tool *responsesStreamTool, explicitDelta string)
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:386
↓ 4 callersFunctiontriggerRefresh
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:47
↓ 4 callersFunctiontryParseRequestRuleExpr
( expr: string )
web/src/features/pricing/lib/billing-expr.ts:494
↓ 4 callersFunctionupdateModelStatus
( id: number, status: number )
web/src/features/models/api.ts:96
↓ 4 callersFunctionupdateUserCacheField
updateUserCacheField prevents individual cache refreshes from bypassing the auth-version fence. It intentionally does nothing when the complete hash i
model/user_cache.go:271
↓ 4 callersFunctionuseAuthRedirect
()
web/src/features/auth/hooks/use-auth-redirect.ts:32
↓ 4 callersFunctionuseCarousel
()
web/src/components/ui/carousel.tsx:54
↓ 4 callersFunctionuseChatPresets
()
web/src/features/chat/hooks/use-chat-presets.ts:67
↓ 4 callersFunctionuseConfirmation
()
web/src/components/ai-elements/confirmation.tsx:48
↓ 4 callersFunctionuseCountdown
(options: UseCountdownOptions = {})
web/src/hooks/use-countdown.ts:26
↓ 4 callersFunctionuseFormField
()
web/src/components/ui/form.tsx:153
↓ 4 callersFunctionuseLayout
()
web/src/context/layout-provider.tsx:98
↓ 4 callersFunctionusePromptInputAttachments
()
web/src/components/ai-elements/prompt-input.tsx:263
↓ 4 callersFunctionuseThemeRadiusPx
( cssVariable = '--radius-md', refreshKey?: string )
web/src/lib/theme-radius.ts:40
↓ 4 callersFunctionuserCacheTTLSeconds
()
model/user_cache.go:54
↓ 4 callersFunctionvalidateChannel
validateChannel 通用的渠道校验函数
controller/channel.go:474
↓ 4 callersFunctionwithSystemTaskRegistry
withSystemTaskRegistry swaps the package registry for the given handlers for the duration of a test and restores the original registry afterward.
service/system_task_test.go:17
↓ 4 callersFunctionwriteRateLimited
writeRateLimited rejects the request with 429 and a Retry-After hint so clients can back off instead of treating the rejection as a fatal error. The i
middleware/rate-limit.go:139
↓ 4 callersFunctionwriteUserSessionDenyFence
(session *UserSession, status string, now int64, reason string)
model/user_session.go:384
↓ 3 callersMethodAddAbilities
(tx *gorm.DB)
model/ability.go:196
↓ 3 callersMethodAddPolicy
(_ string, ptype string, rule []string)
service/authz/adapter.go:57
↓ 3 callersFunctionAdminAuth
()
middleware/auth.go:98
↓ 3 callersFunctionAdminBindSubscription
Admin bind (no payment). Creates a UserSubscription from a plan.
model/subscription.go:705
↓ 3 callersFunctionAdminResetPlanSubscriptions
(planId int, advanceResetTime bool)
model/subscription.go:1101
↓ 3 callersFunctionApplyChannelGroupFilter
(query *gorm.DB, group string)
model/channel.go:156
↓ 3 callersMethodArgumentsString
ArgumentsString returns function call arguments in the string form expected by Chat Completions.
dto/openai_response.go:342
↓ 3 callersFunctionCORS
()
middleware/cors.go:9
↓ 3 callersMethodCacheCreationTokensTotal
CacheCreationTokensTotal returns the cache-write token count regardless of which field the upstream reported it in: Claude-derived conversions populat
dto/openai_response.go:275
↓ 3 callersFunctionClaimExternalAuthAssertionWithTx
ClaimExternalAuthAssertionWithTx records a provider assertion in the caller's transaction so replay protection can commit atomically with the authenti
model/auth_flow.go:133
↓ 3 callersFunctionClaudeData
(c *gin.Context, resp dto.ClaudeResponse)
relay/helper/common.go:61
↓ 3 callersFunctionClearRefreshCookie
(c *gin.Context)
service/auth_session.go:315
↓ 3 callersFunctionCompileFromCache
CompileFromCache compiles an expression string, using a cached program when available. The cache is keyed by the SHA-256 hex digest of the expression.
pkg/billingexpr/compile.go:77
↓ 3 callersFunctionComputeTieredQuotaWithRequest
(snap *BillingSnapshot, params TokenParams, request RequestInput)
pkg/billingexpr/settle.go:21
↓ 3 callersFunctionConsumeAuthFlowWithAction
ConsumeAuthFlowWithAction consumes a flow and runs action in the same database transaction. An action failure rolls the consumption back.
model/auth_flow.go:189
↓ 3 callersMethodConvertEmbeddingRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.EmbeddingRequest)
relay/channel/adapter.go:22
↓ 3 callersMethodConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/advancedcustom/adaptor.go:47
↓ 3 callersMethodConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/advancedcustom/adaptor.go:118
↓ 3 callersFunctionConvertRequestVia
(c *gin.Context, info *relaycommon.RelayInfo, request any, path ...types.RelayFormat)
service/relayconvert/request_registry.go:174
↓ 3 callersMethodConvertRerankRequest
(c *gin.Context, relayMode int, request dto.RerankRequest)
relay/channel/adapter.go:21
↓ 3 callersFunctionCountUserSessionsCreatedSince
CountUserSessionsCreatedSince counts every issued row, regardless of its current status or expiry. userID zero selects the global count.
model/user_session.go:185
↓ 3 callersFunctionCountUserTokens
CountUserTokens returns total number of tokens for the given user, used for pagination
model/token.go:443
↓ 3 callersFunctionCreateBodyStorage
CreateBodyStorage 根据数据大小创建合适的存储
common/body_storage.go:241
↓ 3 callersFunctionCreateDiskCacheFile
CreateDiskCacheFile 创建磁盘缓存文件 cacheType: 缓存类型(body/file) 返回文件路径和文件句柄
common/disk_cache.go:42
↓ 3 callersFunctionCreatePendingTwoFASetupBackupCodes
CreatePendingTwoFASetupBackupCodes stores recovery codes for an unverified setup. Regeneration for an enabled factor must advance auth_version.
model/twofa.go:189
↓ 3 callersFunctionDeletePasskeyByUserIDWithAuthVersion
(userID int)
model/passkey.go:218
↓ 3 callersFunctionDisableTwoFAWithAuthVersion
DisableTwoFAWithAuthVersion atomically removes the factor and invalidates every access token issued against the previous security configuration.
model/twofa.go:279
↓ 3 callersFunctionDistribute
()
middleware/distributor.go:32
↓ 3 callersFunctionDoMidjourneyHttpRequest
(c *gin.Context, timeout time.Duration, fullRequestURL string)
service/midjourney.go:165
↓ 3 callersFunctionEmailVerificationRateLimit
()
middleware/email-verification-rate-limit.go:61
↓ 3 callersFunctionEncodeLocalTaskID
EncodeLocalTaskID encodes an upstream operation name to a URL-safe base64 string. Used by Gemini/Vertex to store upstream names as task IDs.
relay/channel/task/taskcommon/helpers.go:50
↓ 3 callersFunctionEnqueueSystemTask
EnqueueSystemTask creates an on-demand task of the given type. The returned bool is true only when a new pending row was created; false means an activ
service/system_task.go:201
↓ 3 callersFunctionEnsureEmailAvailable
(email string, excludeUserID int)
model/user.go:301
↓ 3 callersFunctionErrOptionWithStatusCode
(statusCode int)
types/error.go:393
↓ 3 callersFunctionExpireSubscriptionOrder
(tradeNo string, expectedPaymentProvider string)
model/subscription.go:679
↓ 3 callersFunctionExtractOutputTextFromResponses
(resp *dto.OpenAIResponsesResponse)
service/openai_chat_responses_compat.go:28
↓ 3 callersFunctionFetchModels
(c *gin.Context)
controller/channel.go:1270
↓ 3 callersMethodFetchTask
── Polling ──────────────────────────────────────────────────────
relay/channel/adapter.go:77
↓ 3 callersFunctionGeminiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:21
↓ 3 callersFunctionGenerateSystemTaskID
()
model/system_task.go:84
↓ 3 callersFunctionGenerateVerificationCode
(length int)
common/verification.go:26
↓ 3 callersFunctionGetAllChannels
(startIdx int, num int, selectAll bool, idSort bool, sortOptions ...ChannelSortOptions)
model/channel.go:356
↓ 3 callersFunctionGetAndValidOpenAIImageRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:182
↓ 3 callersMethodGetBase64Data
()
types/file_source.go:180
↓ 3 callersFunctionGetBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:45
↓ 3 callersFunctionGetBillingMode
--------------------------------------------------------------------------- Read accessors (hot path, must be fast) ----------------------------------
setting/billing_setting/tiered_billing.go:38
↓ 3 callersFunctionGetByMJId
(userId int, mjId string)
model/midjourney.go:127
↓ 3 callersMethodGetCache
()
types/file_source.go:20
↓ 3 callersFunctionGetCallbackAddress
()
service/epay.go:8
↓ 3 callersFunctionGetChannelPollingLock
GetChannelPollingLock returns or creates a mutex for the given channel ID
model/channel.go:617
↓ 3 callersMethodGetDefaultMaxTokens
(model string)
setting/model_setting/claude.go:84
↓ 3 callersFunctionGetEffectiveHeaderOverride
(info *RelayInfo)
relay/common/override.go:431
↓ 3 callersFunctionGetEnvOrDefaultBool
(env string, defaultValue bool)
common/env.go:28
↓ 3 callersFunctionGetFlowQuotaData
(startTime int64, endTime int64, username string, userID int, role int)
model/usedata_flow.go:25
↓ 3 callersMethodGetFullKey
()
model/token.go:51
↓ 3 callersFunctionGetGeminiVersionSetting
GetGeminiVersionSetting 获取版本设置
setting/model_setting/gemini.go:64
↓ 3 callersFunctionGetLatestSystemTask
GetLatestSystemTask returns the most recent task row of the given type (any status) so the scheduler can decide whether enough time has elapsed since
model/system_task.go:193
↓ 3 callersFunctionGetLegalSettings
()
setting/system_setting/legal.go:19
↓ 3 callersFunctionGetMimeTypeByExtension
(ext string)
service/file_decoder.go:159
↓ 3 callersFunctionGetMissingModels
GetMissingModels returns model names that are referenced in the system
model/missing_models.go:4
↓ 3 callersMethodGetName
GetName returns the display name of the provider (e.g., "GitHub", "Discord")
oauth/provider.go:13
↓ 3 callersMethodGetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
dto/openai_response.go:51
↓ 3 callersFunctionGetPerformanceMonitorConfig
GetPerformanceMonitorConfig 获取性能监控配置
common/performance_config.go:26
↓ 3 callersFunctionGetPreferredChannelByAffinity
(c *gin.Context, modelName string, usingGroup string)
service/channel_affinity.go:550
↓ 3 callersFunctionGetQuotaSetting
()
setting/operation_setting/quota_setting.go:19
↓ 3 callersMethodGetRawData
()
types/file_source.go:16
↓ 3 callersMethodGetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/adapter.go:18
↓ 3 callersMethodGetRetry
()
service/channel_select.go:23
↓ 3 callersMethodGetStringSystem
()
dto/claude.go:470
↓ 3 callersFunctionGetSubscriptionOrderByTradeNo
(tradeNo string)
model/subscription.go:241
↓ 3 callersMethodGetSystemRoleName
()
dto/openai_request.go:226
↓ 3 callersFunctionGetSystemStatus
GetSystemStatus 获取当前系统状态
common/system_monitor.go:79
↓ 3 callersMethodGetTag
()
model/channel.go:327
↓ 3 callersFunctionGetUUID
()
common/utils.go:223
← previousnext →801–900 of 9,195, ranked by callers