MCPcopy Create free account

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

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

↓ 4 callersFunctionwaitPerfCounters
waitPerfCounters waits for the asynchronous health samples of the fixture model to reach wantRequests and returns the request and success counters.
controller/responses_websocket_test.go:311
↓ 4 callersFunctionwatchRuntimeContext
(runtime *moejs.Runtime, ctx context.Context, timeout time.Duration, timeoutError error)
pkg/jsplugin/engine.go:822
↓ 4 callersMethodwithDefaults
()
controller/plugin_protocol.go:98
↓ 4 callersFunctionwithSystemTaskRegistry
withSystemTaskRegistry swaps the package registry for the given handlers for the duration of a test and restores the original registry afterward.
service/system_task_test.go:17
↓ 4 callersMethodwrite
write adds s and reports whether the sink takes more.
relay/requestplugin/extract.go:32
↓ 4 callersFunctionwriteAccessTokenError
writeAccessTokenError responds with a stable code and a web console message.
controller/access_token.go:47
↓ 4 callersFunctionwriteRateLimited
writeRateLimited rejects the request with 429 and a Retry-After hint so clients can back off instead of treating the rejection as a fatal error. The i
middleware/rate-limit.go:140
↓ 4 callersMethodwriteRune
(char rune)
relay/requestplugin/extract.go:44
↓ 4 callersFunctionwriteUserSessionDenyFence
(session *UserSession, status string, now int64, reason string)
model/user_session.go:406
↓ 3 callersFunctionAccessTokenCatalog
AccessTokenCatalog lists the scopes this user may grant right now, grouped for display. Resources without a grantable action and empty groups are omit
service/access_token_scope.go:125
↓ 3 callersFunctionAcquireLogExportLock
AcquireLogExportLock reserves the one log export a user may run at a time. With Redis the reservation spans all nodes and lapses within a minute if th
service/log_export.go:33
↓ 3 callersFunctionAdminBindSubscription
Admin bind (no payment). Creates a UserSubscription from a plan.
model/subscription.go:726
↓ 3 callersFunctionAdminResetPlanSubscriptions
(planId int, advanceResetTime bool)
model/subscription.go:1129
↓ 3 callersFunctionAllPermissions
AllPermissions returns every registered permission.
service/authz/registry.go:42
↓ 3 callersMethodApply
(query *gorm.DB)
model/user.go:52
↓ 3 callersFunctionApplyChannelGroupFilter
(query *gorm.DB, group string)
model/channel.go:171
↓ 3 callersFunctionApplyOriginTaskAffinity
ApplyOriginTaskAffinity is the compatibility name for ApplyChannelPin.
relay/relay_task.go:194
↓ 3 callersFunctionAutomaticRetryStatusCodesToString
()
setting/operation_setting/status_code_ranges.go:57
↓ 3 callersFunctionBaseModelName
BaseModelName strips explicit model modifiers and any enabled legacy alias. Names on the thinking-suffix blacklist stay verbatim, including @ tails. M
setting/reasoning/suffix.go:76
↓ 3 callersMethodBuildBalanceRequest
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:199
↓ 3 callersFunctionBuildParamOverrideContext
BuildParamOverrideContext 提供 ApplyParamOverride 可用的上下文信息。 目前内置以下字段: - upstream_model/model:始终为通道映射后的上游模型名。 - original_model:请求最初指定的模型名。 - user_id:已认证用
relay/common/override.go:2183
↓ 3 callersFunctionBuildProxyURL
BuildProxyURL constructs the video proxy URL using the public task ID. e.g., "https://your-server.com/v1/videos/task_xxxx/content"
relay/channel/task/taskcommon/helpers.go:65
↓ 3 callersFunctionCORS
()
middleware/cors.go:9
↓ 3 callersFunctionCache
()
middleware/cache.go:7
↓ 3 callersMethodCallCredentialRejected
CallCredentialRejected runs credentialRejected(ctx, {status, headers, body}) for a non-2xx response.
pkg/jsplugin/provider.go:534
↓ 3 callersMethodCallInto
CallInto invokes one named module export and stores its result in target as the host codec decodes the encoding of the value Call returns, without tha
pkg/jsplugin/engine.go:348
↓ 3 callersMethodCallRefresh
CallRefresh runs refresh(ctx).
pkg/jsplugin/provider.go:328
↓ 3 callersFunctionChannelSupportsPluginLogin
ChannelSupportsPluginLogin reports a task plugin channel whose plugin exports login, which may be created without a key.
service/provider_plugin_login.go:121
↓ 3 callersFunctionCheckNotificationLimit
CheckNotificationLimit checks if the user has exceeded their notification limit Returns true if the user can send notification, false if limit exceede
service/notify-limit.go:50
↓ 3 callersFunctionCheckSubmittedPluginCredentials
CheckSubmittedPluginCredentials rejects a key an administrator submits for a channel when it holds a plugin credential only a login can create: one no
service/provider_plugin.go:625
↓ 3 callersFunctionCheckSystemOverload
CheckSystemOverload 返回哨兵应据以熔断的过载项。监控关闭、采样缺失或已超过 systemStatusMaxAge 时返回 nil。过载标记来自连续采样,阈值按当前配置复核, 运行时关闭或调高阈值后立即放行,不必等待下一次采样。
common/system_monitor.go:146
↓ 3 callersFunctionCloneBillingUsageWithEstimatedCompletion
CloneBillingUsageWithEstimatedCompletion preserves the original upstream billing dialect and fills a missing completion count without rebuilding the p
relaykit/dto/billing_usage.go:165
↓ 3 callersFunctionCloseChannels
(channelIDs []int, reason string)
pkg/wsmanager/wsmanager.go:93
↓ 3 callersFunctionCompleteSecurityVerification
CompleteSecurityVerification runs after the concrete authentication ceremony. Recheck the session and policy after potentially slow external authentic
service/security_verification.go:491
↓ 3 callersFunctionCompletionRatio2JSONString
()
setting/ratio_setting/model_ratio.go:428
↓ 3 callersMethodConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/advancedcustom/adaptor.go:52
↓ 3 callersMethodConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/advancedcustom/adaptor.go:111
↓ 3 callersFunctionConvertRequestVia
(c context.Context, info convmeta.Meta, request any, path ...types.RelayFormat)
relaykit/relayconvert/request_registry.go:180
↓ 3 callersMethodConvertRerankRequest
(c *gin.Context, relayMode int, request dto.RerankRequest)
relay/channel/adapter.go:24
↓ 3 callersFunctionConvertStreamResponse
(c context.Context, info convmeta.Meta, target types.RelayFormat, response any)
relaykit/relayconvert/response_registry.go:272
↓ 3 callersFunctionCountUserSessionsCreatedSince
CountUserSessionsCreatedSince counts every issued row, regardless of its current status or expiry. userID zero selects the global count.
model/user_session.go:195
↓ 3 callersFunctionCountUserTokens
CountUserTokens returns total number of tokens for the given user, used for pagination
model/token.go:443
↓ 3 callersFunctionCreateDiskCacheFile
CreateDiskCacheFile 创建磁盘缓存文件 cacheType: 缓存类型(body/file) 返回文件路径和文件句柄
common/disk_cache.go:42
↓ 3 callersFunctionCreateTwoFAEnrollment
CreateTwoFAEnrollment stores the pending credential, recovery codes and session-bound flow atomically. Reinitialization invalidates the previous setup
model/twofa_enrollment.go:23
↓ 3 callersFunctionDecompressRequestMiddleware
()
middleware/gzip.go:26
↓ 3 callersFunctionDecryptPassword
DecryptPassword accepts legacy RSA-OAEP/SHA-256 ciphertext and v2 envelopes. V2 wraps a fresh AES-256 key with RSA-OAEP and encrypts the password with
common/password_crypto.go:102
↓ 3 callersMethodDefaultMaxTokensFor
(modelName string)
relaykit/relayconvert/convmeta/options.go:97
↓ 3 callersMethodDelete
()
model/redemption.go:218
↓ 3 callersFunctionDeleteOldLogBatch
(ctx context.Context, targetTimestamp int64, limit int)
model/log.go:784
↓ 3 callersFunctionDeleteTaskPluginVersion
(key, version string)
model/task_plugin.go:287
↓ 3 callersFunctionDeleteVendors
(ids []int)
model/vendor_management.go:208
↓ 3 callersFunctionDisablePluginCredentialForLogin
DisablePluginCredentialForLogin disables the key holding line, a credential only a new login restores, for the reason a successful login clears, so re
service/provider_plugin.go:284
↓ 3 callersFunctionDoMidjourneyHttpRequest
(c *gin.Context, timeout time.Duration, fullRequestURL string)
service/midjourney.go:299
↓ 3 callersFunctionEmailVerificationRateLimit
()
middleware/email-verification-rate-limit.go:54
↓ 3 callersFunctionEnsureEmailAvailable
(email string, excludeUserID int)
model/user.go:348
↓ 3 callersFunctionErrOptionWithStatusCode
(statusCode int)
relaykit/types/error.go:401
↓ 3 callersMethodError
()
pkg/jsplugin/transform.go:183
↓ 3 callersMethodError
()
pkg/jsplugin/registry.go:1366
↓ 3 callersMethodEvent
Event passes one event of the response to the client once the reply check released its text. After a stop it drops the event.
relay/requestplugin/socket.go:95
↓ 3 callersFunctionExpireSubscriptionOrder
(tradeNo string, expectedPaymentProvider string)
model/subscription.go:700
↓ 3 callersMethodExpiresWithin
ExpiresWithin reports whether the credential has an expiry and reaches it within margin of now.
pkg/jsplugin/provider.go:113
↓ 3 callersMethodFailResponsesStream
FailResponsesStream emits protocol-native terminal error events when the target is OpenAI Responses. It returns handled=false for other targets.
relaykit/relayconvert/response_registry.go:438
↓ 3 callersMethodFailureResponse
FailureResponse returns a sanitized non-stream failure for host-side protocol errors.
relay/plugin_protocol.go:629
↓ 3 callersFunctionFetchModelList
FetchModelList fetches the model list of a channel through its plugin's v1/models relay route, built as a relay request on that route is: a credential
relay/channel/providerplugin/management.go:83
↓ 3 callersFunctionFetchModels
(c *gin.Context)
controller/channel.go:1690
↓ 3 callersFunctionFromClaude
FromClaude reads Claude's native thinking and output_config controls. Budget bounds are not enforced here: the Claude renderer clamps budgets into 102
relaykit/relayconvert/reasoning/intent.go:561
↓ 3 callersFunctionFromGemini
FromGemini reads a native thinkingConfig. A config carrying both a budget and a level is rejected here because the intent alone cannot tell which one
relaykit/relayconvert/reasoning/intent.go:626
↓ 3 callersFunctionGeminiChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:305
↓ 3 callersFunctionGeminiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:22
↓ 3 callersFunctionGenerateHMAC
(data string)
common/crypto.go:18
↓ 3 callersFunctionGeneratePasswordEncryptionPrivateKey
GeneratePasswordEncryptionPrivateKey creates the server key used to decrypt browser login passwords. The caller is responsible for persisting the PEM.
common/password_crypto.go:33
↓ 3 callersFunctionGenerateStopResponse
(id string, createAt int64, model string, finishReason string)
relay/helper/common.go:361
↓ 3 callersFunctionGenerateTaskID
GenerateTaskID 生成对外暴露的 task_xxxx 格式 ID
model/task.go:227
↓ 3 callersFunctionGenerateVerificationCode
(length int)
common/verification.go:26
↓ 3 callersFunctionGetAllChannels
(startIdx int, num int, selectAll bool, idSort bool, sortOptions ...ChannelSortOptions)
model/channel.go:426
↓ 3 callersFunctionGetAndValidateClaudeRequest
(c *gin.Context)
relay/helper/valid_request.go:315
↓ 3 callersFunctionGetAndValidateResponsesRequest
(c *gin.Context)
relay/helper/valid_request.go:137
↓ 3 callersFunctionGetAndValidateTextRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:338
↓ 3 callersMethodGetAutoGroups
()
model/token.go:39
↓ 3 callersFunctionGetBase64Data
GetBase64Data 获取 base64 编码的数据
service/file_service.go:418
↓ 3 callersMethodGetBase64Data
()
relaykit/types/file_source.go:180
↓ 3 callersMethodGetBillingChannelId
()
model/midjourney.go:182
↓ 3 callersFunctionGetByMJId
(userId int, mjId string)
model/midjourney.go:130
↓ 3 callersFunctionGetByTaskIdsForPlatforms
(userID int, platforms []constant.TaskPlatform, taskIDs []string)
model/task.go:486
↓ 3 callersMethodGetCache
()
relaykit/types/file_source.go:20
↓ 3 callersFunctionGetCacheRatio
GetCacheRatio returns the cache ratio for a model
setting/ratio_setting/cache_ratio.go:164
↓ 3 callersFunctionGetCallbackAddress
()
service/epay.go:8
↓ 3 callersFunctionGetChannelsByTag
(tag string, idSort bool, selectAll bool, sortOptions ...ChannelSortOptions)
model/channel.go:438
↓ 3 callersMethodGetClaudeError
GetClaudeError 从动态错误类型中提取ClaudeError结构
relaykit/dto/claude.go:645
↓ 3 callersFunctionGetCreateCacheRatio
(name string)
setting/ratio_setting/cache_ratio.go:172
↓ 3 callersFunctionGetEffectiveHeaderOverride
(info *RelayInfo)
relay/common/override.go:570
↓ 3 callersMethodGetEfforts
()
relaykit/dto/claude.go:482
↓ 3 callersMethodGetFile
()
relaykit/dto/openai_request.go:557
↓ 3 callersFunctionGetFlowQuotaData
(startTime int64, endTime int64, username string, userID int, role int)
model/usedata_flow.go:25
↓ 3 callersFunctionGetImageRatio
(name string)
setting/ratio_setting/model_ratio.go:660
↓ 3 callersMethodGetIndex
get index
relaykit/dto/claude.go:637
↓ 3 callersMethodGetIsStream
()
relaykit/relayconvert/convmeta/meta.go:28
↓ 3 callersFunctionGetLatestSystemTask
GetLatestSystemTask returns the most recent task row of the given type (any status) so the scheduler can decide whether enough time has elapsed since
model/system_task.go:256
↓ 3 callersFunctionGetLegalSettings
()
setting/system_setting/legal.go:19
↓ 3 callersFunctionGetMimeTypeByExtension
(ext string)
service/file_decoder.go:159
← previousnext →2,101–2,200 of 15,409, ranked by callers