MCPcopy Create free account

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

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

↓ 25 callersFunctionresolveLocalizedText
( value: LocalizedTextValue | undefined | null, language: string )
web/src/lib/localized-text.ts:36
↓ 25 callersFunctionseedChannel
(t *testing.T, id int)
service/task_billing_test.go:124
↓ 24 callersFunctionCacheGetChannel
(id int)
model/channel_cache.go:225
↓ 24 callersFunctionConvertRequest
(c context.Context, info convmeta.Meta, target types.RelayFormat, request any)
relaykit/relayconvert/request_registry.go:157
↓ 24 callersMethodError
()
relaykit/relayconvert/reasoning/intent.go:36
↓ 24 callersFunctionGetHttpClientWithProxySettings
GetHttpClientWithProxySettings returns a cached HTTP client for the proxy URL and channel transport settings. Default auto + 1 shard shares the same c
service/http_client.go:400
↓ 24 callersFunctionGetResponseID
(c *gin.Context)
relay/helper/common.go:333
↓ 24 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:100
↓ 24 callersMethodHasProviderHook
HasProviderHook reports whether the plugin exports a provider hook. It runs no JavaScript.
pkg/jsplugin/provider.go:163
↓ 24 callersFunctionPrepareTaskPluginRoute
PrepareTaskPluginRoute resolves and executes the pinned declarative route. Query requests terminate here so channel distribution and billing are never
middleware/task_plugin.go:113
↓ 24 callersFunctionRequestPolicy
(c *gin.Context)
service/request_policy.go:55
↓ 24 callersFunctionSetDatabaseTypes
(mainType DatabaseType, logType DatabaseType)
common/database.go:33
↓ 24 callersMethodWriteString
(s string)
relay/channel/openai/image_stream_test.go:306
↓ 24 callersFunctiongetCurrencyDisplay
()
web/src/lib/currency.ts:365
↓ 24 callersFunctionrecordUserSecurityAudit
recordUserSecurityAudit 记录普通用户自己的安全敏感操作(如 passkey 绑定/解绑)。 这类日志没有管理员操作者,不写 admin_info;同时不依赖 AdminAuth/RootAuth 的兜底。
controller/audit.go:164
↓ 24 callersFunctionseedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:96
↓ 24 callersMethodstart
()
web/src/components/ai-elements/prompt-input.tsx:1051
↓ 23 callersFunctionGetAuthFlow
GetAuthFlow validates a flow without consuming it. Callers must still use ConsumeAuthFlow with all identity-bound fields before performing the action.
model/auth_flow.go:217
↓ 23 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:281
↓ 23 callersMethodInsert
()
model/channel.go:608
↓ 23 callersFunctionLogDatabaseType
()
common/database.go:21
↓ 23 callersFunctionModelPriceHelper
(c *gin.Context, info *relaycommon.RelayInfo, promptTokens int, meta *types.TokenCountMeta)
relay/helper/price.go:65
↓ 23 callersMethodParseToolCalls
()
relaykit/dto/openai_request.go:680
↓ 23 callersFunctionRunExprWithRequest
(exprStr string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:30
↓ 23 callersMethodWriteHeader
(status int)
controller/responses_websocket.go:65
↓ 23 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:229
↓ 23 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:576
↓ 23 callersMethodmakeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callersFunctionnewLoginFixture
(t *testing.T, key, mode string)
service/provider_plugin_login_test.go:63
↓ 23 callersFunctionperformPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:1109
↓ 23 callersFunctionsetupReplyPlugins
(t *testing.T, instances string)
relay/requestplugin/requestplugin_test.go:974
↓ 22 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:102
↓ 22 callersMethodError
Error implements the error interface
pkg/ionet/types.go:274
↓ 22 callersMethodError
()
pkg/jsplugin/engine.go:56
↓ 22 callersFunctionFormatQuota
(quota int)
logger/logger.go:152
↓ 22 callersFunctionGetEnvOrDefault
(env string, defaultValue int)
common/env.go:8
↓ 22 callersFunctionGetGeneralSetting
()
setting/operation_setting/general_setting.go:40
↓ 22 callersMethodGetPageSize
()
common/page_info.go:25
↓ 22 callersMethodGetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:210
↓ 22 callersFunctionParseAccessToken
(raw string)
service/auth_token.go:85
↓ 22 callersMethodParseContent
()
relaykit/dto/claude.go:186
↓ 22 callersFunctionPublishUserAuthCache
PublishUserAuthCache refreshes user metadata from the database. Quota stays under the atomic quota-delta paths.
model/user_auth_cache.go:233
↓ 22 callersFunctionRegister
Register registers an OAuth provider with the given name
oauth/registry.go:24
↓ 22 callersMethodSnapshot
()
model/task.go:557
↓ 22 callersFunctioncompileBillingExpression
(source: string)
web/src/features/pricing/lib/billing-expression/parser.ts:487
↓ 22 callersFunctionpaymentError
paymentError answers payment endpoints in their {"message": "error", "data": text} shape. When err is or wraps a *common.Message, the response also ca
controller/topup.go:258
↓ 22 callersFunctionuseUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:40
↓ 21 callersMethodAddOtherRatio
(key string, ratio float64)
types/price_data.go:44
↓ 21 callersMethodDoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:30
↓ 21 callersMethodGetOtherInfo
()
model/channel.go:327
↓ 21 callersFunctionGetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 21 callersFunctionGetStepUpIdentity
GetStepUpIdentity returns the identity that may request and consume security verification proofs: a browser session, or a scoped access token bound to
middleware/auth.go:182
↓ 21 callersFunctionGetTaskPluginVersion
(key, version string)
model/task_plugin.go:161
↓ 21 callersFunctionModelRatio2JSONString
()
setting/ratio_setting/model_ratio.go:639
↓ 21 callersMethodObserveResponseModel
ObserveResponseModel retains the first differing model for inspection, with mismatches taking priority over provider-path, prefix, or case-only differ
relay/common/response_model.go:40
↓ 21 callersFunctionResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:23
↓ 21 callersMethodSetSetting
(setting dto.ChannelSettings)
model/channel.go:1220
↓ 21 callersMethodString
()
service/http_transport_policy.go:92
↓ 21 callersMethodToOpenAIError
ToOpenAIError masks the upstream addresses in the message; pass those of the channel that produced the error, or none when no channel did.
relaykit/types/error.go:187
↓ 21 callersFunctionUpdateChannelStatus
(channelId int, usingKey string, status int, reason string)
model/channel.go:861
↓ 21 callersFunctionUpdateModelRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:373
↓ 21 callersMethodWritten
()
relay/requestplugin/reply.go:877
↓ 21 callersMethodabort
()
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:192
↓ 21 callersFunctioncompileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:1072
↓ 21 callersFunctionformatQuota
(quota: number)
web/src/lib/format.ts:89
↓ 21 callersFunctiongetTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:541
↓ 21 callersFunctionregisterScheduledPlugin
(t *testing.T, hooks string)
service/provider_plugin_test.go:794
↓ 21 callersFunctionserveTaskPluginProtocol
( c *gin.Context, pinned pluginruntime.PinnedEndpoint, deps pluginProtocolBridgeDeps, )
controller/plugin_protocol.go:163
↓ 21 callersFunctiontestPluginRouteHandlers
( handler func(*gin.Context, *jsplugin.RoutingGeneration, jsplugin.RouteBinding), )
router/plugin_router_test.go:1051
↓ 21 callersFunctionuseChannels
()
web/src/features/channels/components/channels-provider.tsx:164
↓ 21 callersFunctionuseMediaQuery
(query: string)
web/src/hooks/use-media-query.ts:26
↓ 20 callersFunctionApiSuccessT
ApiSuccessT is the success counterpart of ApiErrorT.
common/gin.go:307
↓ 20 callersMethodDecode
(s string)
pkg/cachex/codec.go:12
↓ 20 callersMethodGetStartIdx
()
common/page_info.go:17
↓ 20 callersFunctionNewPlan
NewPlan takes the plan of a new request: nil when no enabled instance has an available plugin. The instances of a plugin that is missing, disabled or
relay/requestplugin/plan.go:102
↓ 20 callersFunctionPrepareTaskPluginEndpoint
PrepareTaskPluginEndpoint normalizes a claimed shared request through the candidates pinned before distribution, retaining only plugins that accept it
middleware/task_plugin.go:757
↓ 20 callersFunctionSaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:107
↓ 20 callersFunctionSource
Source returns the embedded factory source for a task plugin key.
plugins/embed.go:41
↓ 20 callersFunctionTranslate
Translate translates a message key for the specified language. An empty language means the reader stated none and gets common.DefaultLanguage.
i18n/i18n.go:97
↓ 20 callersFunctionallowMembers
(object map[string]any, subject string, names ...string)
pkg/jsplugin/provider.go:1722
↓ 20 callersFunctioncleanupTaskPluginControllerRuntime
(t *testing.T, key string)
controller/task_plugin_test.go:72
↓ 20 callersFunctioncompilePluginProtocolTestEndpoint
(t *testing.T, key, source string)
controller/plugin_protocol_test.go:1444
↓ 20 callersFunctioncopyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 20 callersFunctionexpiringLine
(t *testing.T, plugin, refresh, account string, expiresAt int64)
service/provider_plugin_test.go:299
↓ 20 callersFunctionreplyInfo
(format types.RelayFormat, mode int)
relay/requestplugin/requestplugin_test.go:1003
↓ 20 callersFunctiontrimmed
(value)
plugins/tasks/doubao/plugin.js:335
↓ 19 callersFunctionAccessTokenFingerprint
(token string)
model/audit_log.go:61
↓ 19 callersFunctionApiErrorStatus
ApiErrorStatus is ApiError with another HTTP status. fields adds response fields such as a stable error code or data.
common/gin.go:285
↓ 19 callersFunctionApplyReasoningModelSuffix
ApplyReasoningModelSuffix parses host-private reasoning suffixes from the origin and mapped model names, attaches the resulting intent to RelayInfo, a
relay/helper/reasoning_suffix.go:28
↓ 19 callersMethodCommit
Commit writes the capped completed-output count into RelayInfo once. Request tool declarations alone must not become billable calls.
relay/common/tool_usage.go:197
↓ 19 callersFunctionGetPasskeyByUserID
(userID int)
model/passkey.go:124
↓ 19 callersFunctionIngress
Ingress takes the execution plan of a relay request and runs the ingress stage on the stored client body, before the body is parsed. Patched bytes rep
relay/requestplugin/relay.go:48
↓ 19 callersFunctionModelMappedHelper
(c *gin.Context, info *relaycommon.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:14
↓ 19 callersFunctionNewLogOther
()
model/log_other.go:46
↓ 19 callersFunctionOutbound
Outbound runs the late ingress hooks and the outbound stage on the upstream JSON body of a channel attempt, before the channel param override, which h
relay/requestplugin/relay.go:353
↓ 19 callersFunctionPinTaskPluginEndpoint
PinTaskPluginEndpoint decides shared-endpoint ownership without executing plugin code. Invalid or unidentifiable ordinary requests deliberately fall t
middleware/task_plugin.go:596
↓ 19 callersFunctionSetEventStreamHeaders
(c *gin.Context)
relay/helper/common.go:197
↓ 19 callersFunctionUsedVars
UsedVars returns the set of identifier names referenced by an expression. The result is cached alongside the compiled program. Returns nil for empty i
pkg/billingexpr/compile.go:296
↓ 19 callersMethodValue
()
model/task.go:99
↓ 19 callersMethodarray
array reads the tokens up to the matching ']' as one 'a' token: strings and numbers kept, at most maxPDFArrayItems, nested arrays skipped.
relay/requestplugin/pdf.go:736
← previousnext →201–300 of 15,409, ranked by callers