Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,195 in github.com/QuantumNous/new-api
⨍
Functions
9,195
◇
Types & classes
1,481
↓ 4 callers
Function
setupDashboardAuthMiddlewareTest
(t *testing.T)
middleware/auth_test.go:24
↓ 4 callers
Function
setupFlowControllerTestDB
(t *testing.T)
controller/usedata_flow_test.go:20
↓ 4 callers
Function
sideDrawerSwitchItemClassName
(className?: string)
web/src/components/drawer-layout.ts:54
↓ 4 callers
Function
simulatePollBilling
=========================================================================== CAS + Billing integration tests Simulates the flow in updateVideoSingleTas
service/task_billing_test.go:573
↓ 4 callers
Function
splitRefreshToken
(raw string)
service/auth_session.go:361
↓ 4 callers
Function
testConn
(t *testing.T)
service/protected_fetch_client_test.go:32
↓ 4 callers
Function
toCustomOAuthProviderResponse
(p *model.CustomOAuthProvider)
controller/custom_oauth.go:49
↓ 4 callers
Method
toolDelta
(tool *responsesStreamTool, explicitDelta string)
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:386
↓ 4 callers
Function
triggerRefresh
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:47
↓ 4 callers
Function
tryParseRequestRuleExpr
( expr: string )
web/src/features/pricing/lib/billing-expr.ts:494
↓ 4 callers
Function
updateModelStatus
( id: number, status: number )
web/src/features/models/api.ts:96
↓ 4 callers
Function
updateUserCacheField
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 callers
Function
useAuthRedirect
()
web/src/features/auth/hooks/use-auth-redirect.ts:32
↓ 4 callers
Function
useCarousel
()
web/src/components/ui/carousel.tsx:54
↓ 4 callers
Function
useChatPresets
()
web/src/features/chat/hooks/use-chat-presets.ts:67
↓ 4 callers
Function
useConfirmation
()
web/src/components/ai-elements/confirmation.tsx:48
↓ 4 callers
Function
useCountdown
(options: UseCountdownOptions = {})
web/src/hooks/use-countdown.ts:26
↓ 4 callers
Function
useFormField
()
web/src/components/ui/form.tsx:153
↓ 4 callers
Function
useLayout
()
web/src/context/layout-provider.tsx:98
↓ 4 callers
Function
usePromptInputAttachments
()
web/src/components/ai-elements/prompt-input.tsx:263
↓ 4 callers
Function
useThemeRadiusPx
( cssVariable = '--radius-md', refreshKey?: string )
web/src/lib/theme-radius.ts:40
↓ 4 callers
Function
userCacheTTLSeconds
()
model/user_cache.go:54
↓ 4 callers
Function
validateChannel
validateChannel 通用的渠道校验函数
controller/channel.go:474
↓ 4 callers
Function
withSystemTaskRegistry
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 callers
Function
writeRateLimited
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 callers
Function
writeUserSessionDenyFence
(session *UserSession, status string, now int64, reason string)
model/user_session.go:384
↓ 3 callers
Method
AddAbilities
(tx *gorm.DB)
model/ability.go:196
↓ 3 callers
Method
AddPolicy
(_ string, ptype string, rule []string)
service/authz/adapter.go:57
↓ 3 callers
Function
AdminAuth
()
middleware/auth.go:98
↓ 3 callers
Function
AdminBindSubscription
Admin bind (no payment). Creates a UserSubscription from a plan.
model/subscription.go:705
↓ 3 callers
Function
AdminResetPlanSubscriptions
(planId int, advanceResetTime bool)
model/subscription.go:1101
↓ 3 callers
Function
ApplyChannelGroupFilter
(query *gorm.DB, group string)
model/channel.go:156
↓ 3 callers
Method
ArgumentsString
ArgumentsString returns function call arguments in the string form expected by Chat Completions.
dto/openai_response.go:342
↓ 3 callers
Function
CORS
()
middleware/cors.go:9
↓ 3 callers
Method
CacheCreationTokensTotal
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 callers
Function
ClaimExternalAuthAssertionWithTx
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 callers
Function
ClaudeData
(c *gin.Context, resp dto.ClaudeResponse)
relay/helper/common.go:61
↓ 3 callers
Function
ClearRefreshCookie
(c *gin.Context)
service/auth_session.go:315
↓ 3 callers
Function
CompileFromCache
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 callers
Function
ComputeTieredQuotaWithRequest
(snap *BillingSnapshot, params TokenParams, request RequestInput)
pkg/billingexpr/settle.go:21
↓ 3 callers
Function
ConsumeAuthFlowWithAction
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 callers
Method
ConvertEmbeddingRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.EmbeddingRequest)
relay/channel/adapter.go:22
↓ 3 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/advancedcustom/adaptor.go:47
↓ 3 callers
Method
ConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/advancedcustom/adaptor.go:118
↓ 3 callers
Function
ConvertRequestVia
(c *gin.Context, info *relaycommon.RelayInfo, request any, path ...types.RelayFormat)
service/relayconvert/request_registry.go:174
↓ 3 callers
Method
ConvertRerankRequest
(c *gin.Context, relayMode int, request dto.RerankRequest)
relay/channel/adapter.go:21
↓ 3 callers
Function
CountUserSessionsCreatedSince
CountUserSessionsCreatedSince counts every issued row, regardless of its current status or expiry. userID zero selects the global count.
model/user_session.go:185
↓ 3 callers
Function
CountUserTokens
CountUserTokens returns total number of tokens for the given user, used for pagination
model/token.go:443
↓ 3 callers
Function
CreateBodyStorage
CreateBodyStorage 根据数据大小创建合适的存储
common/body_storage.go:241
↓ 3 callers
Function
CreateDiskCacheFile
CreateDiskCacheFile 创建磁盘缓存文件 cacheType: 缓存类型(body/file) 返回文件路径和文件句柄
common/disk_cache.go:42
↓ 3 callers
Function
CreatePendingTwoFASetupBackupCodes
CreatePendingTwoFASetupBackupCodes stores recovery codes for an unverified setup. Regeneration for an enabled factor must advance auth_version.
model/twofa.go:189
↓ 3 callers
Function
DeletePasskeyByUserIDWithAuthVersion
(userID int)
model/passkey.go:218
↓ 3 callers
Function
DisableTwoFAWithAuthVersion
DisableTwoFAWithAuthVersion atomically removes the factor and invalidates every access token issued against the previous security configuration.
model/twofa.go:279
↓ 3 callers
Function
Distribute
()
middleware/distributor.go:32
↓ 3 callers
Function
DoMidjourneyHttpRequest
(c *gin.Context, timeout time.Duration, fullRequestURL string)
service/midjourney.go:165
↓ 3 callers
Function
EmailVerificationRateLimit
()
middleware/email-verification-rate-limit.go:61
↓ 3 callers
Function
EncodeLocalTaskID
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 callers
Function
EnqueueSystemTask
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 callers
Function
EnsureEmailAvailable
(email string, excludeUserID int)
model/user.go:301
↓ 3 callers
Function
ErrOptionWithStatusCode
(statusCode int)
types/error.go:393
↓ 3 callers
Function
ExpireSubscriptionOrder
(tradeNo string, expectedPaymentProvider string)
model/subscription.go:679
↓ 3 callers
Function
ExtractOutputTextFromResponses
(resp *dto.OpenAIResponsesResponse)
service/openai_chat_responses_compat.go:28
↓ 3 callers
Function
FetchModels
(c *gin.Context)
controller/channel.go:1270
↓ 3 callers
Method
FetchTask
── Polling ──────────────────────────────────────────────────────
relay/channel/adapter.go:77
↓ 3 callers
Function
GeminiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:21
↓ 3 callers
Function
GenerateSystemTaskID
()
model/system_task.go:84
↓ 3 callers
Function
GenerateVerificationCode
(length int)
common/verification.go:26
↓ 3 callers
Function
GetAllChannels
(startIdx int, num int, selectAll bool, idSort bool, sortOptions ...ChannelSortOptions)
model/channel.go:356
↓ 3 callers
Function
GetAndValidOpenAIImageRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:182
↓ 3 callers
Method
GetBase64Data
()
types/file_source.go:180
↓ 3 callers
Function
GetBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:45
↓ 3 callers
Function
GetBillingMode
--------------------------------------------------------------------------- Read accessors (hot path, must be fast) ----------------------------------
setting/billing_setting/tiered_billing.go:38
↓ 3 callers
Function
GetByMJId
(userId int, mjId string)
model/midjourney.go:127
↓ 3 callers
Method
GetCache
()
types/file_source.go:20
↓ 3 callers
Function
GetCallbackAddress
()
service/epay.go:8
↓ 3 callers
Function
GetChannelPollingLock
GetChannelPollingLock returns or creates a mutex for the given channel ID
model/channel.go:617
↓ 3 callers
Method
GetDefaultMaxTokens
(model string)
setting/model_setting/claude.go:84
↓ 3 callers
Function
GetEffectiveHeaderOverride
(info *RelayInfo)
relay/common/override.go:431
↓ 3 callers
Function
GetEnvOrDefaultBool
(env string, defaultValue bool)
common/env.go:28
↓ 3 callers
Function
GetFlowQuotaData
(startTime int64, endTime int64, username string, userID int, role int)
model/usedata_flow.go:25
↓ 3 callers
Method
GetFullKey
()
model/token.go:51
↓ 3 callers
Function
GetGeminiVersionSetting
GetGeminiVersionSetting 获取版本设置
setting/model_setting/gemini.go:64
↓ 3 callers
Function
GetLatestSystemTask
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 callers
Function
GetLegalSettings
()
setting/system_setting/legal.go:19
↓ 3 callers
Function
GetMimeTypeByExtension
(ext string)
service/file_decoder.go:159
↓ 3 callers
Function
GetMissingModels
GetMissingModels returns model names that are referenced in the system
model/missing_models.go:4
↓ 3 callers
Method
GetName
GetName returns the display name of the provider (e.g., "GitHub", "Discord")
oauth/provider.go:13
↓ 3 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
dto/openai_response.go:51
↓ 3 callers
Function
GetPerformanceMonitorConfig
GetPerformanceMonitorConfig 获取性能监控配置
common/performance_config.go:26
↓ 3 callers
Function
GetPreferredChannelByAffinity
(c *gin.Context, modelName string, usingGroup string)
service/channel_affinity.go:550
↓ 3 callers
Function
GetQuotaSetting
()
setting/operation_setting/quota_setting.go:19
↓ 3 callers
Method
GetRawData
()
types/file_source.go:16
↓ 3 callers
Method
GetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/adapter.go:18
↓ 3 callers
Method
GetRetry
()
service/channel_select.go:23
↓ 3 callers
Method
GetStringSystem
()
dto/claude.go:470
↓ 3 callers
Function
GetSubscriptionOrderByTradeNo
(tradeNo string)
model/subscription.go:241
↓ 3 callers
Method
GetSystemRoleName
()
dto/openai_request.go:226
↓ 3 callers
Function
GetSystemStatus
GetSystemStatus 获取当前系统状态
common/system_monitor.go:79
↓ 3 callers
Method
GetTag
()
model/channel.go:327
↓ 3 callers
Function
GetUUID
()
common/utils.go:223
← previous
next →
801–900 of 9,195, ranked by callers