MCPcopy Create free account

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

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

↓ 8 callersMethodGetUsageMetadata
()
relaykit/dto/gemini.go:588
↓ 8 callersFunctionGetUserSessionBySID
(sid string)
model/user_session.go:208
↓ 8 callersFunctionGetUserSessionCached
GetUserSessionCached validates cached state first and falls back to the database on a miss or Redis read failure. A deny tombstone never falls back.
model/user_session.go:221
↓ 8 callersFunctionHashAccountPassword
HashAccountPassword is for account passwords, not MFA backup codes. The temporary bcrypt mode permits rolling out dual-format readers to all nodes bef
common/account_password.go:44
↓ 8 callersFunctionHeaderNavModuleAuth
(module string)
middleware/header_nav.go:104
↓ 8 callersFunctionInterface2String
(inter any)
common/utils.go:166
↓ 8 callersFunctionIsSkipRetryError
(err *NewAPIError)
relaykit/types/error.go:381
↓ 8 callersFunctionIssueSecurityProof
(identity AuthIdentity, method string, binding VerificationBinding)
service/auth_token.go:126
↓ 8 callersFunctionModelRequestRateLimit
ModelRequestRateLimit 模型请求限流中间件
middleware/model-rate-limit.go:173
↓ 8 callersFunctionNewChannelError
(channelId int, channelType int, channelName string, isMultiKey bool, usingKey string, autoBan bool)
relaykit/types/channel_error.go:12
↓ 8 callersFunctionParseHTTPStatusCodeRanges
(input string)
setting/operation_setting/status_code_ranges.go:117
↓ 8 callersFunctionPassword2Hash
(password string)
common/crypto.go:24
↓ 8 callersFunctionPreConsumeBilling
PreConsumeBilling 根据用户计费偏好创建 BillingSession 并执行预扣费。 会话存储在 relayInfo.Billing 上,供后续 Settle / Refund 使用。 会话已存在时(任务重试换到另一个渠道)把预扣补到 preConsumedQuota, 和首次预扣
service/billing.go:24
↓ 8 callersFunctionPrepareMidjourneyTaskBilling
PrepareMidjourneyTaskBilling sets the durable refund marker before the task is inserted.
service/midjourney.go:34
↓ 8 callersMethodRead
(p []byte)
relay/channel/providerplugin/stream.go:330
↓ 8 callersFunctionRefundTaskQuota
RefundTaskQuota 统一的任务失败退款逻辑。 当异步任务失败时,退还资金与令牌额度,并回减用户和渠道用量。 返回资金来源是否已成功退还;失败时保留 quota,供显式重试或人工对账。
service/task_billing.go:267
↓ 8 callersFunctionRelay
(c *gin.Context, relayFormat types.RelayFormat)
controller/relay.go:73
↓ 8 callersMethodRelyingPartyIDs
()
setting/system_setting/passkey.go:119
↓ 8 callersFunctionRemoveDisabledFields
RemoveDisabledFields 从请求 JSON 数据中移除渠道设置中禁用的字段 service_tier: 服务层级字段,可能导致额外计费(OpenAI、Claude、Responses API 支持) inference_geo: Claude 数据驻留推理区域字段(仅 Claude
relay/common/relay_info.go:1212
↓ 8 callersMethodRequireTerminal
RequireTerminal declares that the protocol always ends with an explicit terminal event, so a stream that ends without one was cut short.
relay/common/stream_status.go:104
↓ 8 callersFunctionRequireVerificationMethod
(identity AuthIdentity, scope, method string)
service/security_verification.go:472
↓ 8 callersFunctionResetProxyClientCache
ResetProxyClientCache clears cached proxy and non-default direct policy clients and closes idle connections on every transport/shard. The package-leve
service/http_client.go:464
↓ 8 callersFunctionResolveTaskModelAlias
ResolveTaskModelAlias returns the mapping-derived alias target for name (exact or ASCII-folded). g is the caller's routing generation: a Number mismat
model/task_model_alias.go:38
↓ 8 callersMethodResolvedPin
ResolvedPin returns the winning pin after priority resolution. Lowest Rank wins. Pins that name the same channel are merged (stricter RetryMode). over
dto/channel_constraints.go:78
↓ 8 callersMethodResponseOutcome
()
relay/common/stream_status.go:160
↓ 8 callersMethodResultRetrievable
ResultRetrievable reports whether retrieval surfaces (native query routes, protocol retrieve endpoints, artifact projection) may serve this task.
model/task.go:204
↓ 8 callersFunctionRoutingMatchModelName
RoutingMatchModelName returns the name used for channel-ability and token-limit fallback matching: strip @ modifiers and legacy aliases first, then ap
setting/ratio_setting/model_ratio.go:711
↓ 8 callersFunctionSetTaskPluginProtocolRouter
(router *gin.Engine)
router/task-plugin-protocol-router.go:13
↓ 8 callersMethodSetWithTTL
(key string, v V, ttl time.Duration)
pkg/cachex/hybrid_cache.go:111
↓ 8 callersMethodSetWriteDeadline
(deadline time.Time)
relay/helper/stream_scanner_test.go:690
↓ 8 callersMethodSnapshot
Snapshot returns a detached top-level view for tests and read-only inspection. Mutating it cannot add or replace fields in LogOther.
model/log_other.go:193
↓ 8 callersFunctionStartLoginVerification
(user *model.User, loginMethod string, migration *LegacyGitHubMigration)
service/login_verification.go:45
↓ 8 callersFunctionUnmarshalBodyReusable
(c *gin.Context, v any)
common/gin.go:119
↓ 8 callersFunctionUpdateGroupRatioByJSONString
(jsonStr string)
setting/ratio_setting/group_ratio.go:75
↓ 8 callersMethodUsage
()
relaykit/relayconvert/response_registry.go:405
↓ 8 callersFunctionValidateFlowAuthorization
ValidateFlowAuthorization permits a dedicated configuration flow to outlive its consumed proof, while retaining its operation, session and method poli
service/security_verification.go:545
↓ 8 callersFunctionabortWithOpenAiMessage
(c *gin.Context, statusCode int, message string, code ...types.ErrorCode)
middleware/utils.go:14
↓ 8 callersMethodauthorization
(t *testing.T, intent string, identity service.AuthIdentity, scope string, claims jwt.MapClaims)
controller/telegram_test.go:154
↓ 8 callersMethodbind
bind resolves the plugin pinned for the request and its route.
relay/channel/providerplugin/adaptor.go:518
↓ 8 callersFunctioncanManageTargetRole
(myRole int, targetRole int)
controller/user.go:383
↓ 8 callersFunctioncloneRaw
(raw []byte)
relaykit/relayconvert/internal/toolconv/decode.go:935
↓ 8 callersFunctionconvertCompatRequest
(c context.Context, info convmeta.Meta, target types.RelayFormat, request any)
relaykit/relayconvert/request_compat.go:76
↓ 8 callersMethoddecode
decode decompresses stream data as the library will, reading its filter and decode parameters through resolve: no filter, or FlateDecode with no predi
relay/requestplugin/pdf.go:1279
↓ 8 callersMethodevaluate
(node: ExpressionNode)
web/src/features/pricing/lib/billing-expression/runtime.ts:215
↓ 8 callersFunctionevaluateBillingExpression
( expression: string | CompiledBillingExpression, context: BillingSimulationContext = {} )
web/src/features/pricing/lib/billing-expression/runtime.ts:534
↓ 8 callersFunctionfindMarketplaceVersion
( plugin: MarketplacePlugin, version: string )
web/src/features/task-plugins/lib/marketplace.ts:369
↓ 8 callersFunctionformatBillingCondition
( source: string, t: Translate, locale = 'en' )
web/src/features/pricing/lib/billing-expression/condition-display.ts:243
↓ 8 callersFunctionformatQuotaWithCurrency
( quota: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:516
↓ 8 callersFunctiongeminiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response, callback func(data string, geminiResponse *
relay/channel/gemini/relay-gemini.go:204
↓ 8 callersFunctiongenerateTaskExprFromConfig
( config: TaskVisualConfig | null | undefined, schema: BillingUsageSchema )
web/src/features/pricing/lib/task-expr.ts:378
↓ 8 callersFunctiongetGroups
()
web/src/features/users/api.ts:207
↓ 8 callersFunctiongetTokenUsedQuota
(t *testing.T, id int)
service/task_billing_test.go:548
↓ 8 callersFunctiongetUserAuthVersionKey
(userId int)
model/user_auth_cache.go:33
↓ 8 callersMethodhasHook
(_ context.Context, hook string)
relay/channel/task/jsplugin/adaptor.go:2147
↓ 8 callersFunctionhasParsedChildren
( node: ParsedNode )
web/src/components/ai-elements/response-node-guards.ts:36
↓ 8 callersFunctionimageModel
(ctx)
plugins/tasks/alibaba/plugin.js:477
↓ 8 callersFunctionimageTask
(ctx)
plugins/tasks/doubao/plugin.js:477
↓ 8 callersFunctionisDynamicPricingModel
(model: PricingModel)
web/src/features/pricing/lib/dynamic-price.ts:144
↓ 8 callersFunctionisTagAggregateRow
(row: Channel | TagRow)
web/src/features/channels/lib/channel-utils.ts:619
↓ 8 callersFunctionisTokenBasedModel
(model: PricingModel)
web/src/features/pricing/lib/model-helpers.ts:107
↓ 8 callersFunctionisUnconfiguredTaskUsageModel
(model: PricingModel)
web/src/features/pricing/lib/dynamic-price.ts:162
↓ 8 callersFunctionjsonValue
(value any)
relay/channel/task/jsplugin/adaptor.go:2159
↓ 8 callersMethodmemCache
()
pkg/cachex/hybrid_cache.go:69
↓ 8 callersFunctionmetricValue
(metrics: FlowMetrics, metric: FlowMetric)
web/src/features/dashboard/lib/flow.ts:168
↓ 8 callersFunctionmodelManagementRequest
(t *testing.T, handler gin.HandlerFunc, method, path string, body any, output any)
controller/model_management_test.go:97
↓ 8 callersFunctionnewAuditTestDatabase
External tests create a new database per case on a loopback-only disposable instance. They never drop databases or tables supplied through an environm
controller/access_token_audit_test.go:831
↓ 8 callersMethodnewChannel
(channelType int, key string)
router/provider_plugin_relay_test.go:162
↓ 8 callersFunctionnewConvertRequestFailedError
(c *gin.Context, info *relaycommon.RelayInfo, err error)
relay/convert_request_error.go:13
↓ 8 callersFunctionnewPluginProtocolObservationLimiter
(limits pluginProtocolObservationLimits)
controller/plugin_protocol_limiter.go:56
↓ 8 callersFunctionnewService
newService starts the instance's service: /redirect answers 302, every other path 200. Each request it receives goes to the returned channel.
relay/requestplugin/requestplugin_test.go:687
↓ 8 callersFunctionnormalizeHeaderContextKey
(key string)
relay/common/override.go:1645
↓ 8 callersFunctionpresentTaskSubmission
(c *gin.Context, outcome *taskSubmissionOutcome)
controller/relay.go:900
↓ 8 callersFunctionrawJSONPresent
(value json.RawMessage)
relaykit/relayconvert/internal/toolconv/response_artifacts.go:805
↓ 8 callersFunctionredisIPRateLimitKey
(mark string, clientIP string)
middleware/rate-limit.go:45
↓ 8 callersMethodredisOn
()
pkg/cachex/hybrid_cache.go:59
↓ 8 callersFunctionregisterCredentialTaskPlugin
(t *testing.T, key string)
relay/channel/task/jsplugin/credential_test.go:114
↓ 8 callersFunctionrequestPluginFieldKind
( field: RequestPluginConfigField )
web/src/features/task-plugins/lib/request-plugins.ts:67
↓ 8 callersFunctionrequireAdminUserProof
requireAdminUserProof consumes the step-up proof for an administrative user operation after the caller has already authorized the operator against the
controller/secure_verification.go:147
↓ 8 callersFunctionrequireDeploymentID
(c *gin.Context)
controller/deployment.go:120
↓ 8 callersFunctionrequireOptionValue
(t *testing.T, db *gorm.DB, key string)
model/frontend_option_migration_test.go:30
↓ 8 callersFunctionresetBatchUpdateTestState
(t *testing.T)
model/quota_reserve_test.go:58
↓ 8 callersFunctionresetSessionCookieSettingsAfterTest
(t *testing.T)
common/url_validator_test.go:125
↓ 8 callersFunctionrespondPluginProtocolError
(c *gin.Context, status int, code, message string)
controller/plugin_protocol.go:1271
↓ 8 callersFunctionresponseStreamEventItemID
(event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:358
↓ 8 callersFunctionrunRequestPlugin
runRequestPlugin validates config against the plugin's schema, as the host does when an instance is saved, and runs one stage hook of a built-in reque
plugins/request_plugins_test.go:31
↓ 8 callersFunctionsecurityProofConfig
(proofToken?: string)
web/src/features/users/api.ts:39
↓ 8 callersFunctionseedToken
(t *testing.T, db *gorm.DB, userID int, name string, rawKey string)
controller/token_test.go:171
↓ 8 callersFunctionsettle
settle logs the failed steps and turns a rejection or a failure that stops the request into the client error. Neither the log nor a failure carries pl
relay/requestplugin/relay.go:483
↓ 8 callersFunctionsetupDashboardAuthMiddlewareTest
(t *testing.T)
middleware/auth_test.go:27
↓ 8 callersFunctionsetupRelayChannelDB
(t *testing.T)
relay/relay_task_test.go:33
↓ 8 callersFunctionsetupTaskPluginRouteDB
(t *testing.T)
middleware/task_plugin_test.go:2032
↓ 8 callersFunctionstaticProtection
(protection *common.SSRFProtection)
service/protected_fetch_client_test.go:26
↓ 8 callersFunctionstop
()
web/src/features/playground/hooks/use-stream-request.ts:177
↓ 8 callersFunctionstoredCredential
(t *testing.T, id, index int)
service/provider_plugin_test.go:314
↓ 8 callersFunctiontelegramIdentityClaims
(id any)
controller/telegram_test.go:186
↓ 8 callersFunctiontelegramOAuthCallback
(state, code string, identity service.AuthIdentity)
controller/telegram_test.go:194
↓ 8 callersFunctiontestVideoResponsesProtocol
(t *testing.T, testCase videoResponsesTestCase)
plugins/video_responses_test_helpers_test.go:26
↓ 8 callersFunctiontieredQuota
--------------------------------------------------------------------------- BuildTieredTokenParams: token normalization and ratio parity tests -------
service/tiered_settle_test.go:672
↓ 8 callersFunctionupdateChannelSub2APIBalance
(channel *model.Channel)
controller/channel-billing.go:434
↓ 8 callersFunctionuseContextValue
()
web/src/components/ai-elements/context.tsx:52
← previousnext →801–900 of 15,409, ranked by callers