MCPcopy Create free account

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

Functions11,918 in github.com/QuantumNous/new-api

↓ 31 callersMethodError
()
relaykit/types/error.go:123
↓ 31 callersMethodGet
(platform string)
pkg/jsplugin/registry.go:441
↓ 31 callersMethodGetSetting
()
model/user.go:179
↓ 31 callersFunctionInitChannelCache
()
model/channel_cache.go:27
↓ 31 callersFunctionSetContextKey
(c *gin.Context, key constant.ContextKey, value any)
common/gin.go:157
↓ 30 callersFunctionrecordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:106
↓ 29 callersFunctionGetChannelById
GetChannelById loads a channel directly from the database, bypassing the in-memory channel cache. WARNING: do NOT call this on request hot paths (mid
model/channel.go:436
↓ 28 callersFunctionNew
(plugin *pluginruntime.LoadedPlugin)
relay/channel/task/jsplugin/adaptor.go:90
↓ 28 callersMethodRegister
Register 注册一个配置模块
setting/config/config.go:28
↓ 27 callersMethodSetPublic
SetPublic records metadata that log owners may receive from self/token log APIs. It rejects role-scoped and legacy-sensitive keys so new writers canno
model/log_other.go:60
↓ 27 callersMethodStop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:29
↓ 27 callersFunctionchannelActionConfig
( config: ApiRequestConfig = {} )
web/src/features/channels/api.ts:43
↓ 26 callersFunctionGetGlobalSettings
()
setting/model_setting/global.go:76
↓ 26 callersFunctionGetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:30
↓ 26 callersMethodStringContent
()
relaykit/dto/openai_request.go:569
↓ 26 callersFunctionUsingMainDatabase
(databaseType DatabaseType)
common/database.go:36
↓ 26 callersFunctionadvancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:832
↓ 26 callersMethodcall
( ctx context.Context, admissionTimeout time.Duration, exportName string, members []string, args ...any,
pkg/jsplugin/engine.go:331
↓ 26 callersFunctionissueSecurityEnrollmentProof
(t *testing.T, identity service.AuthIdentity, operation service.VerificationOperation, method string)
controller/security_enrollment_test.go:120
↓ 26 callersMethodopen
(_method: string, url: string)
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:185
↓ 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
↓ 25 callersFunctionmustApplyReasoningModelSuffix
(t *testing.T, info *relaycommon.RelayInfo, outbound ...dto.Request)
relay/helper/reasoning_suffix_test.go:22
↓ 24 callersMethodGetBaseURL
()
model/channel.go:521
↓ 24 callersFunctionGetResponseID
(c *gin.Context)
relay/helper/common.go:174
↓ 24 callersFunctionGetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:131
↓ 24 callersFunctionIOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 24 callersMethodRegisterFactory
(source string, options Options)
pkg/jsplugin/registry.go:205
↓ 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 callersFunctionformatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:167
↓ 24 callersFunctionsetupTaskPluginControllerTest
(t *testing.T)
controller/task_plugin_test.go:25
↓ 23 callersMethodDecode
(s string)
pkg/cachex/codec.go:12
↓ 23 callersMethodError
()
relaykit/relayconvert/reasoning/intent.go:35
↓ 23 callersMethodGetPageSize
()
common/page_info.go:25
↓ 23 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:88
↓ 23 callersFunctionNewErrorWithStatusCode
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:299
↓ 23 callersMethodValue
()
model/task.go:98
↓ 23 callersMethodmakeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callersMethodmatch
(response *dto.GeminiFunctionResponse)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_req.go:241
↓ 23 callersFunctionperformPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:879
↓ 23 callersFunctionpluginProtocolTestDeps
()
controller/plugin_protocol_test.go:1485
↓ 23 callersFunctionseedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:91
↓ 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 callersFunctionauthResult
( request: Promise<{ data: { success: boolean; message?: string; code?: string; data?: T } }>, fallb
web/src/lib/secure-verification.ts:64
↓ 22 callersFunctioncompileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:842
↓ 22 callersFunctionrecordUserSecurityAudit
recordUserSecurityAudit 记录普通用户自己的安全敏感操作(如 passkey 绑定/解绑)。 这类日志没有管理员操作者,不写 admin_info;同时不依赖 AdminAuth/RootAuth 的兜底。
controller/audit.go:126
↓ 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 callersFunctionCreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:52
↓ 21 callersMethodEncode
(v V)
pkg/cachex/codec.go:11
↓ 21 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
↓ 21 callersFunctionGetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 21 callersMethodGetStartIdx
()
common/page_info.go:17
↓ 21 callersFunctionParseAccessToken
(raw string)
service/auth_token.go:84
↓ 21 callersFunctionResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:22
↓ 21 callersMethodValidate
()
relaykit/dto/channel_settings.go:389
↓ 21 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:231
↓ 21 callersFunctiongetTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:475
↓ 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 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 20 callersFunctionGetEnvOrDefault
(env string, defaultValue int)
common/env.go:9
↓ 20 callersFunctionSaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:50
↓ 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 callersFunctioncopyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 20 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:510
↓ 20 callersMethodresolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:367
↓ 20 callersFunctionuseUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:17
↓ 19 callersMethodClose
()
relaykit/types/file_source.go:209
↓ 19 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:212
↓ 19 callersFunctionMainDatabaseType
()
common/database.go:15
↓ 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 callersFunctionRegister
Register registers an OAuth provider with the given name
oauth/registry.go:20
↓ 19 callersFunctionnewPluginProtocolTestContext
(stream, requestBodyStream bool)
controller/plugin_protocol_test.go:1456
↓ 18 callersFunctionCloneBillingUsage
(usage *BillingUsage)
relaykit/dto/billing_usage.go:225
↓ 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 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:207
↓ 18 callersMethodMigrator
(db *gorm.DB)
model/migration_dialector.go:17
↓ 18 callersFunctionNormalizeEmail
(email string)
model/user.go:325
↓ 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 callersMethodDoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:28
↓ 17 callersMethodGetOtherSettings
()
model/channel.go:1035
↓ 17 callersFunctionGetPasskeySettings
()
setting/system_setting/passkey.go:35
↓ 17 callersMethodGetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:171
↓ 17 callersFunctionModelMappedHelper
(c *gin.Context, info *relaycommon.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:14
↓ 17 callersMethodParseContent
()
relaykit/dto/claude.go:182
↓ 17 callersMethodParseToolCalls
()
relaykit/dto/openai_request.go:553
↓ 17 callersMethodSource
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 17 callersFunctionValidateLoginSession
(identity AuthIdentity)
service/auth_session.go:130
← previousnext →101–200 of 11,918, ranked by callers