MCPcopy Create free account

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

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

↓ 8 callersFunctionuseDebounce
(value: T, delay: number = 500)
web/src/hooks/use-debounce.ts:27
↓ 8 callersFunctionuseFrontendOptionMigrationDB
(t *testing.T)
model/frontend_option_migration_test.go:14
↓ 8 callersFunctionuseRedemptions
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:66
↓ 8 callersFunctionuseSubscriptions
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:82
↓ 8 callersFunctionuseSystemConfig
(options: UseSystemConfigOptions = {})
web/src/hooks/use-system-config.ts:60
↓ 8 callersFunctionuseTableUrlState
( params: UseTableUrlStateParams )
web/src/hooks/use-table-url-state.ts:107
↓ 8 callersFunctionuseUsers
()
web/src/features/users/components/users-provider.tsx:92
↓ 8 callersFunctionuserSessionCacheKey
(sid string)
model/user_session.go:126
↓ 7 callersMethodAddFilter
(f ChannelFilter)
dto/channel_constraints.go:68
↓ 7 callersFunctionAppendTaskPluginIdentityFilter
(c *gin.Context, pluginKey string)
service/channel_select.go:31
↓ 7 callersMethodBuildModelListRequest
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:195
↓ 7 callersFunctionBuildRequestPolicy
(options map[string]string)
model/request_policy.go:84
↓ 7 callersMethodBuildRequestURL
── Request / Response ───────────────────────────────────────────
relay/channel/adapter.go:74
↓ 7 callersMethodChannelRelayConfig
ChannelRelayConfig is RelayConfig for a channel: an upstream_path that starts with {config.<name>} starts with that address of the channel's plugin co
pkg/jsplugin/registry.go:196
↓ 7 callersFunctionConfigureTrustedProxies
(engine *gin.Engine)
middleware/trusted_proxies.go:11
↓ 7 callersFunctionConsumeAuthFlowWithAction
ConsumeAuthFlowWithAction consumes a flow and runs action in the same database transaction. An action failure rolls the consumption back.
model/auth_flow.go:245
↓ 7 callersFunctionConvertRequestByID
(c context.Context, info convmeta.Meta, converter string, request any)
relaykit/relayconvert/request_registry.go:220
↓ 7 callersFunctionConvertStreamResponseChunk
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState, response any)
service/response_converter.go:26
↓ 7 callersFunctionConvertStreamResponseChunk
(c context.Context, info convmeta.Meta, state *ResponseStreamState, response any)
relaykit/relayconvert/response_registry.go:326
↓ 7 callersFunctionDecodeTransformEffects
DecodeTransformEffects reads the effects array of a request processing hook. Types outside allowed are rejected, and each effect's members and bounds
pkg/requestpatch/patch.go:85
↓ 7 callersFunctionFinalizeStreamResponse
(c context.Context, info convmeta.Meta, state *ResponseStreamState)
relaykit/relayconvert/response_registry.go:360
↓ 7 callersMethodFinish
()
service/responses_usage.go:88
↓ 7 callersMethodFlush
()
relay/requestplugin/reply.go:859
↓ 7 callersFunctionGenerateRandomCharsKey
(length int)
common/utils.go:206
↓ 7 callersMethodGetAccessToken
Deprecated: 旧版面板访问令牌,仅在升级后的过渡期内使用;删除 users.access_token 列时一并移除。
model/user.go:134
↓ 7 callersFunctionGetAndValidOpenAIImageRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:208
↓ 7 callersFunctionGetContextKeyBool
(c *gin.Context, key constant.ContextKey)
common/gin.go:251
↓ 7 callersFunctionGetDiskCachePath
GetDiskCachePath 获取磁盘缓存目录
common/disk_cache_config.go:65
↓ 7 callersFunctionGetEnvOrDefaultString
(env string, defaultValue string)
common/env.go:20
↓ 7 callersMethodGetIgnoringMasterSwitch
GetIgnoringMasterSwitch returns the plugin of key as Get does, and with the master switch off, the enabled plugin the switch leaves out. Request proce
pkg/jsplugin/registry.go:848
↓ 7 callersFunctionGetModelPrice
GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false
setting/ratio_setting/model_ratio.go:360
↓ 7 callersFunctionGetPreferredChannelByAffinity
(c *gin.Context, modelName string, usingGroup string)
service/channel_affinity.go:550
↓ 7 callersFunctionGetRequestAutoGroups
GetRequestAutoGroups resolves the ordered Auto groups for the current token. The absence of the context value means that the token inherits the comple
service/group.go:98
↓ 7 callersMethodGetResultURL
GetResultURL 获取任务结果 URL(视频地址等) 新数据存在 PrivateData.ResultURL 中;旧数据回退到 FailReason(历史兼容)
model/task.go:219
↓ 7 callersFunctionGetSSRFProtectedHTTPClient
GetSSRFProtectedHTTPClient 返回带拨号时 SSRF 校验的客户端。 ssrfProtectedHTTPClient 由 InitHttpClient 在启动时初始化,运行期只读。
service/http_client.go:167
↓ 7 callersFunctionGetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:163
↓ 7 callersFunctionGetTelegramSettings
()
setting/system_setting/telegram.go:20
↓ 7 callersFunctionHasGeminiUsageMetadataTokens
(metadata *GeminiUsageMetadata)
relaykit/dto/billing_usage.go:425
↓ 7 callersMethodHasTaskPart
HasTaskPart reports whether the plugin is a task driver: it exports buildSubmitRequest.
pkg/jsplugin/registry.go:166
↓ 7 callersFunctionIsTaskPluginFactoryDisabled
(key string)
setting/task_plugin.go:139
↓ 7 callersFunctionLoadFromJsonStringWithCallback
(m *RWMap[K, V], jsonStr string, onSuccess func())
types/rw_map.go:83
↓ 7 callersMethodMarkCompleted
MarkCompleted, MarkIncomplete and MarkCancelled keep the first terminal seen; MarkFailed always wins because an error after completion is still a fail
relay/common/stream_status.go:115
↓ 7 callersMethodMarkFailed
MarkFailed records a protocol failure. Empty details never erase details recorded earlier, so a bare error envelope keeps the structured error.
relay/common/stream_status.go:142
↓ 7 callersFunctionMarkRequestPolicySuccess
(c *gin.Context, stream *relaycommon.StreamStatus)
service/request_policy.go:129
↓ 7 callersMethodMismatch
Mismatch reports whether the retained upstream declaration disagrees with both the requested and upstream models.
relay/common/response_model.go:32
↓ 7 callersFunctionNewResponsesUsageAccumulator
(info *relaycommon.RelayInfo)
service/responses_usage.go:28
↓ 7 callersFunctionNodeSyncStates
NodeSyncStates returns a copy of what this node has applied, by topic.
service/node_sync.go:84
↓ 7 callersMethodObserve
Observe feeds one decoded stream event. raw is the same event's wire bytes; the vendor tool-usage reader runs on it once, at the terminal event.
service/responses_usage.go:34
↓ 7 callersFunctionOpenaiHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:253
↓ 7 callersFunctionPostConsumeUserSubscriptionDelta
Update subscription used amount by delta (positive consume more, negative refund).
model/subscription.go:1528
↓ 7 callersFunctionPrepareTieredBillingForSelectedGroup
PrepareTieredBillingForSelectedGroup refreshes routing-dependent billing state before an upstream attempt. An existing session reserves any higher est
service/tiered_settle.go:206
↓ 7 callersMethodReasoningState
ReasoningState returns the suffix-derived reasoning intent attached at the host entry layer. Standalone callers that do not set it receive nil; conver
relaykit/relayconvert/convmeta/meta.go:36
↓ 7 callersFunctionRechargeEpay
RechargeEpay 原子完成易支付订单:订单行锁、状态校验、成功更新与用户额度增加 在同一个事务内完成,因此同一订单的并发/重复回调(包括多实例部署下)最多充值一次。 alreadyDone=true 表示订单此前已完成,本次为幂等重复回调。 进程内的 LockOrder 只是优化,正确性由本
model/topup.go:177
↓ 7 callersFunctionRegister
(channelID int, kind string, close func(reason string))
pkg/wsmanager/wsmanager.go:47
↓ 7 callersFunctionRootAuth
()
middleware/auth.go:144
↓ 7 callersMethodSetBillableToolCount
SetBillableToolCount records an upstream-reported count for one tool-price key, replacing whatever per-item counting produced for the same key. Zero i
relay/common/tool_usage.go:66
↓ 7 callersFunctionSetLogDatabaseType
(databaseType DatabaseType)
common/database.go:29
↓ 7 callersMethodSetUsage
(usage *dto.Usage)
relaykit/relayconvert/response_registry.go:424
↓ 7 callersFunctionShouldRetryRelayError
(c *gin.Context, openaiErr *types.NewAPIError, retryTimes int)
service/relay_error.go:59
↓ 7 callersFunctionSplitPluginBillingExprKey
(key string)
setting/billing_setting/tiered_billing.go:90
↓ 7 callersFunctionStartPluginLogin
StartPluginLogin opens a login flow on a channel: keyIndex nil adds a credential, an index logs in again on that key line. add keeps the account of a
service/provider_plugin_login.go:137
↓ 7 callersFunctionStartStreamKeepAlive
StartStreamKeepAlive 按 interval 发送心跳,覆盖请求准备和重试;业务写入开始后交给流处理器。 内层请求复用外层的保活,内层清理不会提前结束它。
relay/helper/common.go:89
↓ 7 callersFunctionStatedLang
StatedLang returns the language the reader of a request stated, or "" when there is none. It checks multiple sources in priority order: 1. User settin
i18n/i18n.go:134
↓ 7 callersFunctionStrToMap
(str string)
common/str.go:49
↓ 7 callersFunctionTelegramConfigurationError
()
oauth/telegram.go:43
↓ 7 callersMethodToClaudeError
ToClaudeError masks the upstream addresses like ToOpenAIError.
relaykit/types/error.go:221
↓ 7 callersFunctionUnmarshalJsonStr
(data string, v any)
relaykit/relayconvert/kitutil/json.go:72
↓ 7 callersMethodUpdate
Update writes an edited channel, all but its key: a key changes only through UpdateChannelLocked, so an edit never writes back a key a refresh replace
model/channel.go:622
↓ 7 callersMethodUpdateAbilities
UpdateAbilities updates abilities of this channel. Make sure the channel is completed before calling this function.
model/ability.go:272
↓ 7 callersFunctionUpdateBatchTasks
(ctx context.Context, adaptor BatchTaskPollingAdaptor, taskChannelM map[int][]string, taskM map[string]*model.
service/task_polling.go:258
↓ 7 callersFunctionUpdatePasskeyDomainOptions
UpdatePasskeyDomainOptions keeps every supplied option in one transaction, including unrelated keys from UpdateOptionsBulk. Preview rolls back even th
model/passkey_option.go:96
↓ 7 callersFunctionUpdateUserUsedQuotaAndRequestCount
(id int, quota int)
model/user.go:1434
↓ 7 callersFunctionUpstreamModelName
UpstreamModelName / ChannelTypeOf are nil-safe accessors for optional Meta values (converters are often called with a nil Meta in tests and compat shi
relaykit/relayconvert/convmeta/meta.go:300
↓ 7 callersFunctionUsageFromChatUsage
(src *dto.Usage)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:159
↓ 7 callersFunctionaccessTokenRequest
(router http.Handler, method, path, credential, proof, body string)
controller/access_token_audit_test.go:99
↓ 7 callersFunctionallowPrivateTaskMediaTest
(t *testing.T)
controller/task_generic_test.go:57
↓ 7 callersFunctionattachQuotaSaturation
attachQuotaSaturation records the request's quota clamp (if any) onto the consume log's other.admin_info and emits a request-correlated backend audit
service/log_info_generate.go:36
↓ 7 callersFunctionbuildTaskPluginRouteRequest
(c *gin.Context)
middleware/task_plugin.go:1053
↓ 7 callersFunctioncacheGetTokenByKey
cacheGetTokenByKey 从缓存读取 token;不完整的哈希(如仅有配额字段)会被拒绝。
model/token_cache.go:139
↓ 7 callersFunctioncallHailuoHook
(t *testing.T, plugin *jsplugin.LoadedPlugin, hook string, args ...any)
plugins/hailuo_responses_test.go:176
↓ 7 callersFunctioncloseActiveChannelWebSockets
(channelIDs []int)
controller/channel.go:90
↓ 7 callersFunctioncreate
(context)
web/scripts/oxlint/intl-locale.mjs:152
↓ 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:1304
↓ 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 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 callersFunctioninitCol
()
model/main.go:43
↓ 7 callersFunctioninitDefaultHTTPClientFixture
(t *testing.T)
service/http_client_transport_test.go:45
← previousnext →901–1,000 of 15,409, ranked by callers