MCPcopy Create free account

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

Functions12,901 in github.com/QuantumNous/new-api

↓ 40 callersMethodSave
()
model/channel.go:352
↓ 40 callersMethodWrite
(data []byte)
controller/responses_websocket.go:72
↓ 39 callersFunctionmakeTask
(userId, channelId, quota, tokenId int, billingSource string, subscriptionId int)
service/task_billing_test.go:140
↓ 38 callersFunctionApiErrorI18n
ApiErrorI18n returns a translated error message based on the user's language preference key is the i18n message key, args is optional template data
common/gin.go:223
↓ 38 callersMethodRemove
(item T)
types/set.go:17
↓ 37 callersMethodError
()
relaykit/types/error.go:123
↓ 37 callersMethodGetSetting
()
model/user.go:179
↓ 37 callersFunctionInitChannelCache
()
model/channel_cache.go:27
↓ 37 callersFunctionuseUpdateOption
()
web/src/features/system-settings/hooks/use-update-option.ts:50
↓ 36 callersMethodWriteHeader
(statusCode int)
router/plugin-router.go:435
↓ 35 callersMethodClone
Clone preserves presence information without sharing mutable usage fields.
relaykit/dto/openai_response.go:290
↓ 34 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:306
↓ 34 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:438
↓ 33 callersFunctionStreamScannerHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo, dataHandler func(data string, sr *StreamRes
relay/helper/stream_scanner.go:83
↓ 32 callersMethodReplaceOverrides
ReplaceOverrides atomically publishes a complete override layer.
pkg/jsplugin/registry.go:601
↓ 32 callersFunctionSetupApiRequestHeader
(info *common.RelayInfo, c *gin.Context, req *http.Header)
relay/channel/api_request.go:51
↓ 32 callersFunctiongetUserQuota
--------------------------------------------------------------------------- Read-back helpers --------------------------------------------------------
service/task_billing_test.go:511
↓ 31 callersFunctionDoApiRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:313
↓ 31 callersMethodGet
(platform string)
pkg/jsplugin/registry.go:511
↓ 31 callersMethodRegisterFactory
(source string, options Options)
pkg/jsplugin/registry.go:269
↓ 31 callersMethodaddEventListener
( type: string, listener: (event: Event & { data?: string; readyState?: number }) => void )
web/src/features/playground/hooks/use-stream-request.test.ts:41
↓ 31 callersFunctionrecordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:141
↓ 30 callersMethodMigrator
(db *gorm.DB)
model/migration_dialector.go:18
↓ 30 callersMethodcall
( ctx context.Context, admissionTimeout time.Duration, exportName string, members []string, args ...any,
pkg/jsplugin/engine.go:328
↓ 29 callersMethodClose
()
relaykit/types/file_source.go:209
↓ 29 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
↓ 29 callersMethodStringContent
()
relaykit/dto/openai_request.go:640
↓ 29 callersFunctionissueSecurityEnrollmentProof
(t *testing.T, identity service.AuthIdentity, operation service.VerificationOperation, method string)
controller/security_enrollment_test.go:120
↓ 29 callersFunctionroutingTestPluginSource
(key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1102
↓ 28 callersFunctionGetChannelConstraints
(c *gin.Context)
service/channel_select.go:19
↓ 28 callersMethodRegister
Register 注册一个配置模块
setting/config/config.go:28
↓ 28 callersMethodValidateRequestAndSetAction
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:39
↓ 27 callersMethodGetBaseURL
()
model/channel.go:523
↓ 27 callersFunctionGetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:79
↓ 27 callersMethodStop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:36
↓ 27 callersFunctionUsingMainDatabase
(databaseType DatabaseType)
common/database.go:36
↓ 27 callersFunctionadvancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:969
↓ 27 callersFunctionchannelActionConfig
( config: ApiRequestConfig = {} )
web/src/features/channels/api.ts:45
↓ 27 callersFunctionpluginProtocolTestDeps
()
controller/plugin_protocol_test.go:1509
↓ 27 callersFunctionuseStatus
()
web/src/hooks/use-status.ts:35
↓ 26 callersMethodCallPath
CallPath invokes a function nested below an exported object. It is used for protocol hooks such as protocols.openai_responses.renderEvents.
pkg/jsplugin/engine.go:310
↓ 26 callersFunctionGetGlobalSettings
()
setting/model_setting/global.go:76
↓ 26 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:205
↓ 26 callersFunctionWithOpenAIError
(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:317
↓ 26 callersMethodresolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:345
↓ 26 callersFunctionsetupTaskPluginControllerTest
(t *testing.T)
controller/task_plugin_test.go:28
↓ 25 callersFunctionGetPasskeySettings
()
setting/system_setting/passkey.go:150
↓ 25 callersMethodRoutingErrors
()
pkg/jsplugin/registry.go:662
↓ 25 callersFunctionformatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:167
↓ 25 callersFunctionmustApplyReasoningModelSuffix
(t *testing.T, info *relaycommon.RelayInfo, outbound ...dto.Request)
relay/helper/reasoning_suffix_test.go:22
↓ 25 callersMethodopen
(_method: string, url: string)
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:185
↓ 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 callersFunctionMainDatabaseType
()
common/database.go:15
↓ 24 callersFunctionRequestPolicy
(c *gin.Context)
service/request_policy.go:55
↓ 23 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:88
↓ 23 callersFunctionIOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 23 callersFunctionInitHttpClient
()
service/http_client.go:139
↓ 23 callersMethodValidate
()
relaykit/dto/channel_settings.go:447
↓ 23 callersFunctionauthResult
( request: Promise<{ data: { success: boolean; message?: string; code?: string; data?: T } }>, fallb
web/src/lib/secure-verification.ts:68
↓ 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:255
↓ 23 callersFunctionperformPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:882
↓ 23 callersFunctionseedChannel
(t *testing.T, id int)
service/task_billing_test.go:120
↓ 23 callersFunctionseedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:92
↓ 22 callersFunctionCreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:52
↓ 22 callersMethodError
()
relaykit/relayconvert/reasoning/intent.go:36
↓ 22 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
↓ 22 callersMethodGetPageSize
()
common/page_info.go:25
↓ 22 callersMethodSource
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 22 callersFunctioncompileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:845
↓ 22 callersFunctiongetCurrencyDisplay
()
web/src/lib/currency.ts:365
↓ 22 callersFunctionrecordUserSecurityAudit
recordUserSecurityAudit 记录普通用户自己的安全敏感操作(如 passkey 绑定/解绑)。 这类日志没有管理员操作者,不写 admin_info;同时不依赖 AdminAuth/RootAuth 的兜底。
controller/audit.go:161
↓ 21 callersMethodAddOtherRatio
(key string, ratio float64)
types/price_data.go:35
↓ 21 callersMethodEncode
(v V)
pkg/cachex/codec.go:11
↓ 21 callersMethodGetOtherSettings
()
model/channel.go:1058
↓ 21 callersFunctionGetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 21 callersMethodKeys
Keys returns keys with valid values. In Redis, it returns all matching keys.
pkg/cachex/hybrid_cache.go:132
↓ 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 callersFunctionParseAccessToken
(raw string)
service/auth_token.go:85
↓ 21 callersFunctionRegister
Register registers an OAuth provider with the given name
oauth/registry.go:21
↓ 21 callersFunctionResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:22
↓ 21 callersFunctionRunExprWithRequest
(exprStr string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:30
↓ 21 callersMethodWrite
(b []byte)
middleware/audit.go:25
↓ 21 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:230
↓ 21 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:567
↓ 21 callersFunctiongetTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:532
↓ 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:826
↓ 20 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 20 callersMethodDoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:28
↓ 20 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
↓ 20 callersFunctionGetEnvOrDefault
(env string, defaultValue int)
common/env.go:9
↓ 20 callersMethodGetStartIdx
()
common/page_info.go:17
↓ 20 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:245
↓ 20 callersFunctionSaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:102
↓ 20 callersMethodabort
()
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:192
↓ 20 callersFunctioncompilePluginProtocolTestEndpoint
(t *testing.T, key, source string)
controller/plugin_protocol_test.go:1444
↓ 20 callersFunctioncompileTaskRoutePlugin
(t *testing.T, source string)
middleware/task_plugin_test.go:1658
↓ 20 callersFunctioncopyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
← previousnext →101–200 of 12,901, ranked by callers