MCPcopy Create free account

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

Functions15,409 in github.com/QuantumNous/new-api

↓ 5 callersFunctionDoRequest
(c *gin.Context, req *http.Request, info *common.RelayInfo)
relay/channel/api_request.go:528
↓ 5 callersFunctionEnableWorker
()
setting/system_setting/system_setting_old.go:9
↓ 5 callersFunctionErrOptionWithNoRecordErrorLog
()
relaykit/types/error.go:395
↓ 5 callersMethodEstimateBillingValidated
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:140
↓ 5 callersFunctionExtractRequest
(format types.RelayFormat, request any)
relaykit/relayconvert/internal/toolconv/decode.go:17
↓ 5 callersFunctionFinalizeChatCompletionsStreamToResponses
(state *ChatToResponsesStreamState)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:387
↓ 5 callersFunctionFormatRootLogs
FormatRootLogs normalizes legacy metadata into the current scoped shape without removing root-only diagnostics.
model/log.go:133
↓ 5 callersFunctionFreshPluginCredentialLine
FreshPluginCredentialLine returns the line a request about to use the credential line at keyIndex sends: the line, or its refresh when it expires with
service/provider_plugin.go:383
↓ 5 callersFunctionFromOpenAIResponses
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/reasoning/intent.go:513
↓ 5 callersFunctionGeminiTextGenerationHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini-native.go:21
↓ 5 callersFunctionGenRelayInfo
(c *gin.Context, relayFormat types.RelayFormat, request dto.Request, ws *websocket.Conn)
relay/common/relay_info.go:712
↓ 5 callersFunctionGetAudioCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:619
↓ 5 callersFunctionGetAudioRatio
(name string)
setting/ratio_setting/model_ratio.go:611
↓ 5 callersFunctionGetBuiltinBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:81
↓ 5 callersFunctionGetChannelPollingLock
GetChannelPollingLock returns or creates a mutex for the given channel ID
model/channel.go:704
↓ 5 callersFunctionGetConsoleSetting
GetConsoleSetting 获取 ConsoleSetting 配置实例
setting/console_setting/config.go:37
↓ 5 callersFunctionGetDiskCacheDir
GetDiskCacheDir 获取统一的磁盘缓存目录 注意:每次调用都会重新计算,以响应配置变化
common/disk_cache.go:25
↓ 5 callersFunctionGetEmailBinding
(identity AuthSessionIdentity, token string)
model/email_binding.go:59
↓ 5 callersFunctionGetEndpointTypesByChannelType
GetEndpointTypesByChannelType 获取渠道最优先端点类型(所有的渠道都支持 OpenAI 端点)
common/endpoint_type.go:6
↓ 5 callersMethodGetErrorType
()
relaykit/types/error.go:119
↓ 5 callersFunctionGetGroupGroupRatio
(userGroup, usingGroup string)
setting/ratio_setting/group_ratio.go:88
↓ 5 callersFunctionGetJsonType
(data RawMessage)
common/json.go:106
↓ 5 callersFunctionGetLatestSystemTasks
(taskTypes []string)
model/system_task.go:308
↓ 5 callersMethodGetMaskedKey
()
model/token.go:84
↓ 5 callersFunctionGetModelPricingIssues
GetModelPricingIssues reads the provider variants of the pricing snapshot for every model a live plugin declares and an enabled channel serves, and ev
model/model_pricing_config.go:382
↓ 5 callersMethodGetName
GetName returns the display name of the provider (e.g., "GitHub", "Discord")
oauth/provider.go:13
↓ 5 callersMethodGetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:22
↓ 5 callersFunctionGetSelfUserById
GetSelfUserById reads dashboard profile data and password existence in one query. The password hash and management access token are never selected.
model/user.go:523
↓ 5 callersMethodGetStringSystem
()
relaykit/dto/claude.go:593
↓ 5 callersFunctionGetTokenById
(id int)
model/token.go:274
↓ 5 callersFunctionGetTokenByIds
(id int, userId int)
model/token.go:264
↓ 5 callersFunctionGetUserOAuthBindingsByUserId
GetUserOAuthBindingsByUserId returns all OAuth bindings for a user
model/user_oauth_binding.go:24
↓ 5 callersFunctionGetUserUsableGroups
(userGroup string)
service/group.go:14
↓ 5 callersFunctionGetUserVerificationState
(userID int)
model/login_verification.go:23
↓ 5 callersFunctionHandleClaudeResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, httpResp *http.Response, data []
relay/channel/claude/relay-claude.go:358
↓ 5 callersFunctionHandleGroupRatio
HandleGroupRatio checks for "auto_group" in the context and updates the group ratio and relayInfo.UsingGroup if present
relay/helper/price.go:37
↓ 5 callersFunctionHandleStreamFinalResponse
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo)
relay/channel/claude/relay-claude.go:275
↓ 5 callersMethodHasCallablePath
HasCallablePath reports whether an exported value, or a nested member below it, exists and is callable.
pkg/jsplugin/engine.go:290
↓ 5 callersFunctionHashBackupCode
HashBackupCode 对备用码进行哈希
common/totp.go:110
↓ 5 callersFunctionHostProtocol
(name string)
pkg/jsplugin/routing.go:112
↓ 5 callersFunctionIcon
Icon returns the embedded sidecar logo for a factory plugin, if the plugin directory ships an icon.svg or icon.png next to plugin.js.
plugins/embed.go:51
↓ 5 callersMethodIncreaseRetry
()
service/channel_select.go:69
↓ 5 callersMethodIncrementFailedAttempts
IncrementFailedAttempts 增加失败尝试次数
model/twofa.go:84
↓ 5 callersMethodInfo
(context.Context, string, ...any)
model/user_session_migration_test.go:37
↓ 5 callersMethodInit
Init initializes the limiter once. Repeated calls leave the first configuration unchanged.
common/rate-limit.go:82
↓ 5 callersFunctionInitializeExternalIdentityClaims
InitializeExternalIdentityClaims imports legacy Telegram bindings after the claim table is migrated. Existing duplicate ownership fails migration rath
model/external_identity_claim.go:121
↓ 5 callersMethodInsert
()
model/subscription.go:242
↓ 5 callersFunctionIntentFromState
IntentFromState reconstructs a portable intent from host- or pivot-carried conversion state. A nil state is an empty intent.
relaykit/relayconvert/reasoning/intent.go:96
↓ 5 callersMethodIsLocked
IsLocked 检查账户是否被锁定
model/twofa.go:137
↓ 5 callersFunctionIsPasskeyDomainOption
ServerAddress and origins participate because either can change an implicit RP ID.
model/passkey_option.go:46
↓ 5 callersFunctionIsRequestPolicyOption
(key string)
model/request_policy.go:61
↓ 5 callersFunctionJsonRawMessageToString
JsonRawMessageToString returns JSON strings as their decoded value and other JSON values as raw text.
relaykit/relayconvert/kitutil/json.go:112
↓ 5 callersMethodKeywordFields
KeywordFields returns the names of the keywords format properties.
pkg/jsplugin/config_schema.go:456
↓ 5 callersFunctionListModels
(c *gin.Context, modelType int)
controller/model.go:218
↓ 5 callersFunctionListUserAccessTokens
(userID int)
model/user_access_token.go:112
↓ 5 callersFunctionLoadFileSource
LoadFileSource 加载文件源数据 这是统一的入口,会自动处理缓存和不同的来源类型
service/file_service.go:47
↓ 5 callersFunctionLoadOptionsFromDatabase
LoadOptionsFromDatabase applies every stored option. A failed read keeps the options in memory as they are.
model/option.go:200
↓ 5 callersFunctionMaskSensitiveInfo
MaskSensitiveInfo masks the upstream addresses in str and leaves every other URL and domain readable. upstreamURLs are the channel base URL and the UR
relaykit/relayconvert/kitutil/mask.go:102
↓ 5 callersFunctionMergeClaudeUsageNonZero
(current *ClaudeUsage, incoming *ClaudeUsage)
relaykit/dto/usage_merge.go:151
↓ 5 callersFunctionMergeExplicitAndSuffix
MergeExplicitAndSuffix combines structured request fields with a model-name alias or @ modifier. The model name wins wherever the two disagree: it is
relaykit/relayconvert/reasoning/intent.go:217
↓ 5 callersFunctionMergeGeminiUsageMetadataNonZero
MergeGeminiUsageMetadataNonZero overlays Gemini's cumulative usage snapshots: a later non-zero field overwrites the current value without dropping fie
relaykit/dto/usage_merge.go:220
↓ 5 callersFunctionMessageWithRequestId
(message string, id string)
common/utils.go:268
↓ 5 callersFunctionMigrateAuditLogs
MigrateAuditLogs also supports independently configured ClickHouse log stores. No TTL clause or usage-log cleanup integration is intentional.
model/audit_log.go:251
↓ 5 callersFunctionModelFamily
ModelFamily classifies a model name, case-insensitively. Vendor prefixes and date suffixes are allowed (for example us.anthropic.claude-opus-4-7-v1:0)
tokenkit/tokenkit.go:31
↓ 5 callersFunctionNamespacedToolName
NamespacedToolName is the upstream function name of a tool declared in a Responses tool namespace: "<namespace>__<name>", or the bare name for the def
relaykit/relayconvert/convmeta/meta.go:118
↓ 5 callersFunctionNewChatToResponsesStreamState
(id string, model string)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:112
↓ 5 callersFunctionNewEstimatedGeminiChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:124
↓ 5 callersFunctionNewFileSourceFromData
(data string, mimeType string)
relaykit/types/file_source.go:134
↓ 5 callersFunctionNewGenericOAuthProvider
NewGenericOAuthProvider creates a new generic OAuth provider from config
oauth/generic.go:73
↓ 5 callersFunctionNewRWMap
()
types/rw_map.go:27
↓ 5 callersFunctionNewRequestId
()
common/utils.go:256
↓ 5 callersFunctionNewSystemTaskProgressReporter
NewSystemTaskProgressReporter returns a throttled progress callback bound to a running task. Handlers call it with (processed, total) as they iterate
service/system_task.go:479
↓ 5 callersFunctionNewUserSortOptions
(sortBy string, sortOrder string)
model/user.go:36
↓ 5 callersFunctionNormalizeResponsesWebSearchAction
NormalizeResponsesWebSearchAction validates and canonicalizes the current Responses web_search_call action union. Claude emits {"query": ...}; the Res
relaykit/dto/openai_response.go:495
↓ 5 callersFunctionNotifyChannelWatchers
NotifyChannelWatchers sends a channel notice (a channel disabled or enabled automatically, or a test of all channels finished) to every administrator
service/user_notify.go:21
↓ 5 callersFunctionOaiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:105
↓ 5 callersFunctionOpenAIChatRequestToClaudeMessages
(c context.Context, info convmeta.Meta, textRequest dto.GeneralOpenAIRequest)
relaykit/relayconvert/request_compat.go:20
↓ 5 callersFunctionParseMultipartFormReusable
(c *gin.Context)
common/gin.go:367
↓ 5 callersMethodParseSystem
()
relaykit/dto/claude.go:604
↓ 5 callersFunctionPluginCredentialHookContext
PluginCredentialHookContext is the context of a login, refresh or revoke call on a channel: utils.fetch may POST, through the channel proxy, and alway
service/provider_plugin.go:143
↓ 5 callersFunctionPluginKeyToken
PluginKeyToken returns the exchangeKey token of the static key line of a channel: the cached one, or a new exchange when there is none or it expires w
service/provider_plugin.go:325
↓ 5 callersFunctionPreflightRoutingConflict
PreflightRoutingConflict reports whether admitting candidate into the current generation would collide on a channel type, a case-folded model name, or
pkg/jsplugin/routing.go:1216
↓ 5 callersMethodProtocolSupports
ProtocolSupports reports whether the named protocol claim includes mode.
pkg/jsplugin/registry.go:352
↓ 5 callersFunctionQuotaRoundStrict
QuotaRoundStrict rejects an unrepresentable pre-consume estimate.
pkg/billingexpr/round.go:17
↓ 5 callersFunctionRecordRequestPolicyTermination
RecordRequestPolicyTermination appends the final decision after routing has stopped. It never writes a log row itself: the per-channel error log writt
service/request_policy.go:169
↓ 5 callersFunctionRecordTopupLog
(userId int, content *common.Message, callerIp string, paymentMethod string, callbackPaymentMethod string)
model/log.go:253
↓ 5 callersFunctionRefreshUserGroupCache
RefreshUserGroupCache publishes current user metadata after a group change.
model/user_cache.go:217
↓ 5 callersMethodRelayRoute
RelayRoute returns the relay route serving requestPath for model, with the converter as the manifest declares it.
pkg/jsplugin/registry.go:229
↓ 5 callersFunctionRequestPluginFetcher
RequestPluginFetcher returns the utils.fetch of a request processing instance's ingress, egress and report hooks: the plugin's allowedHosts and the ho
service/provider_plugin.go:79
↓ 5 callersFunctionRequirePermission
(permission authz.Permission)
middleware/auth.go:410
↓ 5 callersMethodReserve
Reserve 将预扣额度补到目标值;若目标值不高于当前预扣额度则不做任何事。
relay/common/billing.go:23
↓ 5 callersMethodResponseFailed
()
relay/common/stream_status.go:169
↓ 5 callersFunctionResponsesResponseToChatCompletionsResponse
(resp *dto.OpenAIResponsesResponse, id string)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:59
↓ 5 callersFunctionRevokeUserAccessToken
RevokeUserAccessToken returns the generation actually revoked under the row lock. Deprecated: 旧版面板访问令牌,仅在升级后的过渡期内使用;删除 users.access_token 列时一并移除。
model/user.go:149
↓ 5 callersFunctionRoleSubject
RoleSubject is the casbin subject string for a role.
service/authz/permission.go:25
↓ 5 callersMethodServerEvent
ServerEvent passes one upstream event to the client: the text of each response through its reply check, and the events of each response to its report,
relay/requestplugin/socket.go:461
↓ 5 callersMethodSetAutoGroups
(groups []string)
model/token.go:50
↓ 5 callersMethodSetFirstResponseTime
()
relay/common/relay_info.go:1020
↓ 5 callersMethodSetScopes
(scopes []string)
model/user_access_token.go:71
↓ 5 callersFunctionSetUserPermissions
(userID int, permissions PermissionsMap)
service/authz/override.go:20
← previousnext →1,301–1,400 of 15,409, ranked by callers