MCPcopy Create free account

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

Functions10,934 in github.com/QuantumNous/new-api

↓ 15 callersFunctionnewTestUserSession
(sid string, userID int, now int64)
model/user_session_test.go:82
↓ 15 callersFunctionuseDataTable
(options: UseDataTableOptions<TData>)
web/src/components/data-table/hooks/use-data-table.ts:278
↓ 14 callersFunctionCan
Can reports whether the subject may perform the permission. A superuser role short-circuits to allow. Otherwise a per-user override wins, then the uni
service/authz/resolver.go:8
↓ 14 callersFunctionClaimSystemTask
(id int64, taskType string, runnerID string, lockUntil int64)
model/system_task.go:225
↓ 14 callersFunctionConvertResponse
(c context.Context, info convmeta.Meta, target types.RelayFormat, response any)
relaykit/relayconvert/response_registry.go:206
↓ 14 callersFunctionGetAdaptor
(apiType int)
relay/relay_adaptor.go:50
↓ 14 callersFunctionGetHttpClient
GetHttpClient returns the general outbound client used by relay/provider integrations. Do not attach the SSRF-protected dialer here: provider base URL
service/http_client.go:153
↓ 14 callersFunctionGetHttpClientWithProxy
GetHttpClientWithProxy returns the default client or a cached proxy-enabled client.
service/http_client.go:382
↓ 14 callersMethodGetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:166
↓ 14 callersFunctionResetStatusCode
(newApiErr *types.NewAPIError, statusCodeMappingStr string)
service/error.go:140
↓ 14 callersMethodRoutes
()
pkg/jsplugin/routing.go:490
↓ 14 callersFunctiongetChannelUsedQuota
(t *testing.T, id int)
service/task_billing_test.go:468
↓ 14 callersFunctiongetIoEnterpriseClient
(c *gin.Context)
controller/deployment.go:50
↓ 14 callersFunctiongetTaskNumberFields
( schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-expr.ts:69
↓ 14 callersFunctiongetUserUsageAccounting
(t *testing.T, id int)
service/task_billing_test.go:461
↓ 14 callersFunctionnormalizeModelNames
(models []string)
controller/channel_upstream_update.go:101
↓ 14 callersFunctionsideDrawerFormClassName
(className?: string)
web/src/components/drawer-layout.ts:36
↓ 14 callersFunctionsideDrawerHeaderClassName
(className?: string)
web/src/components/drawer-layout.ts:30
↓ 13 callersFunctionComputeTieredQuota
ComputeTieredQuota runs the Expr from a frozen BillingSnapshot against actual token counts and returns the settlement result.
pkg/billingexpr/settle.go:20
↓ 13 callersFunctionCreateAuthFlow
(input AuthFlowCreate)
model/auth_flow.go:96
↓ 13 callersFunctionDecodePluginProtocolEventResult
DecodePluginProtocolEventResult converts an exported JS value into the deliberately small semantic event contract. Unknown fields are rejected so plug
relay/plugin_protocol.go:131
↓ 13 callersFunctionFormatMatchingModelName
转换模型名,减少渠道必须配置各种带参数模型
setting/ratio_setting/model_ratio.go:702
↓ 13 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:161
↓ 13 callersFunctionGetGeneralSetting
()
setting/operation_setting/general_setting.go:40
↓ 13 callersFunctionGetGlobalSettings
()
setting/model_setting/global.go:62
↓ 13 callersFunctionGetPricing
()
model/pricing.go:70
↓ 13 callersFunctionIncrementUserAuthVersionWithTx
IncrementUserAuthVersionWithTx locks the user, publishes the next deny fence, then persists the version in the caller's transaction. Unscoped is inten
model/user_auth_cache.go:180
↓ 13 callersMethodLookupEndpoint
(method, path, model string)
pkg/jsplugin/routing.go:453
↓ 13 callersFunctionModelMappedHelper
(c *gin.Context, info *common.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:13
↓ 13 callersMethodSource
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 13 callersMethodcacheEntry
()
model/user_session.go:87
↓ 13 callersFunctiongetLobeIcon
( iconName: string | undefined | null, size: number = 20 )
web/src/lib/lobe-icon.tsx:82
↓ 13 callersFunctionrequireSuccess
(response: ApiResponse<T>)
web/src/features/task-plugins/api.ts:57
↓ 13 callersFunctionseedChargedAccounting
(t *testing.T, userID, channelID, tokenID, quota, requestCount int)
service/task_billing_test.go:125
↓ 13 callersFunctionwriteUserSessionCache
writeUserSessionCache writes a bounded Session snapshot. Active snapshots must carry a deadline captured immediately before their authoritative databa
model/user_session.go:276
↓ 12 callersFunctionApplyUpstreamBodyMetadata
ApplyUpstreamBodyMetadata restores metadata that net/http cannot infer from a ReplayableBody. Callers must pass the original body because NewRequest h
relay/channel/api_request.go:31
↓ 12 callersFunctionCloneBillingUsage
(usage *BillingUsage)
relaykit/dto/billing_usage.go:138
↓ 12 callersMethodError
Error implements the error interface
pkg/ionet/types.go:274
↓ 12 callersFunctionFormatQuota
(quota int)
logger/logger.go:152
↓ 12 callersFunctionGetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:30
↓ 12 callersFunctionGetRandomString
(length int)
common/str.go:32
↓ 12 callersFunctionIncreaseUserQuota
(id int, quota int, db bool)
model/user.go:1270
↓ 12 callersFunctionInit
(db *gorm.DB)
service/authz/enforcer.go:33
↓ 12 callersFunctionRecordLog
(userId int, logType int, content string)
model/log.go:159
↓ 12 callersMethodSetContentString
(s string)
relaykit/dto/openai_response.go:96
↓ 12 callersMethodSetOtherSettings
(setting dto.ChannelOtherSettings)
model/channel.go:1045
↓ 12 callersMethodSetReasoningEffort
SetReasoningEffort records the effort level a converter derived from a model-name suffix so downstream billing/logging can see it.
relaykit/relayconvert/convmeta/meta.go:30
↓ 12 callersMethodSetToolCalls
(toolCalls any)
relaykit/dto/openai_request.go:494
↓ 12 callersFunctionWalletQuotaFromDecimalStrict
WalletQuotaFromDecimalStrict converts wallet and top-up values within the JavaScript-safe integer range, which is also exactly representable by float6
common/quota_math.go:172
↓ 12 callersFunctionbuildSSEBody
(n int)
relay/helper/stream_scanner_test.go:49
↓ 12 callersFunctiongenBaseRelayInfo
(c *gin.Context, request dto.Request)
relay/common/relay_info.go:473
↓ 12 callersFunctionmakeRelayInfo
(expr string, groupRatio float64, estPrompt, estCompletion int)
service/tiered_settle_test.go:45
↓ 12 callersFunctionsafeJsonParse
( value: string | undefined | null, options: SafeJsonParseOptions<T> = {} )
web/src/features/system-settings/utils/json-parser.ts:113
↓ 12 callersFunctionsetupGenericTaskTest
(t *testing.T)
controller/task_generic_test.go:27
↓ 12 callersFunctionsplitBillingExprAndRequestRules
(expr: string)
web/src/features/pricing/lib/billing-expr.ts:901
↓ 12 callersFunctiontrimmed
(value)
plugins/tasks/doubao/plugin.js:65
↓ 12 callersFunctionuseMediaQuery
(query: string)
web/src/hooks/use-media-query.ts:26
↓ 12 callersFunctionuseTestSessionSecret
(t *testing.T)
service/auth_token_test.go:14
↓ 11 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:313
↓ 11 callersFunctionCompile
Compile performs upload-time syntax checks and compiles an ESM plugin once. All Sobek-specific module and runtime handling is intentionally kept here.
pkg/jsplugin/engine.go:135
↓ 11 callersMethodError
()
pkg/jsplugin/engine.go:35
↓ 11 callersMethodError
Error records a soft error. The stream continues processing. Can be called multiple times per chunk.
relay/helper/stream_result.go:21
↓ 11 callersFunctionGetChannelBaseURL
(channelType int)
constant/channel.go:131
↓ 11 callersMethodGetContentString
()
relaykit/dto/openai_response.go:100
↓ 11 callersFunctionGetDBTimestamp
GetDBTimestamp returns a UNIX timestamp from database time. Falls back to application time on error.
model/db_time.go:7
↓ 11 callersFunctionGetFetchSetting
()
setting/system_setting/fetch_setting.go:32
↓ 11 callersFunctionGetHttpClientWithProxySettings
GetHttpClientWithProxySettings returns a cached HTTP client for the proxy URL and channel transport settings. Default auto + 1 shard shares the same c
service/http_client.go:389
↓ 11 callersFunctionGetMaxTokenAutoGroups
()
setting/auto_group.go:51
↓ 11 callersMethodGetMaxTokens
()
relaykit/dto/openai_request.go:278
↓ 11 callersFunctionGetTwoFAByUserId
GetTwoFAByUserId 根据用户ID获取2FA设置
model/twofa.go:39
↓ 11 callersFunctionGetUserGroup
GetUserGroup gets group from Redis first, falls back to DB if needed
model/user.go:1205
↓ 11 callersFunctionMapToJsonStr
(m map[string]interface{})
common/str.go:39
↓ 11 callersFunctionNewClaudeMessagesBillingUsage
(usage *ClaudeUsage)
relaykit/dto/billing_usage.go:23
↓ 11 callersFunctionObjectData
(c *gin.Context, object interface{})
relay/helper/common.go:125
↓ 11 callersFunctionPublishUserAuthCache
PublishUserAuthCache refreshes the current database state after a successful auth-sensitive transaction without touching the cached quota field.
model/user_auth_cache.go:229
↓ 11 callersMethodRender
(w http.ResponseWriter)
common/custom-event.go:72
↓ 11 callersFunctionSendEmail
(subject string, receiver string, content string)
common/email.go:78
↓ 11 callersMethodSetDisabledFactoryKeys
(keys []string)
pkg/jsplugin/registry.go:496
↓ 11 callersMethodUpdateBalance
(balance float64)
model/channel.go:615
↓ 11 callersFunctionUpdateChannelUsedQuota
(id int, quota int)
model/channel.go:886
↓ 11 callersMethodValidateRequestAndSetAction
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:39
↓ 11 callersMethodWriteString
(s string)
middleware/audit.go:36
↓ 11 callersFunctioncleanupTaskPluginControllerRuntime
(t *testing.T, key string)
controller/task_plugin_test.go:62
↓ 11 callersMethodclose
()
common/email_test.go:97
↓ 11 callersFunctionformatCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:408
↓ 11 callersFunctiongetUserCacheKey
getUserCacheKey returns the key for user cache
model/user_cache.go:50
↓ 11 callersFunctionregisterTestPlugin
(registry *Registry, version string, factory bool)
pkg/jsplugin/registry_test.go:492
↓ 11 callersFunctionrequirePaymentCompliance
(c *gin.Context)
controller/payment_compliance.go:22
↓ 11 callersMethodresolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:367
↓ 11 callersFunctionsettleTaskBillingOnComplete
settleTaskBillingOnComplete 任务完成时的统一计费调整。 返回 true 表示用量结算路径已接管最终计费;失败任务仅在返回 false 时补做全额退款。 优先级:1. tiered snapshot → 2. adaptor 调整 → 3. token 重算。 表达式求值
service/task_polling.go:625
↓ 11 callersFunctionsetupAuthSessionTestDB
(t *testing.T)
service/auth_session_test.go:22
↓ 11 callersFunctionsetupOriginTaskDB
(t *testing.T)
middleware/task_plugin_origin_task_test.go:28
↓ 11 callersFunctiontaskProtocolPluginSource
(key, version, models, endpoint, parseRequestBody string)
middleware/task_plugin_test.go:1630
↓ 11 callersFunctionuseSidebar
()
web/src/components/ui/sidebar.tsx:67
↓ 11 callersFunctionuseTheme
()
web/src/context/theme-provider.tsx:141
↓ 11 callersFunctionwithHeaderNavModules
(t *testing.T, raw string)
middleware/header_nav_test.go:17
↓ 11 callersFunctionwithSMTPSettings
(t *testing.T)
common/email_test.go:243
↓ 10 callersMethodAddPin
(p ChannelPin)
dto/channel_constraints.go:55
↓ 10 callersFunctionApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:183
↓ 10 callersMethodCountBillableToolCall
CountBillableToolCall is the single entry point for per-call tool billing counts. Built-in call types always count; custom function/tool_use names onl
relay/common/tool_usage.go:24
← previousnext →201–300 of 10,934, ranked by callers