MCPcopy Create free account

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

Functions10,934 in github.com/QuantumNous/new-api

↓ 26 callersMethodcall
( ctx context.Context, admissionTimeout time.Duration, exportName string, members []string, args ...any,
pkg/jsplugin/engine.go:331
↓ 25 callersMethodRoutingErrors
()
pkg/jsplugin/registry.go:628
↓ 25 callersFunctionTryTieredSettle
TryTieredSettle checks if the request uses tiered_expr billing and, if so, computes the actual quota using the captured BillingSnapshot. Returns: - ok
service/tiered_settle.go:163
↓ 25 callersFunctionWithOpenAIError
(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:317
↓ 24 callersMethodCall
Call invokes one named module export and returns its JSON-compatible value.
pkg/jsplugin/engine.go:301
↓ 24 callersFunctionDecodeJson
(reader io.Reader, v any)
common/json.go:17
↓ 24 callersMethodGetBaseURL
()
model/channel.go:521
↓ 24 callersFunctionIOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 24 callersFunctionNew
(plugin *pluginruntime.LoadedPlugin)
relay/channel/task/jsplugin/adaptor.go:85
↓ 24 callersMethodStringContent
()
relaykit/dto/openai_request.go:499
↓ 24 callersMethodaddEventListener
( type: string, listener: (event: Event & { data?: string; readyState?: number }) => void )
web/src/features/playground/hooks/use-stream-request.test.ts:41
↓ 24 callersFunctionformatQuota
(quota: number)
web/src/lib/format.ts:73
↓ 24 callersFunctionsetupTaskPluginControllerTest
(t *testing.T)
controller/task_plugin_test.go:24
↓ 23 callersMethodGetPageSize
()
common/page_info.go:25
↓ 23 callersMethodmakeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callersFunctionpluginProtocolTestDeps
()
controller/plugin_protocol_test.go:1485
↓ 23 callersFunctionuseStatus
()
web/src/hooks/use-status.ts:40
↓ 22 callersFunctionCompilePlugin
CompilePlugin validates a plugin without publishing it. Callers that refresh multiple plugins use this together with ReplaceOverrides so readers obser
pkg/jsplugin/registry.go:243
↓ 22 callersFunctionGetResponseID
(c *gin.Context)
relay/helper/common.go:174
↓ 22 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:88
↓ 22 callersFunctionNewErrorWithStatusCode
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:299
↓ 22 callersFunctionResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:22
↓ 22 callersFunctioncompileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:842
↓ 22 callersFunctioncopyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 22 callersFunctionformatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:167
↓ 22 callersFunctionseedChannel
(t *testing.T, id int)
service/task_billing_test.go:119
↓ 21 callersMethodAddOtherRatio
(key string, ratio float64)
types/price_data.go:35
↓ 21 callersMethodDecode
(s string)
pkg/cachex/codec.go:12
↓ 21 callersFunctionGetEnvOrDefault
(env string, defaultValue int)
common/env.go:9
↓ 21 callersMethodGetStartIdx
()
common/page_info.go:17
↓ 21 callersFunctionSetContextKey
(c *gin.Context, key constant.ContextKey, value any)
common/gin.go:157
↓ 21 callersMethodValidate
()
relaykit/dto/channel_settings.go:371
↓ 21 callersMethodValue
()
model/task.go:98
↓ 21 callersFunctionperformPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:879
↓ 21 callersFunctionseedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:91
↓ 21 callersFunctionserveTaskPluginProtocol
( c *gin.Context, pinned pluginruntime.PinnedEndpoint, deps pluginProtocolBridgeDeps, )
controller/plugin_protocol.go:140
↓ 21 callersFunctiontestPluginRouteHandlers
( handler func(*gin.Context, *jsplugin.RoutingGeneration, jsplugin.RouteBinding), )
router/plugin_router_test.go:823
↓ 20 callersMethodEncode
(v V)
pkg/cachex/codec.go:11
↓ 20 callersMethodError
Error lets the same typed value serve both as the settlement audit marker and as the fail-fast error returned by strict pre-consume conversions.
common/quota_math.go:52
↓ 20 callersMethodRegisterFactory
(source string, options Options)
pkg/jsplugin/registry.go:205
↓ 20 callersFunctionSaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:50
↓ 20 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:231
↓ 20 callersFunctioncompilePluginProtocolTestEndpoint
(t *testing.T, key, source string)
controller/plugin_protocol_test.go:1420
↓ 20 callersFunctioncompileTaskRoutePlugin
(t *testing.T, source string)
middleware/task_plugin_test.go:1587
↓ 20 callersFunctiongetTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:475
↓ 20 callersFunctionrecordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:93
↓ 20 callersFunctionuseUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:17
↓ 19 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 19 callersFunctionPrepareTaskPluginRoute
PrepareTaskPluginRoute resolves and executes the pinned declarative route. Query requests terminate here so channel distribution and billing are never
middleware/task_plugin.go:50
↓ 19 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:510
↓ 19 callersFunctionnewPluginProtocolTestContext
(stream, requestBodyStream bool)
controller/plugin_protocol_test.go:1456
↓ 19 callersFunctionrender
()
web/src/components/turnstile.tsx:45
↓ 18 callersMethodClose
()
relaykit/types/file_source.go:209
↓ 18 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:147
↓ 18 callersFunctionGetPageQuery
(c *gin.Context)
common/page_info.go:41
↓ 18 callersMethodSetItems
(items any)
common/page_info.go:37
↓ 18 callersMethodSetTotal
(total int)
common/page_info.go:33
↓ 18 callersFunctionUnmarshalBodyReusable
(c *gin.Context, v any)
common/gin.go:108
↓ 18 callersFunctiongetCurrencyDisplay
()
web/src/lib/currency.ts:365
↓ 18 callersFunctionroutingTestPluginSource
(key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1015
↓ 18 callersFunctionsafeJsonParseWithValidation
( value: string | undefined | null, options: SafeJsonParseWithValidationOptions<T> )
web/src/features/system-settings/utils/json-parser.ts:141
↓ 18 callersFunctionuseChannels
()
web/src/features/channels/components/channels-provider.tsx:145
↓ 17 callersMethodGetOtherSettings
()
model/channel.go:1032
↓ 17 callersMethodParseToolCalls
()
relaykit/dto/openai_request.go:483
↓ 17 callersFunctionmustCompileRoutingPlugin
(t *testing.T, key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1008
↓ 17 callersFunctionpinTaskPluginRoute
(plugin *jsplugin.LoadedPlugin, routeIndex int)
middleware/task_plugin_test.go:1675
↓ 17 callersFunctionsetupModelListControllerTestDB
(t *testing.T)
controller/model_list_test.go:37
↓ 17 callersFunctionsetupUserSessionTest
(t *testing.T)
model/user_session_test.go:43
↓ 16 callersMethodDoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:28
↓ 16 callersFunctionGetChannelConstraints
(c *gin.Context)
service/channel_select.go:15
↓ 16 callersFunctionGetQuotaDisplayType
GetQuotaDisplayType 返回额度展示类型
setting/operation_setting/general_setting.go:55
↓ 16 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:188
↓ 16 callersMethodParseContent
()
relaykit/dto/claude.go:168
↓ 16 callersFunctionPinTaskPluginEndpoint
PinTaskPluginEndpoint decides shared-endpoint ownership without executing plugin code. Invalid or unidentifiable ordinary requests deliberately fall t
middleware/task_plugin.go:318
↓ 16 callersFunctionPrepareTaskPluginEndpoint
PrepareTaskPluginEndpoint normalizes a claimed shared request through the deterministic parser pinned before distribution. A shared-model request can
middleware/task_plugin.go:506
↓ 16 callersFunctionRelayErrorHandler
(ctx context.Context, resp *http.Response, showBodyWhenFail bool)
service/error.go:87
↓ 16 callersMethodRemove
(item T)
types/set.go:17
↓ 16 callersFunctioncountLogs
(t *testing.T)
service/task_billing_test.go:520
↓ 16 callersFunctionnewPluginRouterTest
( t *testing.T, plugins []*jsplugin.LoadedPlugin, handlers pluginRouteHandlers, )
router/plugin_router_test.go:780
↓ 16 callersFunctionnormalizeAdvancedCustomConfig
( config: AdvancedCustomConfig )
web/src/features/channels/lib/advanced-custom.ts:552
↓ 16 callersFunctionpluginProtocolTestOutcome
( info *relaycommon.RelayInfo, pluginKey string, taskID string, _ ...any, )
controller/plugin_protocol_test.go:1498
↓ 16 callersFunctionsetupStreamTest
(t *testing.T, body io.Reader)
relay/helper/stream_scanner_test.go:31
↓ 16 callersFunctionsideDrawerContentClassName
(className?: string)
web/src/components/drawer-layout.ts:24
↓ 16 callersFunctionuseCopyToClipboard
(options?: UseCopyToClipboardOptions)
web/src/hooks/use-copy-to-clipboard.ts:36
↓ 15 callersFunctionCacheGetChannel
(id int)
model/channel_cache.go:219
↓ 15 callersMethodClose
()
common/body_storage.go:214
↓ 15 callersFunctionConvertRequest
(c context.Context, info convmeta.Meta, target types.RelayFormat, request any)
relaykit/relayconvert/request_registry.go:151
↓ 15 callersMethodDoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:29
↓ 15 callersFunctionFinishSystemTask
(taskID string, lockedBy string, status SystemTaskStatus, resultPayload any, errorMessage string)
model/system_task.go:383
↓ 15 callersFunctionGetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 15 callersFunctionGetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:125
↓ 15 callersFunctionMainDatabaseType
()
common/database.go:15
↓ 15 callersFunctionNewPluginResponsesMachine
(taskID, model string, createdAt int64, limits PluginProtocolLimits)
relay/plugin_protocol.go:378
↓ 15 callersFunctionNormalizeEmail
(email string)
model/user.go:304
↓ 15 callersMethodOtherRatios
()
types/price_data.go:58
↓ 15 callersFunctionRunExprWithRequest
(exprStr string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:28
↓ 15 callersMethodSeek
(offset int64, whence int)
common/body_storage.go:205
↓ 15 callersFunctionSetEventStreamHeaders
(c *gin.Context)
relay/helper/common.go:45
↓ 15 callersMethodString
()
service/http_transport_policy.go:89
↓ 15 callersMethodUpdate
(updatePassword bool)
model/user.go:749
← previousnext →101–200 of 10,934, ranked by callers