Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
11,918 in github.com/QuantumNous/new-api
⨍
Functions
11,918
◇
Types & classes
1,792
↓ 7 callers
Method
GetResultURL
GetResultURL 获取任务结果 URL(视频地址等) 新数据存在 PrivateData.ResultURL 中;旧数据回退到 FailReason(历史兼容)
model/task.go:180
↓ 7 callers
Function
GetSSRFProtectedHTTPClient
GetSSRFProtectedHTTPClient 返回带拨号时 SSRF 校验的客户端。 ssrfProtectedHTTPClient 由 InitHttpClient 在启动时初始化,运行期只读。
service/http_client.go:159
↓ 7 callers
Function
GetTaskPluginDisabledFactoryKeys
()
setting/task_plugin.go:75
↓ 7 callers
Function
GetTelegramSettings
()
setting/system_setting/telegram.go:20
↓ 7 callers
Method
GetUpstreamModelName
()
relaykit/relayconvert/convmeta/meta.go:20
↓ 7 callers
Function
GetUserSessionBySID
(sid string)
model/user_session.go:206
↓ 7 callers
Function
GetUserSessionCached
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:219
↓ 7 callers
Function
GetVerificationRequirements
(identity AuthIdentity, scope string)
service/security_verification.go:223
↓ 7 callers
Function
HasGeminiUsageMetadataTokens
(metadata *GeminiUsageMetadata)
relaykit/dto/billing_usage.go:429
↓ 7 callers
Function
HeaderNavModuleAuth
(module string)
middleware/header_nav.go:104
↓ 7 callers
Function
InvalidatePricingCache
()
model/pricing.go:84
↓ 7 callers
Method
JSONString
JSONString returns the complete stored representation, including all privileged scopes. API projections must use the role-specific formatter.
model/log_other.go:170
↓ 7 callers
Function
LoadFromJsonStringWithCallback
(m *RWMap[K, V], jsonStr string, onSuccess func())
types/rw_map.go:83
↓ 7 callers
Function
ParseHTTPStatusCodeRanges
(input string)
setting/operation_setting/status_code_ranges.go:117
↓ 7 callers
Function
Password2Hash
(password string)
common/crypto.go:24
↓ 7 callers
Function
PostConsumeUserSubscriptionDelta
Update subscription used amount by delta (positive consume more, negative refund).
model/subscription.go:1510
↓ 7 callers
Method
Read
(p []byte)
relay/channel/openai/image_stream_test.go:152
↓ 7 callers
Function
RechargeEpay
RechargeEpay 原子完成易支付订单:订单行锁、状态校验、成功更新与用户额度增加 在同一个事务内完成,因此同一订单的并发/重复回调(包括多实例部署下)最多充值一次。 alreadyDone=true 表示订单此前已完成,本次为幂等重复回调。 进程内的 LockOrder 只是优化,正确性由本
model/topup.go:177
↓ 7 callers
Function
RevokeUserSession
(userID int, sid, reason string)
model/user_session.go:552
↓ 7 callers
Function
RoutingMatchModelName
RoutingMatchModelName returns the name used for channel-ability and token-limit fallback matching: strip @ modifiers and legacy aliases first, then ap
setting/ratio_setting/model_ratio.go:719
↓ 7 callers
Method
SetUsage
(usage *dto.Usage)
relaykit/relayconvert/response_registry.go:424
↓ 7 callers
Method
SetWithTTL
(key string, v V, ttl time.Duration)
pkg/cachex/hybrid_cache.go:111
↓ 7 callers
Function
SetupContextForSelectedChannel
(c *gin.Context, channel *model.Channel, modelName string)
middleware/distributor.go:606
↓ 7 callers
Method
Snapshot
Snapshot returns a detached top-level view for tests and read-only inspection. Mutating it cannot add or replace fields in LogOther.
model/log_other.go:176
↓ 7 callers
Function
StartLoginVerification
(user *model.User, loginMethod string)
service/login_verification.go:32
↓ 7 callers
Function
StrToMap
(str string)
common/str.go:47
↓ 7 callers
Function
TelegramConfigurationError
()
oauth/telegram.go:43
↓ 7 callers
Method
UpdateAbilities
UpdateAbilities updates abilities of this channel. Make sure the channel is completed before calling this function.
model/ability.go:263
↓ 7 callers
Function
UpdateChannelStatus
(channelId int, usingKey string, status int, reason string)
model/channel.go:736
↓ 7 callers
Function
UpdateOption
(key string, value string)
model/option.go:231
↓ 7 callers
Function
UpdateUserUsedQuotaAndRequestCount
(id int, quota int)
model/user.go:1440
↓ 7 callers
Function
UserUsableGroups2JSONString
()
setting/user_usable_group.go:27
↓ 7 callers
Function
abortWithOpenAiMessage
(c *gin.Context, statusCode int, message string, code ...types.ErrorCode)
middleware/utils.go:14
↓ 7 callers
Function
attachQuotaSaturation
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 callers
Function
callHailuoHook
(t *testing.T, plugin *jsplugin.LoadedPlugin, hook string, args ...any)
plugins/hailuo_responses_test.go:83
↓ 7 callers
Function
createUserSessionTestUser
(t *testing.T, userID int, authVersion int64)
model/user_session_test.go:66
↓ 7 callers
Function
creditTopUpQuota
creditTopUpQuota atomically enforces the wallet ceiling while adding quota. Keeping the predicate and increment in one UPDATE prevents two concurrent
model/topup.go:88
↓ 7 callers
Function
currentEnforcer
()
service/authz/enforcer.go:63
↓ 7 callers
Function
filterDisabledFactory
(factory map[string]*LoadedPlugin, disabled map[string]struct{})
pkg/jsplugin/registry.go:881
↓ 7 callers
Function
geminiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response, callback func(data string, geminiResponse *
relay/channel/gemini/relay-gemini.go:167
↓ 7 callers
Function
generateTaskExprFromConfig
( config: TaskVisualConfig | null | undefined, schema: BillingUsageSchema )
web/src/features/pricing/lib/task-expr.ts:418
↓ 7 callers
Function
getCurrencyLabel
()
web/src/lib/currency.ts:546
↓ 7 callers
Function
getSubscriptionPlanByIdTx
(tx *gorm.DB, id int)
model/subscription.go:389
↓ 7 callers
Function
getUserQuotaForPaymentGuardTest
(t *testing.T, userID int)
model/payment_method_guard_test.go:84
↓ 7 callers
Method
hasHook
(ctx context.Context, hook string)
relay/channel/task/jsplugin/adaptor.go:1541
↓ 7 callers
Function
invalidateVendorData
(client: QueryClient)
web/src/features/models/vendor-api.ts:96
↓ 7 callers
Function
isDynamicPricingModel
(model: PricingModel)
web/src/features/pricing/lib/dynamic-price.ts:130
↓ 7 callers
Function
manageMultiKeys
( params: MultiKeyManageParams )
web/src/features/channels/api.ts:375
↓ 7 callers
Function
metadataTransaction
metadataTransaction serializes changes to vendors and model ownership before acquiring model/vendor row locks. The option anchor also covers empty tab
model/model_metadata_sync.go:19
↓ 7 callers
Function
numberValue
(value: unknown)
web/src/features/dashboard/lib/flow.ts:145
↓ 7 callers
Function
performManageUserRequest
(t *testing.T, body string)
controller/user_manage_test.go:81
↓ 7 callers
Function
pluginProtocolTestSSEEventTypes
(body string)
controller/plugin_protocol_test.go:1517
↓ 7 callers
Method
prepareGeneration
( factory, override map[string]*LoadedPlugin, enabled, tolerateConflicts bool, retainCurrent map[string]str
pkg/jsplugin/registry.go:660
↓ 7 callers
Method
publishGeneration
( generation *RoutingGeneration, routingErrors map[string]string, activeOverride map[string]*LoadedPlugin,
pkg/jsplugin/registry.go:712
↓ 7 callers
Function
rateLimitFactory
(maxRequestNum int, duration int64, mark string)
middleware/rate-limit.go:147
↓ 7 callers
Method
recordRebuildFailure
(err error)
pkg/jsplugin/registry.go:766
↓ 7 callers
Function
redisIPRateLimitKey
(mark string, clientIP string)
middleware/rate-limit.go:44
↓ 7 callers
Method
resolveActiveOverrides
( generation *RoutingGeneration, override map[string]*LoadedPlugin, enabled bool, )
pkg/jsplugin/registry.go:921
↓ 7 callers
Method
resolveForConversion
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:359
↓ 7 callers
Function
resolveLocalizedText
( value: LocalizedTextValue | undefined | null, language: string )
web/src/lib/localized-text.ts:36
↓ 7 callers
Function
respondPluginProtocolError
(c *gin.Context, status int, code, message string)
controller/plugin_protocol.go:1268
↓ 7 callers
Method
responseSnapshot
(responseError *dto.PluginResponsesError)
relay/plugin_protocol.go:1004
↓ 7 callers
Function
setupAccessTokenAudit
(t *testing.T)
controller/access_token_audit_test.go:32
↓ 7 callers
Function
setupTokenControllerTestDB
(t *testing.T)
controller/token_test.go:113
↓ 7 callers
Function
syncCreditUserQuotaCache
syncCreditUserQuotaCache 在授信事务(充值/兑换等)提交后同步把增量补进缓存 余额。预扣以缓存值为准(存在期间),授信不能绕过它,否则新到账的额度在 缓存过期前不可用;缓存未命中无需处理,下次读取会从已提交的数据库余额水合。
model/user_cache.go:158
↓ 7 callers
Function
syncTaskPluginsOnce
()
controller/task_plugin.go:605
↓ 7 callers
Function
taskSubmissionRelayInfo
(billing relaycommon.BillingSettler)
controller/relay_task_plugin_test.go:377
↓ 7 callers
Function
taskSubmissionTestContext
()
controller/relay_task_plugin_test.go:370
↓ 7 callers
Function
testVideoResponsesProtocol
(t *testing.T, testCase videoResponsesTestCase)
plugins/video_responses_test_helpers_test.go:26
↓ 7 callers
Function
updateOptionMap
(key string, value string)
model/option.go:291
↓ 7 callers
Function
useAccountSecurity
()
web/src/features/security/hooks/use-account-security.ts:33
↓ 7 callers
Function
useDebounce
(value: T, delay: number = 500)
web/src/hooks/use-debounce.ts:27
↓ 7 callers
Function
useIsMobile
()
web/src/hooks/use-mobile.ts:23
↓ 7 callers
Function
userSessionCacheDeadline
()
model/user_session.go:129
↓ 7 callers
Function
userSessionCacheKey
(sid string)
model/user_session.go:124
↓ 7 callers
Function
vendorAPIError
(c *gin.Context, err error)
controller/vendor_meta.go:95
↓ 6 callers
Function
ActivateTaskPlugin
(key, version string)
model/task_plugin.go:170
↓ 6 callers
Method
ActiveOverridePlugins
()
pkg/jsplugin/registry.go:601
↓ 6 callers
Function
AdvanceCurrentSessionToUserVersion
AdvanceCurrentSessionToUserVersion is used when the security mutation and AuthVersion increment were committed in the same transaction (for example, a
service/auth_session.go:189
↓ 6 callers
Function
ApplyToOpenAIChat
ApplyToOpenAIChat writes the portable portion of an intent to the OpenAI pivot. reasoning_effort carries level-based strength; a JSON-excluded DTO sta
relaykit/relayconvert/reasoning/intent.go:378
↓ 6 callers
Method
BuildContentRequest
(task *model.Task, artifactKey string, clientRequest TaskArtifactClientRequest)
relay/channel/adapter.go:117
↓ 6 callers
Method
BuildModelListRequest
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:196
↓ 6 callers
Function
ClaimExternalIdentityWithTx
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 callers
Function
CompleteSubscriptionOrder
Complete a subscription order (idempotent). Creates a UserSubscription snapshot from the plan. expectedPaymentProvider guards against cross-gateway ca
model/subscription.go:569
↓ 6 callers
Function
ComputeTieredQuotaWithRequest
(snap *BillingSnapshot, params TokenParams, request RequestInput)
pkg/billingexpr/settle.go:24
↓ 6 callers
Method
ConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/adapter.go:27
↓ 6 callers
Function
ConvertResponse
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, response any)
service/response_converter.go:10
↓ 6 callers
Function
ConvertStreamResponseChunk
(c context.Context, info convmeta.Meta, state *ResponseStreamState, response any)
relaykit/relayconvert/response_registry.go:326
↓ 6 callers
Function
FatalLog
(v ...any)
common/sys_log.go:31
↓ 6 callers
Function
FinalizeStreamResponse
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState)
service/response_converter.go:34
↓ 6 callers
Function
FinalizeStreamResponse
(c context.Context, info convmeta.Meta, state *ResponseStreamState)
relaykit/relayconvert/response_registry.go:360
↓ 6 callers
Function
FormatAdminLogs
FormatAdminLogs removes root-only diagnostics while retaining operational admin_info. Root callers must not pass their results through this formatter.
model/log.go:126
↓ 6 callers
Function
GeminiChatHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:361
↓ 6 callers
Function
GenerateFinalUsageResponse
(id string, createAt int64, model string, usage dto.Usage)
relay/helper/common.go:217
↓ 6 callers
Function
GenerateTextOtherInfo
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, modelRatio, groupRatio, completionRatio float64, cacheTo
service/log_info_generate.go:97
↓ 6 callers
Function
GetActiveSystemTask
(taskType string)
model/system_task.go:132
↓ 6 callers
Method
GetByModel
GetByModel returns the deterministic effective plugin metadata used for a model-level host concern such as billing. When multiple providers expose the
pkg/jsplugin/routing.go:413
↓ 6 callers
Function
GetContextKey
(c *gin.Context, key constant.ContextKey)
common/gin.go:161
↓ 6 callers
Function
GetContextKeyType
(c *gin.Context, key constant.ContextKey)
common/gin.go:189
↓ 6 callers
Method
GetIdentifier
()
relaykit/types/file_source.go:15
← previous
next →
601–700 of 11,918, ranked by callers