MCPcopy Create free account

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

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

↓ 4 callersMethodSetFirstResponseTime
()
relay/common/relay_info.go:688
↓ 4 callersMethodSetIndex
set index
dto/claude.go:509
↓ 4 callersFunctionSetLogDatabaseType
(databaseType DatabaseType)
common/database.go:27
↓ 4 callersMethodSetMediaContent
(content []MediaContent)
dto/openai_request.go:514
↓ 4 callersMethodSetStringContent
(content string)
dto/claude.go:161
↓ 4 callersMethodSetUsage
(usage *dto.Usage)
service/relayconvert/response_registry.go:381
↓ 4 callersFunctionSettleBilling
--------------------------------------------------------------------------- SettleBilling — 后结算辅助函数 --------------------------------------------------
service/billing.go:51
↓ 4 callersFunctionSetupContextForSelectedChannel
(c *gin.Context, channel *model.Channel, modelName string)
middleware/distributor.go:443
↓ 4 callersFunctionShouldCopyUpstreamHeader
ShouldCopyUpstreamHeader checks whether a given upstream response header should be copied to the client response. It returns false for Content-Length
service/http.go:31
↓ 4 callersFunctionShouldSkipRetryAfterChannelAffinityFailure
(c *gin.Context)
service/channel_affinity.go:626
↓ 4 callersMethodSnapshot
()
model/task.go:392
↓ 4 callersMethodSupportedEndpointTypesForModel
(model string)
dto/channel_settings.go:176
↓ 4 callersFunctionTaskModel2Dto
(task *model.Task)
relay/relay_task.go:550
↓ 4 callersMethodToFileSource
()
dto/gemini.go:209
↓ 4 callersFunctionTryUserAuth
()
middleware/auth.go:78
↓ 4 callersFunctionUpdateSystemTaskState
(taskID string, lockedBy string, state any)
model/system_task.go:309
↓ 4 callersFunctionUpdateUserSetting
(userId int, setting dto.UserSetting)
model/user.go:162
↓ 4 callersMethodUpdateWithTx
(tx *gorm.DB, updatePassword bool)
model/user.go:725
↓ 4 callersMethodUsage
()
service/relayconvert/response_registry.go:359
↓ 4 callersFunctionUsageFromGeminiMetadata
(metadata *dto.GeminiUsageMetadata, fallbackPromptTokens int)
service/relayconvert/response_compat.go:71
↓ 4 callersFunctionValidUsage
(usage *dto.Usage)
service/usage_helpr.go:31
↓ 4 callersFunctionValidateNumericCode
ValidateNumericCode 验证数字验证码格式
common/totp.go:128
↓ 4 callersFunctionValidatePasswordAndHash
(password string, hash string)
common/crypto.go:29
↓ 4 callersMethodValidateTOTPAndUpdateUsage
ValidateTOTPAndUpdateUsage 验证TOTP并更新使用记录
model/twofa.go:337
↓ 4 callersFunctionWaffoPancakeBuyerIdentityFromUserID
WaffoPancakeBuyerIdentityFromUserID renders the canonical buyer identity for checkout. Webhook handlers compare against the value rendered here to rej
service/waffo_pancake.go:158
↓ 4 callersMethodWriteContext
(c *gin.Context)
model/user_cache.go:29
↓ 4 callersFunctionapplyRechargeRate
* Apply recharge rate to price * * priceRate represents how much users need to recharge (in the display currency) * to get 1 USD credit. usdExchang
web/src/features/pricing/lib/price.ts:131
↓ 4 callersFunctionbucketStart
(ts int64)
pkg/perf_metrics/metrics.go:266
↓ 4 callersFunctionbuildDefaultDashboardFilters
( preferences: DashboardChartPreferences = getSavedChartPreferences() )
web/src/features/dashboard/lib/filters.ts:143
↓ 4 callersFunctioncacheSetToken
(token Token)
model/token_cache.go:11
↓ 4 callersFunctioncalcNextResetTime
(base time.Time, plan *SubscriptionPlan, endUnix int64)
model/subscription.go:344
↓ 4 callersFunctioncallback
(authorization: unknown)
web/src/features/auth/components/telegram-login-dialog.tsx:56
↓ 4 callersFunctioncleanupAuthArtifacts
()
service/auth_cleanup.go:29
↓ 4 callersFunctionclearAuthenticatedClientState
( queryClient: QueryClient, synchronizeTabs = true )
web/src/lib/auth-session.ts:197
↓ 4 callersFunctionclearChannelInfo
(channel *model.Channel)
controller/channel.go:67
↓ 4 callersFunctionclickHouseLogOrder
(prefix string)
model/log.go:106
↓ 4 callersFunctioncomposeTieredTextQuota
(relayInfo *relaycommon.RelayInfo, summary textQuotaSummary, tieredQuota int, tieredResult *billingexpr.Tiered
service/text_quota.go:203
↓ 4 callersFunctionconfirmUserSessionActiveSnapshot
(session *UserSession)
model/user_session.go:358
↓ 4 callersMethodconvertOpenAICompatibleRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/advancedcustom/adaptor.go:520
↓ 4 callersFunctioncreateTaskError
(err error, code string, statusCode int, localError bool)
relay/common/relay_utils.go:110
↓ 4 callersFunctiondecodeDataWithFlexibleTimes
(data []byte, target *T)
pkg/ionet/jsonutil.go:39
↓ 4 callersFunctiondecodeImageConfig
decodeImageConfig 从字节数据解码图片配置
service/file_service.go:465
↓ 4 callersFunctiondetectHEIF
detectHEIF checks ISOBMFF magic bytes to detect HEIC/HEIF files. Returns "image/heic", "image/heif", or "" if not recognized.
service/file_service.go:496
↓ 4 callersFunctiondoRequest
(c *gin.Context, req *http.Request, info *common.RelayInfo)
relay/channel/api_request.go:477
↓ 4 callersFunctioneffectiveBillingUsage
(usage *dto.Usage)
service/billing_usage.go:20
↓ 4 callersFunctionexceedsMaxTokensLimit
(values ...*uint)
relay/helper/valid_request.go:124
↓ 4 callersFunctionfinalizeMessage
( message: Message, apiReasoningContent?: string )
web/src/features/playground/lib/message/message-streaming-utils.ts:121
↓ 4 callersFunctionfinishSystemTaskHandler
(task *model.SystemTask, runnerID string, status model.SystemTaskStatus, result any, runErr error)
controller/system_task_handlers.go:155
↓ 4 callersFunctionflowPathForStages
( row: FlowQuotaDataItem, stages: FlowNodeKind[], ctx: FlowPathContext = EMPTY_FLOW_PATH_CONTEXT )
web/src/features/dashboard/lib/flow.ts:271
↓ 4 callersFunctionformatDateTimeObject
(date: Date)
web/src/lib/time.ts:152
↓ 4 callersFunctionformatLatency
(ms: number)
web/src/features/performance-metrics/lib/format.ts:25
↓ 4 callersFunctionformatThroughput
(tps: number)
web/src/features/performance-metrics/lib/format.ts:19
↓ 4 callersFunctionformatValue
(value: unknown)
web/src/features/models/components/dialogs/upstream-conflict-dialog.tsx:72
↓ 4 callersFunctiongetDefaultAdvancedCustomIncomingPath
( converter: AdvancedCustomConverter )
web/src/features/channels/lib/advanced-custom.ts:442
↓ 4 callersFunctiongetDefaultDays
(granularity?: TimeGranularity)
web/src/features/dashboard/lib/filters.ts:138
↓ 4 callersFunctiongetJSONList
(jsonStr string)
setting/console_setting/validation.go:53
↓ 4 callersFunctiongetMinTopupAmount
(topupInfo: TopupInfo | null)
web/src/features/wallet/lib/payment.ts:153
↓ 4 callersFunctiongetPreferredSyncField
( ratioTypes: Partial<Record<RatioType, RatioDifferenceEntry>>, ratioType: RatioType, sourceName: string
web/src/features/system-settings/models/upstream-ratio-sync-helpers.ts:105
↓ 4 callersFunctiongetRollingDateRange
( days: number, fromDate: Date = new Date() )
web/src/lib/time.ts:90
↓ 4 callersFunctiongetRouteIncomingPath
(route: AdvancedCustomRoute)
web/src/features/channels/components/dialogs/advanced-custom-editor-dialog.tsx:138
↓ 4 callersFunctiongetStatus
()
web/src/lib/api.ts:70
↓ 4 callersFunctiongetSuccessRateDotClass
(rate: number)
web/src/features/performance-metrics/lib/format.ts:92
↓ 4 callersFunctionhasAnyCacheTokens
( other: LogOtherData | null | undefined )
web/src/features/usage-logs/lib/format.ts:302
↓ 4 callersFunctionhasMessageContent
(message: Message)
web/src/features/playground/lib/message/message-utils.ts:56
↓ 4 callersFunctioninferResponseRelayFormat
(response any)
service/relayconvert/response_registry.go:702
↓ 4 callersFunctioninsertUserForPaymentGuardTest
(t *testing.T, id int, quota int)
model/payment_method_guard_test.go:12
↓ 4 callersFunctionintPtr
(v int)
service/relayconvert/internal/oai_chat/to_oai_responses_resp.go:230
↓ 4 callersFunctionisConverterPathAllowed
( incomingPath: string, converter: AdvancedCustomConverter )
web/src/features/channels/lib/advanced-custom.ts:836
↓ 4 callersFunctionisPlainObject
(value: unknown)
web/src/features/system-settings/hooks/use-settings-form.ts:34
↓ 4 callersFunctionisRedemptionExpired
( expired_time: number, status: number )
web/src/features/redemption-codes/lib/utils.ts:40
↓ 4 callersFunctionisResponsesToolOutputType
(outputType string)
service/relayconvert/internal/oai_responses/to_oai_chat_resp.go:250
↓ 4 callersFunctionisWaffoPancakeTopUpEnabled
()
controller/payment_webhook_availability.go:76
↓ 4 callersFunctionlinkStableKey
(link: Pick<DashboardFlowLink, 'source' | 'target'>)
web/src/features/dashboard/lib/flow.ts:503
↓ 4 callersFunctionloadKeyStatus
( page: number = currentPage, size: number = pageSize, status: number | null = statusFilter )
web/src/features/channels/components/dialogs/multi-key-manage-dialog.tsx:114
↓ 4 callersFunctionlogHelper
(ctx context.Context, level string, msg string)
logger/logger.go:97
↓ 4 callersFunctionmodelMeta
(modelName string, meta map[string]rankingModelMeta)
service/rankings.go:256
↓ 4 callersFunctionmustConvertResponsesToGemini
(t *testing.T, req dto.OpenAIResponsesRequest)
relay/channel/gemini/adaptor_responses_test.go:156
↓ 4 callersFunctionmustGeminiRawMessage
(t *testing.T, value any)
relay/channel/gemini/adaptor_responses_test.go:171
↓ 4 callersFunctionnewProtectedFetchHTTPClientWithProxy
(resolver ssrfResolver, dialContext func(ctx context.Context, network, address string) (net.Conn, error), getP
service/protected_fetch_client.go:66
↓ 4 callersFunctionnewWaffoPancakeClientFromCreds
(merchantID, privateKey string)
service/waffo_pancake.go:86
↓ 4 callersFunctionnormalizeJsonString
(value: string, fallback = '[]')
web/src/features/system-settings/content/utils.ts:29
↓ 4 callersFunctionnormalizeLang
normalizeLang normalizes language code to supported format
i18n/i18n.go:201
↓ 4 callersFunctionparseHttpStatusCodeRules
( input: unknown )
web/src/lib/http-status-code-rules.ts:32
↓ 4 callersFunctionparseJSONArray
(jsonStr string, typeName string)
setting/console_setting/validation.go:25
↓ 4 callersFunctionparseJsonArray
(data: unknown)
web/src/features/wallet/hooks/use-topup-info.ts:39
↓ 4 callersFunctionparseJsonToRows
(json: string)
web/src/components/json-editor.tsx:86
↓ 4 callersFunctionparseJsonToRows
(json: string)
web/src/features/channels/components/model-mapping-editor.tsx:78
↓ 4 callersFunctionparsePasskeyFinishRequest
(c *gin.Context)
controller/passkey.go:38
↓ 4 callersFunctionperformRateLimitRequest
(router http.Handler, path string, remoteAddr string)
middleware/rate_limit_test.go:40
↓ 4 callersFunctionprocessNegativeIndex
(data []byte, path string)
relay/common/override.go:563
↓ 4 callersFunctionrandomUsage
(rng *rand.Rand)
service/tiered_settle_test.go:699
↓ 4 callersFunctionratioQuota
(usage *dto.Usage, isClaudeSemantic bool, modelRatio, completionRatio, cacheRatio, imageRatio, groupRatio floa
service/tiered_settle_test.go:424
↓ 4 callersFunctionrefreshChannelRuntimeCache
()
controller/channel_upstream_update.go:523
↓ 4 callersFunctionremoveCookie
(name: string)
web/src/lib/cookies.ts:57
↓ 4 callersFunctionreplaceRoutes
( nextRoutes: AdvancedCustomRoute[], nextRouteKeys = routeRows.map((routeRow) => routeRow.routeKey)
web/src/features/channels/components/dialogs/advanced-custom-editor-dialog.tsx:255
↓ 4 callersFunctionresolveChatUrl
({ template, apiKey, serverAddress, }: ResolveChatUrlParams)
web/src/features/chat/lib/chat-links.ts:152
↓ 4 callersFunctionresolveWaffoPancakeAdminCreds
resolveWaffoPancakeAdminCreds prefers body creds (typed-but-not-yet-saved values, for verification) and falls back to persisted creds when the body is
controller/topup_waffo_pancake.go:156
↓ 4 callersFunctionsanitizeLikePattern
sanitizeLikePattern 校验并清洗用户输入的 LIKE 搜索模式。 规则: 1. 转义 ! 和 _(使用 ! 作为 ESCAPE 字符,兼容 MySQL/PostgreSQL/SQLite) 2. 连续的 % 合并为单个 % 3. 最多允许 2 个 % 4. 含 % 时(模糊搜索),
model/token.go:95
↓ 4 callersFunctionseedSubscriptionResetSub
(t *testing.T, sub *UserSubscription)
model/subscription_reset_test.go:17
↓ 4 callersFunctionsettleTaskBillingOnComplete
settleTaskBillingOnComplete 任务完成时的统一计费调整。 优先级:1. adaptor.AdjustBillingOnComplete 返回正数 → 使用 adaptor 计算的额度 2. taskResult.TotalTokens > 0 → 按 token 重算 3
service/task_polling.go:642
← previousnext →701–800 of 9,195, ranked by callers