MCPcopy Create free account

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

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

↓ 7 callersFunctioncreateUserSessionTestUser
(t *testing.T, userID int, authVersion int64)
model/user_session_test.go:66
↓ 7 callersFunctioncredentialTaskInfo
(baseURL, key string, channelType int)
relay/channel/task/jsplugin/credential_test.go:163
↓ 7 callersFunctioncreditTopUpQuota
creditTopUpQuota atomically enforces the wallet ceiling while adding quota. Keeping the predicate and increment in one UPDATE prevents two concurrent
model/topup.go:90
↓ 7 callersFunctioncurrentEnforcer
()
service/authz/enforcer.go:63
↓ 7 callersMethoddisabled
disabled receives the channel reread after UpdateChannelStatus succeeds. Checking the export table precedes all scheduler allocation and JS work.
service/provider_plugin_scheduled.go:146
↓ 7 callersFunctionfilterDisabledFactory
(factory map[string]*LoadedPlugin, disabled map[string]struct{})
pkg/jsplugin/registry.go:496
↓ 7 callersFunctionformatCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:408
↓ 7 callersFunctionformatPricingAmount
( value: string | number, currency = USD_PRICING_CURRENCY )
web/src/features/model-pricing/currency.ts:61
↓ 7 callersFunctionformatUptimePct
(pct: number)
web/src/features/performance-metrics/lib/format.ts:31
↓ 7 callersFunctiongetChannelTypeLabel
(type: number)
web/src/features/channels/lib/channel-utils.ts:39
↓ 7 callersFunctiongetServerErrorMessageKey
(value: unknown)
web/src/lib/server-error-message.ts:111
↓ 7 callersFunctiongetServerErrorSources
( value: unknown )
web/src/lib/server-error-message.ts:94
↓ 7 callersFunctiongetSubscriptionPlanByIdTx
(tx *gorm.DB, id int)
model/subscription.go:401
↓ 7 callersFunctiongetTaskEnumFields
( schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-expr.ts:79
↓ 7 callersFunctiongetTaskPricingDisplayTiers
( expression: string | null | undefined, schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-matrix-display.ts:63
↓ 7 callersFunctiongetUserQuotaForPaymentGuardTest
(t *testing.T, userID int)
model/payment_method_guard_test.go:84
↓ 7 callersFunctionimageContent
(body)
plugins/tasks/alibaba/plugin.js:733
↓ 7 callersFunctioninitDefaultHTTPClientFixture
(t *testing.T)
service/http_client_transport_test.go:45
↓ 7 callersFunctioninvalidateVendorData
(client: QueryClient)
web/src/features/models/vendor-api.ts:97
↓ 7 callersFunctionmanageMultiKeys
( params: MultiKeyManageParams )
web/src/features/channels/api.ts:562
↓ 7 callersFunctionmetadataTransaction
metadataTransaction serializes changes to vendors and model ownership before acquiring model/vendor row locks. The option anchor also covers empty tab
model/model_metadata_sync.go:19
↓ 7 callersFunctionnewAccessTokenTestRouter
newAccessTokenTestRouter mirrors the production paths, so the access token route rules keyed by gin full path apply unchanged.
controller/access_token_audit_test.go:75
↓ 7 callersFunctionnewAuthenticatedContext
(t *testing.T, method string, target string, body any, userID int)
controller/token_test.go:192
↓ 7 callersFunctionnewOuterPluginTestEngine
()
router/plugin_router_test.go:1048
↓ 7 callersMethodnewRefreshToken
newRefreshToken stores a refresh token the fake server accepts.
service/provider_plugin_test.go:324
↓ 7 callersFunctionnewSub2APITestChannel
(t *testing.T, serverURL string)
controller/channel_billing_sub2api_test.go:37
↓ 7 callersFunctionnewTaskUpstream
(t *testing.T)
relay/channel/task/jsplugin/credential_test.go:86
↓ 7 callersFunctionnumberValue
(value: unknown)
web/src/features/dashboard/lib/flow.ts:149
↓ 7 callersFunctionomniModel
(ctx)
plugins/tasks/vertex-ai/plugin.js:136
↓ 7 callersFunctionparseTaskTiersFromExpr
( exprStr: string, schema: BillingUsageSchema | null | undefined, includeBooleanConditions = false )
web/src/features/pricing/lib/billing-expr.ts:339
↓ 7 callersFunctionparseTiersFromExpr
(exprStr: string)
web/src/features/pricing/lib/billing-expr.ts:320
↓ 7 callersFunctionplainObject
(value)
plugins/tasks/vertex-ai/plugin.js:121
↓ 7 callersFunctionpluginProtocolTestSSEEventTypes
(body string)
controller/plugin_protocol_test.go:1545
↓ 7 callersFunctionpostAddChannel
(t *testing.T, userID, role int, body string)
controller/channel_task_plugin_bind_test.go:46
↓ 7 callersFunctionpricingEndpointTypesByModel
(t *testing.T)
model/pricing_endpoint_test.go:67
↓ 7 callersFunctionrateLimitFactory
(maxRequestNum int, duration int64, mark string)
middleware/rate-limit.go:148
↓ 7 callersFunctionregisterNetPlugin
(t *testing.T)
relay/requestplugin/requestplugin_test.go:785
↓ 7 callersFunctionregisterRotatingPlugin
(t *testing.T, key, extra string)
router/provider_plugin_relay_test.go:421
↓ 7 callersFunctionrequestContextDone
(c *gin.Context)
relay/helper/common.go:193
↓ 7 callersFunctionrequireOptionMissing
(t *testing.T, db *gorm.DB, key string)
model/frontend_option_migration_test.go:37
↓ 7 callersMethodresolveForConversion
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:386
↓ 7 callersMethodresponseSnapshot
(responseError *dto.PluginResponsesError)
relay/plugin_protocol.go:1002
↓ 7 callersFunctionroutingProtocolExport
(name string)
pkg/jsplugin/routing_test.go:655
↓ 7 callersFunctionsanitizeFetchModelsError
(err error, key string)
controller/channel_upstream_update.go:287
↓ 7 callersMethodsent
(t *testing.T, path string)
relay/channel/task/jsplugin/credential_test.go:101
↓ 7 callersFunctionsetupTaskPluginBindChannelTest
(t *testing.T)
controller/channel_task_plugin_bind_test.go:22
↓ 7 callersFunctionsseData
sseData returns the data of each event of a stream.
relay/requestplugin/requestplugin_test.go:1116
↓ 7 callersMethodsync
sync puts the steps and the record of the reply checks after the attempt's other entries on info, where the consume or error log reads them.
relay/requestplugin/reply.go:1494
↓ 7 callersFunctionsyncCreditUserQuotaCache
syncCreditUserQuotaCache 在授信事务(充值/兑换等)提交后同步把增量补进缓存 余额。预扣以缓存值为准(存在期间),授信不能绕过它,否则新到账的额度在 缓存过期前不可用;缓存未命中无需处理,下次读取会从已提交的数据库余额水合。
model/user_cache.go:174
↓ 7 callersFunctiontasksToDto
(tasks []*model.Task, fillUser bool, viewerRole int)
controller/task.go:440
↓ 7 callersFunctiontransformChannelToFormDefaults
( channel: Channel )
web/src/features/channels/lib/channel-form.ts:518
↓ 7 callersFunctionuseAccountSecurity
()
web/src/features/security/hooks/use-account-security.ts:34
↓ 7 callersFunctionuseCanEditModelPricing
()
web/src/features/model-pricing/api.ts:125
↓ 7 callersFunctionuseIsMobile
()
web/src/hooks/use-mobile.ts:23
↓ 7 callersFunctionuserSessionCacheDeadline
()
model/user_session.go:131
↓ 7 callersFunctionvendorAPIError
(c *gin.Context, err error)
controller/vendor_meta.go:95
↓ 7 callersFunctionvisitExpression
( node: ExpressionNode, visitor: (node: ExpressionNode) => void )
web/src/features/pricing/lib/billing-expression/types.ts:166
↓ 7 callersFunctionwithBasePricing
(model: PricingModel)
web/src/features/pricing/lib/plugin-pricing.ts:104
↓ 7 callersFunctionwithRelayHTTPTransportSettings
(t *testing.T)
service/http_client_transport_test.go:27
↓ 6 callersFunctionAccessTokenHint
AccessTokenHint is the last four characters of a token, shown so users can tell their tokens apart. PostgreSQL pads legacy CHAR(32) values with spaces
model/user_access_token.go:225
↓ 6 callersFunctionAccessTokenScopeOf
AccessTokenScopeOf is the token scope key for a Casbin permission.
service/access_token_scope.go:118
↓ 6 callersFunctionAdvanceCurrentSessionToUserVersion
AdvanceCurrentSessionToUserVersion is used when the security mutation and AuthVersion increment were committed in the same transaction (for example, a
service/auth_session.go:200
↓ 6 callersFunctionApplyChannelAffinityOverrideTemplate
ApplyChannelAffinityOverrideTemplate merges per-rule channel override templates onto the selected channel override config.
service/channel_affinity.go:533
↓ 6 callersFunctionApplyResponsesUsage
(dst *dto.Usage, src *dto.Usage)
service/responses_usage.go:154
↓ 6 callersFunctionApplyToOpenAIChat
ApplyToOpenAIChat writes the portable portion of an intent to the OpenAI pivot. reasoning_effort carries level-based strength; a JSON-excluded DTO sta
relaykit/relayconvert/reasoning/intent.go:452
↓ 6 callersMethodApplyVendorToolUsage
ApplyVendorToolUsage writes the vendor-billed counts of one upstream response into BuiltInTools. Protocol items counted earlier for the same key are r
relay/common/tool_usage.go:85
↓ 6 callersFunctionAttachRequest
(format types.RelayFormat, request any, set Set, options *convmeta.Options)
relaykit/relayconvert/internal/toolconv/encode.go:17
↓ 6 callersFunctionAutoGroups2JsonString
()
setting/auto_group.go:35
↓ 6 callersMethodCallPathWithAdmissionTimeout
CallPathWithAdmissionTimeout gives long-lived observers a separate bound for waiting on JavaScript capacity. Once admitted, the hook receives the engi
pluginkit/engine.go:384
↓ 6 callersMethodCallPathWithMemberJSON
CallPathWithMemberJSON is CallPathWithAdmissionTimeout that also returns the result's member as the text JSON.stringify writes for it, which keeps the
pluginkit/engine.go:399
↓ 6 callersMethodCallSignRequest
CallSignRequest runs signRequest(ctx, {method, url, headers, bodySha256}).
pluginkit/provider.go:448
↓ 6 callersFunctionChatCompletionsRequestToResponsesRequest
(ctx context.Context, req *dto.GeneralOpenAIRequest)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req.go:83
↓ 6 callersFunctionClaimExternalIdentityWithTx
ClaimExternalIdentityWithTx atomically claims a provider subject for one user. Repeating the exact mapping is idempotent; every competing subject or u
model/external_identity_claim.go:37
↓ 6 callersMethodClear
()
types/rw_map.go:54
↓ 6 callersFunctionCommonClaudeHeadersOperation
(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo)
relay/channel/claude/adaptor.go:105
↓ 6 callersFunctionCompleteSubscriptionOrder
Complete a subscription order (idempotent). Creates a UserSubscription snapshot from the plan. expectedPaymentProvider guards against cross-gateway ca
model/subscription.go:581
↓ 6 callersFunctionConsumeAuthFlow
ConsumeAuthFlow atomically validates and consumes a flow. Optional match fields are enforced when non-zero so tokens cannot cross purposes or users.
model/auth_flow.go:239
↓ 6 callersMethodConvertImageRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest)
relay/channel/adapter.go:27
↓ 6 callersFunctionConvertResponse
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, response any)
service/response_converter.go:10
↓ 6 callersMethodConvertToOpenAIVideo
(originTask *model.Task)
relay/channel/adapter.go:101
↓ 6 callersFunctionCreateUserAccessToken
CreateUserAccessToken inserts a token while holding the owner's users row, so concurrent creates cannot exceed limit. Expired rows awaiting cleanup co
model/user_access_token.go:120
↓ 6 callersMethodDelete
()
model/channel.go:687
↓ 6 callersFunctionDeleteTaskPluginVersion
(c *gin.Context)
controller/task_plugin.go:589
↓ 6 callersFunctionDryRun
DryRun runs the four stages on input without sending or charging anything. It stops at a rejection or a failure that stops the request.
relay/requestplugin/relay.go:635
↓ 6 callersFunctionEffortFromBudget
(budget int)
relaykit/relayconvert/reasoning/intent.go:674
↓ 6 callersFunctionEstimate
Estimate returns the estimated token count of text for model, using the weights of the model's family. It never runs a tokenizer; use Count for an exa
tokenkit/tokenkit.go:140
↓ 6 callersMethodEstimateBillingValidated
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:140
↓ 6 callersFunctionEvaluateTaskCompletionUsage
EvaluateTaskCompletionUsage evaluates actual facts against the frozen task expression. It neither mutates the snapshot nor moves funds: synchronous su
service/task_billing.go:444
↓ 6 callersFunctionExceedsMaxTokensLimit
ExceedsMaxTokensLimit checks token limits before they reach billing arithmetic.
relay/helper/valid_request.go:128
↓ 6 callersFunctionExtractRequest
(format types.RelayFormat, request any)
relaykit/relayconvert/internal/toolconv/decode.go:17
↓ 6 callersFunctionFatalLog
(v ...any)
common/sys_log.go:55
↓ 6 callersMethodFetchBatchTasks
(baseURL, key string, tasks []*model.Task, proxy string)
service/task_polling.go:41
↓ 6 callersFunctionFinalizeStreamResponse
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState)
service/response_converter.go:34
↓ 6 callersFunctionFormatAdminLogs
FormatAdminLogs removes root-only diagnostics while retaining operational admin_info. Root callers must not pass their results through this formatter.
model/log.go:125
↓ 6 callersFunctionFromOpenAIChat
(req *dto.GeneralOpenAIRequest)
relaykit/relayconvert/reasoning/intent.go:361
↓ 6 callersFunctionGenerateFinalUsageResponse
(id string, createAt int64, model string, usage dto.Usage)
relay/helper/common.go:376
↓ 6 callersFunctionGetActiveSystemTask
(taskType string)
model/system_task.go:142
↓ 6 callersMethodGetBalanceDetail
GetBalanceDetail returns the channel's last balance query, nil before the first one.
model/channel_balance.go:22
↓ 6 callersMethodGetByModel
GetByModel returns the deterministic effective plugin metadata used for a model-level host concern such as billing. When multiple providers expose the
pkg/jsplugin/routing.go:153
↓ 6 callersMethodGetCacheCreation1hTokens
()
relaykit/dto/claude.go:712
← previousnext →1,001–1,100 of 15,592, ranked by callers