MCPcopy Create free account

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

Functions9,514 in github.com/QuantumNous/new-api

↓ 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 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:366
↓ 11 callersFunctionGetMaxTokenAutoGroups
()
setting/auto_group.go:51
↓ 11 callersMethodGetMaxTokens
()
relaykit/dto/openai_request.go:276
↓ 11 callersFunctionGetPricing
()
model/pricing.go:66
↓ 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:1167
↓ 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 callersMethodclose
()
common/email_test.go:97
↓ 11 callersFunctioncountLogs
(t *testing.T)
service/task_billing_test.go:290
↓ 11 callersFunctionformatCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:388
↓ 11 callersFunctiongetUserCacheKey
getUserCacheKey returns the key for user cache
model/user_cache.go:50
↓ 11 callersFunctionrequirePaymentCompliance
(c *gin.Context)
controller/payment_compliance.go:22
↓ 11 callersFunctionsetupAuthSessionTestDB
(t *testing.T)
service/auth_session_test.go:22
↓ 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 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
↓ 10 callersFunctionCreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:45
↓ 10 callersFunctionCreateUserSession
(session *UserSession)
model/user_session.go:133
↓ 10 callersFunctionDeleteToolPriceForTest
DeleteToolPriceForTest removes an injected tool price and rebuilds the index. Tests only.
setting/operation_setting/tools.go:231
↓ 10 callersFunctionDoTaskApiRequest
(a TaskAdaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:542
↓ 10 callersFunctionDone
(c *gin.Context)
relay/helper/common.go:136
↓ 10 callersMethodError
Error implements the error interface
pkg/ionet/types.go:274
↓ 10 callersFunctionGetAuthHeader
GetAuthHeader get auth header
controller/channel-billing.go:125
↓ 10 callersMethodGetErrorCode
()
relaykit/types/error.go:109
↓ 10 callersFunctionGetRandomString
(length int)
common/str.go:32
↓ 10 callersMethodGetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:189
↓ 10 callersFunctionGetResponseBody
(method, url string, channel *model.Channel, headers http.Header)
controller/channel-billing.go:139
↓ 10 callersMethodHasErrors
()
relay/common/stream_status.go:70
↓ 10 callersFunctionLockOrder
LockOrder 尝试对给定订单号加锁
controller/topup.go:279
↓ 10 callersFunctionLogQuota
(quota int)
logger/logger.go:122
↓ 10 callersFunctionMainDatabaseType
()
common/database.go:15
↓ 10 callersMethodMarshalJSONString
()
types/rw_map.go:94
↓ 10 callersFunctionNewOAuthError
NewOAuthError creates a new OAuth error with the given message key
oauth/types.go:45
↓ 10 callersFunctionNewOAuthErrorWithRaw
NewOAuthErrorWithRaw creates a new OAuth error with raw error message for logging
oauth/types.go:53
↓ 10 callersFunctionNewStreamScanner
(reader io.Reader)
relay/helper/stream_scanner.go:43
↓ 10 callersFunctionPostTextConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent []string)
service/text_quota.go:397
↓ 10 callersFunctionRebuildToolPriceIndex
RebuildToolPriceIndex rebuilds the lookup index from the current config. Called on init and after config updates. Not on the billing hot path.
setting/operation_setting/tools.go:149
↓ 10 callersMethodSetEndReason
(reason StreamEndReason, err error)
relay/common/stream_status.go:45
↓ 10 callersMethodSetOtherSettings
(setting dto.ChannelOtherSettings)
model/channel.go:1020
↓ 10 callersFunctionTaskErrorWrapperLocal
(err error, code string, statusCode int)
service/error.go:194
↓ 10 callersMethodTotalErrorCount
()
relay/common/stream_status.go:79
↓ 10 callersFunctionUnlockOrder
UnlockOrder 释放给定订单号的锁
controller/topup.go:294
↓ 10 callersMethodUpdateBalance
(balance float64)
model/channel.go:591
↓ 10 callersFunctionadvancedCustomGinContext
(path string)
relay/channel/advancedcustom/adaptor_test.go:807
↓ 10 callersFunctioncreateSectionRegistry
(config: SectionRegistryConfig<TSectionId, TSettings, TExtraArgs>)
web/src/features/system-settings/utils/section-registry.ts:49
↓ 10 callersFunctiondecodeAPIResponse
(t *testing.T, recorder *httptest.ResponseRecorder)
controller/token_test.go:208
↓ 10 callersFunctiongetServerErrorMessageKey
(value: unknown)
web/src/lib/server-error-message.ts:51
↓ 10 callersFunctionnewAPIErrorFromParamOverride
(err error)
relay/param_override_error.go:8
↓ 10 callersFunctionperformHeaderNavRequest
(t *testing.T, handler gin.HandlerFunc, authenticated bool)
middleware/header_nav_test.go:39
↓ 10 callersFunctionprocessHeaderOverride
processHeaderOverride applies channel header overrides, with placeholder substitution. Supported placeholders: - {api_key}: resolved to the channel AP
relay/channel/api_request.go:190
↓ 10 callersFunctionsideDrawerFooterClassName
(className?: string)
web/src/components/drawer-layout.ts:42
↓ 10 callersFunctiontriggerRefresh
()
web/src/features/users/components/users-provider.tsx:41
↓ 10 callersFunctionuseSearch
()
web/src/context/search-provider.tsx:57
↓ 9 callersFunctionBuildTieredTokenParams
BuildTieredTokenParams constructs billingexpr.TokenParams from a dto.Usage, normalizing P and C so they mean "tokens not separately priced by the expr
service/tiered_settle.go:25
↓ 9 callersFunctionConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/request_converter.go:26
↓ 9 callersFunctionGetChannelAffinitySetting
()
setting/operation_setting/channel_affinity_setting.go:156
↓ 9 callersMethodGetFinalRequestRelayFormat
()
relay/common/relay_info.go:641
↓ 9 callersFunctionGetGeneralSetting
()
setting/operation_setting/general_setting.go:40
↓ 9 callersFunctionGetJsonString
(data any)
common/str.go:103
↓ 9 callersFunctionGetPasskeySettings
()
setting/system_setting/passkey.go:35
↓ 9 callersMethodGetReasoningContent
()
relaykit/dto/openai_request.go:460
↓ 9 callersFunctionInit
(db *gorm.DB)
service/authz/enforcer.go:33
↓ 9 callersFunctionInitSessionCookieSettings
()
common/session_cookie.go:44
↓ 9 callersFunctionIsPaymentComplianceConfirmed
()
setting/operation_setting/payment_setting.go:33
↓ 9 callersMethodIsStringContent
()
relaykit/dto/claude.go:126
↓ 9 callersMethodKeys
Keys returns keys with valid values. In Redis, it returns all matching keys.
pkg/cachex/hybrid_cache.go:132
↓ 9 callersFunctionMapToJsonStr
(m map[string]interface{})
common/str.go:39
↓ 9 callersFunctionNewStreamStatus
()
relay/common/stream_status.go:41
↓ 9 callersFunctionPassword2Hash
(password string)
common/crypto.go:23
↓ 9 callersFunctionRefundTaskQuota
RefundTaskQuota 统一的任务失败退款逻辑。 当异步任务失败时,将预扣的 quota 退还给用户(支持钱包和订阅),并退还令牌额度。 返回资金来源是否已成功退还;失败时保留 quota,供显式重试或人工对账。
service/task_billing.go:166
↓ 9 callersFunctionRevokeAllUserSessions
(userID int, reason string)
model/user_session.go:708
↓ 9 callersFunctionRunExprWithRequest
(exprStr string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:28
↓ 9 callersFunctionStringData
(c *gin.Context, str string)
relay/helper/common.go:97
↓ 9 callersMethodToOpenAIError
()
relaykit/types/error.go:180
↓ 9 callersMethodType
()
service/system_task.go:35
↓ 9 callersFunctionUpdateMaxTokenAutoGroups
(value string)
setting/auto_group.go:63
↓ 9 callersMethodUpdateWithStatus
UpdateWithStatus performs a conditional UPDATE guarded by fromStatus (CAS). Returns (true, nil) if this caller won the update, (false, nil) if another
model/task.go:423
↓ 9 callersFunctionUsedVars
UsedVars returns the set of identifier names referenced by an expression. The result is cached alongside the compiled program. Returns nil for empty i
pkg/billingexpr/compile.go:144
↓ 9 callersFunctionUserSubject
UserSubject is the casbin subject string for a single user.
service/authz/permission.go:20
↓ 9 callersMethodValue
()
model/task.go:96
↓ 9 callersMethodconvertToAliRequest
(info *relaycommon.RelayInfo, req relaycommon.TaskSubmitReq)
relay/channel/task/ali/adaptor.go:351
↓ 9 callersFunctionfetchChannelUpstreamModelIDs
(channel *model.Channel)
controller/channel_upstream_update.go:335
↓ 9 callersFunctiongetChannelAffinityCache
()
service/channel_affinity.go:81
↓ 9 callersFunctiongetUserAuthFenceKey
(userId int)
model/user_auth_cache.go:26
↓ 9 callersFunctionisAuthBundle
(value: unknown)
web/src/lib/auth-session.ts:129
↓ 9 callersFunctionparseQuotaFromDollars
(amount: number)
web/src/lib/format.ts:83
↓ 9 callersFunctionrawJSONPresent
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:541
↓ 9 callersFunctionrecordManageAuditFor
recordManageAuditFor 记录一条管理审计日志,日志归属于操作者;targetUserId 只表示被操作用户,用于在结构化参数中保留目标上下文。
controller/audit.go:99
↓ 9 callersMethodresolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:350
↓ 9 callersFunctionsafeNumberFieldProps
(field: ControllerRenderProps<TFieldValues, TName>)
web/src/features/system-settings/utils/numeric-field.ts:76
↓ 9 callersFunctionshouldUpdateRedis
(fromDB bool, err error)
model/utils.go:125
↓ 9 callersFunctionstreamValuesFromAny
(value any)
relaykit/relayconvert/response_registry.go:626
← previousnext →201–300 of 9,514, ranked by callers