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
↓ 3 callers
Function
successRate
(value counters)
pkg/perf_metrics/metrics.go:366
↓ 3 callers
Function
supportsAliAnthropicMessages
* var syncModels = []string{ "z-image", "qwen-image", "wan2.6", } */
relay/channel/ali/adaptor.go:39
↓ 3 callers
Function
syncRows
(updatedRows: MappingRow[])
web/src/features/channels/components/model-mapping-editor.tsx:149
↓ 3 callers
Function
taskBillingContextPriceData
(bc *model.TaskBillingContext)
service/task_billing.go:144
↓ 3 callers
Function
taskBillingOther
taskBillingOther 从 task 的 BillingContext 构建日志 Other 字段。
service/task_billing.go:122
↓ 3 callers
Function
taskModelName
taskModelName 从 BillingContext 或 Properties 中获取模型名称。
service/task_billing.go:156
↓ 3 callers
Function
telegramAuthorizationClaim
(params url.Values, now time.Time)
controller/telegram.go:282
↓ 3 callers
Function
toBoolean
(value: unknown, fallback: boolean)
web/src/features/system-settings/maintenance/config.ts:86
↓ 3 callers
Function
toInputValue
(date?: Date)
web/src/features/usage-logs/components/compact-date-time-range-picker.tsx:40
↓ 3 callers
Function
toValueText
(value: unknown)
web/src/features/channels/components/dialogs/param-override-editor-dialog.tsx:454
↓ 3 callers
Function
triggerRefresh
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:62
↓ 3 callers
Function
unwrapStoredValue
(value: unknown)
web/src/features/playground/lib/storage/storage.ts:68
↓ 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:271
↓ 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)
service/relayconvert/response_registry.go:776
↓ 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
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:144
↓ 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
AppendRequestConversion
(format types.RelayFormat)
relay/common/relay_info.go:619
↓ 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
AutoGroups2JsonString
()
setting/auto_group.go:27
↓ 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
CacheGetRandomSatisfiedChannel
CacheGetRandomSatisfiedChannel tries to get a random channel that satisfies the requirements. 尝试获取一个满足要求的随机渠道。 For "auto" tokenGroup with cross-group
service/channel_select.go:84
↓ 2 callers
Function
ChatCompletionsRequestToResponsesRequest
(req *dto.GeneralOpenAIRequest)
service/relayconvert/internal/oai_chat/to_oai_responses_req.go:76
↓ 2 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
service/relayconvert/response_compat.go:83
↓ 2 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
service/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
Method
CloseIdleConnections
()
service/protected_fetch_client.go:115
↓ 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
ContainsPayMethod
(method string)
setting/operation_setting/payment_setting_old.go:52
↓ 2 callers
Function
ContentPartToFileSource
(part map[string]any)
service/relayconvert/internal/oai_responses/req_helpers.go:211
↓ 2 callers
Function
ContentParts
(content any)
service/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:23
↓ 2 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/adapter.go:30
↓ 2 callers
Method
ConvertGeminiRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest)
relay/channel/adapter.go:31
↓ 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:1099
↓ 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
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:324
↓ 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
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
← previous
next →
1,201–1,300 of 9,195, ranked by callers