Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,514 in github.com/QuantumNous/new-api
⨍
Functions
9,514
◇
Types & classes
1,507
↓ 3 callers
Function
updateOpenAIImageCount
(info *relaycommon.RelayInfo, count int64)
relay/channel/openai/relay_image.go:25
↓ 3 callers
Function
updateOptionMap
(key string, value string)
model/option.go:275
↓ 3 callers
Method
updateUsageState
()
model/twofa.go:92
↓ 3 callers
Function
updateUserCacheFieldAtVersion
(userId int, field string, value interface{}, authVersion int64)
model/user_auth_cache.go:243
↓ 3 callers
Function
usageFromClaudeResponse
(resp *dto.ClaudeResponse)
relaykit/relayconvert/response_registry.go:782
↓ 3 callers
Function
useCarouselApi
()
web/src/components/ai-elements/inline-citation.tsx:115
↓ 3 callers
Function
useDialogs
()
web/src/hooks/use-dialog.ts:131
↓ 3 callers
Function
useInvalidateOnSuccess
()
web/src/features/system-settings/auth/custom-oauth/hooks/use-custom-oauth-mutations.ts:31
↓ 3 callers
Function
useSettingsForm
({ onSubmit, compareValues, defaultValues, ...formOptions }: SettingsFormOptions<T>)
web/src/features/system-settings/hooks/use-settings-form.ts:185
↓ 3 callers
Function
useStatusData
( enabledKey: string, dataKey: string )
web/src/features/dashboard/hooks/use-status-data.ts:26
↓ 3 callers
Function
useSystemOptions
()
web/src/features/system-settings/hooks/use-system-options.ts:23
↓ 3 callers
Function
useTopNavLinks
()
web/src/hooks/use-top-nav-links.ts:46
↓ 3 callers
Function
useTurnstile
()
web/src/features/auth/hooks/use-turnstile.ts:28
↓ 3 callers
Function
useWebPreview
()
web/src/components/ai-elements/web-preview.tsx:57
↓ 3 callers
Function
userAuthFenceTTLSeconds
A pending fence only covers the interval between publishing the next version and the surrounding database transaction reaching a decision. Its TTL mus
model/user_auth_cache.go:39
↓ 3 callers
Function
userRateLimitFactory
userRateLimitFactory creates a rate limiter keyed by authenticated user ID instead of client IP, making it resistant to proxy rotation attacks. Must b
middleware/rate-limit.go:192
↓ 3 callers
Function
validateJsonString
( value: string, options: JsonValidationOptions = {} )
web/src/features/system-settings/models/utils.ts:145
↓ 3 callers
Function
validateOptionValue
(key string, value string)
model/option.go:208
↓ 3 callers
Function
validateTurnstile
()
web/src/features/auth/hooks/use-turnstile.ts:40
↓ 3 callers
Function
verifyTelegramAuthorization
(params url.Values, token string, now time.Time)
controller/telegram.go:298
↓ 3 callers
Function
warnLegacyProxyURLOnce
(config *proxyURLConfig)
service/http_client.go:150
↓ 3 callers
Function
wechatLoginByCode
(code: string)
web/src/features/auth/api.ts:161
↓ 3 callers
Function
withNormalizedEmailLock
withNormalizedEmailLock serializes concurrent writers that target the same normalized email inside tx, so a "check then write" sequence cannot be race
model/user.go:324
↓ 3 callers
Function
writeDashboardAuthError
(c *gin.Context, err error)
middleware/auth.go:209
↓ 3 callers
Function
writeStoredValue
(key: string, data: T)
web/src/features/playground/lib/storage/storage.ts:80
↓ 2 callers
Function
AcSearch
(findText string, dict []string, stopImmediately bool)
service/str.go:132
↓ 2 callers
Function
AllOption
()
model/option.go:23
↓ 2 callers
Function
AppendChannelAffinityAdminInfo
(c *gin.Context, adminInfo map[string]interface{})
service/channel_affinity.go:702
↓ 2 callers
Method
Apply
(query *gorm.DB)
model/user.go:52
↓ 2 callers
Method
ApplyOtherRatiosToDecimal
(value decimal.Decimal)
types/price_data.go:88
↓ 2 callers
Function
BodyStorageCleanup
BodyStorageCleanup 请求体存储清理中间件 在请求处理完成后自动清理磁盘/内存缓存
middleware/body_cleanup.go:11
↓ 2 callers
Function
BuildAPIBaseURL
(baseURL, version, projectID, region string)
relay/channel/vertex/url_builder.go:38
↓ 2 callers
Function
BuildBillingExprRequestInputFromRequest
(request dto.Request, headers map[string]string)
relay/helper/billing_expr_request.go:37
↓ 2 callers
Function
BuildParamOverrideContext
BuildParamOverrideContext 提供 ApplyParamOverride 可用的上下文信息。 目前内置以下字段: - upstream_model/model:始终为通道映射后的上游模型名。 - original_model:请求最初指定的模型名。 - request_path
relay/common/override.go:2048
↓ 2 callers
Function
BuildProxyURL
BuildProxyURL constructs the video proxy URL using the public task ID. e.g., "https://your-server.com/v1/videos/task_xxxx/content"
relay/channel/task/taskcommon/helpers.go:65
↓ 2 callers
Function
BuildPublisherModelURL
(baseURL, version, projectID, region, publisher, modelName, action string)
relay/channel/vertex/url_builder.go:63
↓ 2 callers
Function
BumpUserAuthVersion
BumpUserAuthVersion is the transaction-owning variant used by password, role, status and security-factor changes outside another transaction.
model/user_auth_cache.go:212
↓ 2 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
relaykit/relayconvert/response_compat.go:83
↓ 2 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:34
↓ 2 callers
Method
CheckClusterNameAvailability
CheckClusterNameAvailability checks if a cluster name is available
pkg/ionet/deployment.go:327
↓ 2 callers
Function
CheckUserExistOrDeleted
CheckUserExistOrDeleted check if user exist or deleted, if not exist, return false, nil, if deleted or exist, return true, nil
model/user.go:240
↓ 2 callers
Function
CleanupOldDiskCacheFiles
CleanupOldDiskCacheFiles 清理旧的缓存文件 maxAge: 文件最大存活时间 注意:此函数只删除文件,不更新统计(因为无法知道每个文件的原始大小)
common/disk_cache.go:109
↓ 2 callers
Method
ClearBinding
(bindingType string)
model/user.go:814
↓ 2 callers
Function
ClearCurrentChannelAffinityCache
(c *gin.Context)
service/channel_affinity.go:644
↓ 2 callers
Function
ClearUserAuthorizationInTx
(tx *gorm.DB, userID int)
service/authz/override.go:97
↓ 2 callers
Method
Close
()
relay/channel/gemini/relay_responses_test.go:192
↓ 2 callers
Function
ContainsAudioCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:645
↓ 2 callers
Function
ContainsAudioRatio
(name string)
setting/ratio_setting/model_ratio.go:639
↓ 2 callers
Function
ContainsGroupRatio
(name string)
setting/ratio_setting/group_ratio.go:66
↓ 2 callers
Function
ContainsPayMethod
(method string)
setting/operation_setting/payment_setting_old.go:52
↓ 2 callers
Function
ContentPartToFileSource
(part map[string]any)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:211
↓ 2 callers
Function
ContentParts
(content any)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:95
↓ 2 callers
Method
ConvertAudioRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.AudioRequest)
relay/channel/adapter.go:24
↓ 2 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/adapter.go:31
↓ 2 callers
Method
ConvertGeminiRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest)
relay/channel/adapter.go:32
↓ 2 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/openai/adaptor.go:244
↓ 2 callers
Function
ConvertSimpleChangeParams
(content string)
service/midjourney.go:136
↓ 2 callers
Function
CountActiveUserSessions
(userID int, now int64)
model/user_session.go:169
↓ 2 callers
Function
CountChannelTags
(query *gorm.DB)
model/channel.go:1102
↓ 2 callers
Function
CountOldLog
(ctx context.Context, targetTimestamp int64)
model/log.go:695
↓ 2 callers
Function
CoverPlusActionToNormalAction
(midjRequest *dto.MidjourneyRequest)
service/midjourney.go:77
↓ 2 callers
Function
CoverTaskActionToModelName
(platform constant.TaskPlatform, action string)
service/task.go:9
↓ 2 callers
Function
CreateLoginSessionAtAuthVersion
(userID int, expectedAuthVersion int64, loginMethod, ip, userAgent string)
service/auth_session.go:49
↓ 2 callers
Function
CreateWaffoPancakeCheckoutSession
CreateWaffoPancakeCheckoutSession creates an Authenticated-mode checkout session: the order is bound to BuyerIdentity (stable per user) so it stays at
service/waffo_pancake.go:99
↓ 2 callers
Function
CriticalRateLimit
()
middleware/rate-limit.go:174
↓ 2 callers
Function
DecodeBase64ImageData
return image.Config, format, clean base64 string, error
service/image.go:20
↓ 2 callers
Function
DefaultInt
DefaultInt returns val if non-zero, otherwise fallback.
relay/channel/task/taskcommon/helpers.go:41
↓ 2 callers
Method
DefaultMaxTokensFor
(modelName string)
relaykit/relayconvert/convmeta/options.go:59
↓ 2 callers
Function
DefaultString
DefaultString returns val if non-empty, otherwise fallback.
relay/channel/task/taskcommon/helpers.go:33
↓ 2 callers
Method
Delete
()
model/redemption.go:206
↓ 2 callers
Method
Delete
()
model/token.go:347
↓ 2 callers
Function
DeleteExpiredUserSessions
(now int64)
model/user_session.go:776
↓ 2 callers
Function
DeleteOldRevokedUserSessions
(now int64)
model/user_session.go:788
↓ 2 callers
Method
DeletePendingTwoFASetup
DeletePendingTwoFASetup removes only an unverified setup. Enabled factors must use DisableTwoFAWithAuthVersion.
model/twofa.go:105
↓ 2 callers
Function
DeleteUserOAuthBinding
DeleteUserOAuthBinding deletes an OAuth binding
model/user_oauth_binding.go:133
↓ 2 callers
Function
DisableCache
()
middleware/disable-cache.go:5
↓ 2 callers
Function
DisableChannel
disable & notify
service/channel.go:19
↓ 2 callers
Function
DoFormRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:337
↓ 2 callers
Function
DoWssRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:369
↓ 2 callers
Method
EditWithTx
(tx *gorm.DB, updatePassword bool)
model/user.go:777
↓ 2 callers
Method
EnableWithAuthVersion
EnableWithAuthVersion atomically enables this factor and advances the user authentication version so pre-enrollment sessions cannot remain valid.
model/twofa.go:303
↓ 2 callers
Function
ErrOptionWithStatusCode
(statusCode int)
relaykit/types/error.go:393
↓ 2 callers
Method
Error
()
oauth/linuxdo.go:193
↓ 2 callers
Function
EstimateTokenByModel
(model, text string)
service/token_estimator.go:216
↓ 2 callers
Method
ExchangeToken
ExchangeToken exchanges the authorization code for an access token The gin.Context is passed for providers that need request info (e.g., for redirect_
oauth/provider.go:20
↓ 2 callers
Function
ExpireStaleSystemTaskLocks
(now int64)
model/system_task.go:360
↓ 2 callers
Function
ExplicitUserOverrides
ExplicitUserOverrides returns only the per-user override entries.
service/authz/override.go:108
↓ 2 callers
Function
ExtendWriteDeadline
ExtendWriteDeadline pushes the connection write deadline forward before each stream write. Best-effort: writers that don't support deadlines (e.g. htt
relay/helper/stream_scanner.go:70
↓ 2 callers
Method
FetchTask
(baseURL string, key string, body map[string]any, proxy string)
service/task_polling.go:30
↓ 2 callers
Function
FindEarliestPendingSystemTasks
(taskTypes []string)
model/system_task.go:158
↓ 2 callers
Function
FixAbility
()
model/ability.go:337
↓ 2 callers
Function
GeminiChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:209
↓ 2 callers
Function
GeminiImageHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:437
↓ 2 callers
Function
GeminiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:82
↓ 2 callers
Function
GeminiTextGenerationStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini-native.go:81
↓ 2 callers
Function
GenerateBackupCodes
GenerateBackupCodes 生成备用恢复码
common/totp.go:49
↓ 2 callers
Function
GenerateKey
()
common/utils.go:254
↓ 2 callers
Function
GenerateMjOtherInfo
(relayInfo *relaycommon.RelayInfo, priceData hosttypes.PriceData)
service/log_info_generate.go:293
↓ 2 callers
Function
GenerateOAuthCode
GenerateOAuthCode generates a state code for OAuth CSRF protection
controller/oauth.go:38
↓ 2 callers
Function
GenerateStartEmptyResponse
(id string, createAt int64, model string, systemFingerprint *string)
relay/helper/common.go:184
← previous
next →
1,301–1,400 of 9,514, ranked by callers