MCPcopy Create free account

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

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

↓ 8 callersFunctionOaiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:20
↓ 8 callersFunctionOpenaiImageStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_image.go:93
↓ 8 callersFunctionParseAccessToken
(raw string)
service/auth_token.go:85
↓ 8 callersFunctionRecalculateTaskQuota
RecalculateTaskQuota 通用的异步差额结算。 actualQuota 是任务完成后的实际应扣额度,与预扣额度 (task.Quota) 做差额结算。 reason 用于日志记录(例如 "token重算" 或 "adaptor调整")。 clamps 可选:若计算 actualQuo
service/task_billing.go:210
↓ 8 callersFunctionRecordConsumeLog
(c *gin.Context, userId int, params RecordConsumeLogParams)
model/log.go:343
↓ 8 callersMethodRecordError
(msg string)
relay/common/stream_status.go:55
↓ 8 callersFunctionSetDatabaseTypes
(mainType DatabaseType, logType DatabaseType)
common/database.go:31
↓ 8 callersMethodSetEstimatePromptTokens
func (info *RelayInfo) SetPromptTokens(promptTokens int) { info.promptTokens = promptTokens }
relay/common/relay_info.go:680
↓ 8 callersMethodSetProgressStr
(progress string)
dto/openai_video.go:33
↓ 8 callersFunctionSetToolPriceForTest
SetToolPriceForTest injects a tool price and rebuilds the lookup index. Tests only.
setting/operation_setting/tools.go:222
↓ 8 callersFunctionT
T translates a message key using the language from gin context
i18n/i18n.go:90
↓ 8 callersFunctionUpdateChannelUsedQuota
(id int, quota int)
model/channel.go:861
↓ 8 callersFunctionUpdateUserUsedQuotaAndRequestCount
(id int, quota int)
model/user.go:1309
↓ 8 callersFunctionValidateSSRFProtectedFetchURL
(urlStr string)
service/http_client.go:68
↓ 8 callersFunctioncalculateTextToolCallSurcharge
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, summary *textQuotaSummary)
service/text_quota.go:148
↓ 8 callersFunctioncanManageTargetRole
(myRole int, targetRole int)
controller/user.go:371
↓ 8 callersFunctioncreateLog
(log *Log)
model/log.go:101
↓ 8 callersFunctionfetchChannelUpstreamModelIDs
(channel *model.Channel)
controller/channel_upstream_update.go:335
↓ 8 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:280
↓ 8 callersFunctiongetUserAuthVersionKey
(userId int)
model/user_auth_cache.go:30
↓ 8 callersFunctionhasParsedChildren
( node: ParsedNode )
web/src/components/ai-elements/response-node-guards.ts:36
↓ 8 callersFunctionisTagAggregateRow
(row: Channel | TagRow)
web/src/features/channels/lib/channel-utils.ts:616
↓ 8 callersMethodmemCache
()
pkg/cachex/hybrid_cache.go:69
↓ 8 callersFunctionmetricValue
(metrics: FlowMetrics, metric: FlowMetric)
web/src/features/dashboard/lib/flow.ts:164
↓ 8 callersFunctionnewImageTestContext
(t *testing.T, body, contentType string, isStream bool)
relay/channel/openai/image_stream_test.go:19
↓ 8 callersFunctionnewTestResponsesStreamState
()
service/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:436
↓ 8 callersFunctionnormalizeHeaderContextKey
(key string)
relay/common/override.go:1507
↓ 8 callersMethodredisOn
()
pkg/cachex/hybrid_cache.go:59
↓ 8 callersFunctionrequireDeploymentID
(c *gin.Context)
controller/deployment.go:120
↓ 8 callersFunctionresetPricingEndpointTestTables
(t *testing.T)
model/pricing_endpoint_test.go:14
↓ 8 callersFunctionresetSessionCookieSettingsAfterTest
(t *testing.T)
common/url_validator_test.go:125
↓ 8 callersFunctionsafeNumberFieldProps
(field: ControllerRenderProps<TFieldValues, TName>)
web/src/features/system-settings/utils/numeric-field.ts:71
↓ 8 callersFunctionstaticProtection
(protection *common.SSRFProtection)
service/protected_fetch_client_test.go:26
↓ 8 callersFunctiontieredQuota
--------------------------------------------------------------------------- BuildTieredTokenParams: token normalization and ratio parity tests -------
service/tiered_settle_test.go:417
↓ 8 callersFunctionuseContextValue
()
web/src/components/ai-elements/context.tsx:52
↓ 8 callersFunctionuseRateLimitMiniRedis
(t *testing.T)
middleware/rate_limit_test.go:20
↓ 8 callersFunctionuseSubscriptions
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:82
↓ 8 callersFunctionuseSystemConfig
(options: UseSystemConfigOptions = {})
web/src/hooks/use-system-config.ts:144
↓ 8 callersFunctionuseUsageLogsContext
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:78
↓ 7 callersFunctionApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:178
↓ 7 callersFunctionDecreaseUserQuota
(id int, quota int, db bool)
model/user.go:1257
↓ 7 callersMethodError
()
types/error.go:123
↓ 7 callersFunctionGenerateHMAC
(data string)
common/crypto.go:17
↓ 7 callersFunctionGetGroupRatioCopy
()
setting/ratio_setting/group_ratio.go:62
↓ 7 callersMethodGetImageMedia
()
dto/openai_request.go:311
↓ 7 callersFunctionGetModelRatio
(name string)
setting/ratio_setting/model_ratio.go:396
↓ 7 callersFunctionGetPasskeyByUserID
(userID int)
model/passkey.go:123
↓ 7 callersFunctionGetPaymentSetting
()
setting/operation_setting/payment_setting.go:29
↓ 7 callersMethodGetResultURL
GetResultURL 获取任务结果 URL(视频地址等) 新数据存在 PrivateData.ResultURL 中;旧数据回退到 FailReason(历史兼容)
model/task.go:136
↓ 7 callersFunctionGetSSRFProtectedHTTPClient
GetSSRFProtectedHTTPClient 返回带拨号时 SSRF 校验的客户端。 ssrfProtectedHTTPClient 由 InitHttpClient 在启动时初始化,运行期只读。
service/http_client.go:130
↓ 7 callersFunctionGetTopUpByTradeNo
(tradeNo string)
model/topup.go:72
↓ 7 callersFunctionGetUserSessionCached
GetUserSessionCached validates cached state first and falls back to the database on a miss or Redis read failure. A deny tombstone never falls back.
model/user_session.go:211
↓ 7 callersFunctionHeaderNavModuleAuth
(module string)
middleware/header_nav.go:104
↓ 7 callersMethodIsNormalEnd
()
relay/common/stream_status.go:88
↓ 7 callersFunctionIssueSecurityProof
(identity AuthIdentity, method string, scopes []string)
service/auth_token.go:132
↓ 7 callersFunctionLoadFromJsonStringWithCallback
LoadFromJsonStringWithCallback loads a JSON string into the RWMap and calls the callback on success.
types/rw_map.go:85
↓ 7 callersFunctionModelPriceHelper
(c *gin.Context, info *relaycommon.RelayInfo, promptTokens int, meta *types.TokenCountMeta)
relay/helper/price.go:72
↓ 7 callersFunctionNewOpenAIChatBillingUsage
(usage *Usage)
dto/billing_usage.go:56
↓ 7 callersFunctionParseHTTPStatusCodeRanges
(input string)
setting/operation_setting/status_code_ranges.go:117
↓ 7 callersFunctionPostConsumeUserSubscriptionDelta
Update subscription used amount by delta (positive consume more, negative refund).
model/subscription.go:1500
↓ 7 callersMethodRead
(p []byte)
common/body_storage.go:169
↓ 7 callersMethodRead
(p []byte)
relay/channel/openai/image_stream_test.go:152
↓ 7 callersFunctionResponsesRequestToChatCompletionsRequest
(req *dto.OpenAIResponsesRequest)
service/relayconvert/internal/oai_responses/to_oai_chat_req.go:27
↓ 7 callersMethodSetMetadata
(k string, v any)
dto/openai_video.go:37
↓ 7 callersMethodSetWithTTL
(key string, v V, ttl time.Duration)
pkg/cachex/hybrid_cache.go:111
↓ 7 callersMethodToVideoStatus
()
model/task.go:17
↓ 7 callersFunctionUserAuth
()
middleware/auth.go:92
↓ 7 callersFunctionUsingLogDatabase
(databaseType DatabaseType)
common/database.go:40
↓ 7 callersFunctionValidateLoginSession
(identity AuthIdentity)
service/auth_session.go:114
↓ 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:39
↓ 7 callersFunctionauthSigningKey
(purpose string)
service/auth_token.go:54
↓ 7 callersFunctionconfigureTrustedProxies
(engine *gin.Engine)
trusted_proxies.go:22
↓ 7 callersFunctioncreateUserSessionTestUser
(t *testing.T, userID int, authVersion int64)
model/user_session_test.go:66
↓ 7 callersFunctionformatLogQuota
(quota: number)
web/src/lib/format.ts:208
↓ 7 callersFunctiongeminiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response, callback func(data string, geminiResponse *
relay/channel/gemini/relay-gemini.go:147
↓ 7 callersFunctiongetCurrencyLabel
()
web/src/lib/currency.ts:526
↓ 7 callersFunctiongetSubscriptionPlanByIdTx
(tx *gorm.DB, id int)
model/subscription.go:389
↓ 7 callersFunctionhasPermission
( user: AuthUser | null | undefined, resource: string, action: string )
web/src/lib/admin-permissions.ts:75
↓ 7 callersFunctioninsertPricingEndpointAbility
(t *testing.T, channelID int, modelName string)
model/pricing_endpoint_test.go:49
↓ 7 callersFunctioninsertPricingEndpointChannel
(t *testing.T, channelID int, channelType int, settings dto.ChannelOtherSettings)
model/pricing_endpoint_test.go:34
↓ 7 callersFunctionmanageMultiKeys
( params: MultiKeyManageParams )
web/src/features/channels/api.ts:363
↓ 7 callersFunctionmustRawMessage
(t *testing.T, value any)
service/relayconvert/internal/oai_responses/to_oai_chat_req_test.go:265
↓ 7 callersFunctionnewAuthzTestDB
(t *testing.T)
service/authz/authz_test.go:14
↓ 7 callersFunctionnumberValue
(value: unknown)
web/src/features/dashboard/lib/flow.ts:145
↓ 7 callersFunctionrateLimitFactory
(maxRequestNum int, duration int64, mark string)
middleware/rate-limit.go:147
↓ 7 callersFunctionredisIPRateLimitKey
(mark string, clientIP string)
middleware/rate-limit.go:44
↓ 7 callersMethodresolveForConversion
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:342
↓ 7 callersFunctionsetupLogin
setupLogin creates a server-controlled login Session and returns the shared authentication bundle used by every login method.
controller/user.go:154
↓ 7 callersFunctionsetupUserUpdateTestState
(t *testing.T)
model/user_update_test.go:15
↓ 7 callersFunctiontestRelayInfo
()
relay/channel/task/ali/adaptor_test.go:12
↓ 7 callersFunctionuseTableUrlState
( params: UseTableUrlStateParams )
web/src/hooks/use-table-url-state.ts:107
↓ 7 callersFunctionuserSessionCacheKey
(sid string)
model/user_session.go:124
↓ 7 callersFunctionwriteAuthSessionError
(c *gin.Context, err error)
controller/auth_session.go:164
↓ 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:173
↓ 6 callersMethodBuildModelListRequest
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:196
↓ 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 callersFunctionCompleteSubscriptionOrder
Complete a subscription order (idempotent). Creates a UserSubscription snapshot from the plan. expectedPaymentProvider guards against cross-gateway ca
model/subscription.go:569
↓ 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:183
↓ 6 callersMethodConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/adapter.go:20
↓ 6 callersFunctionFatalLog
(v ...any)
common/sys_log.go:31
← previousnext →301–400 of 9,195, ranked by callers