Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
↓ 8 callers
Function
useDebounce
(value: T, delay: number = 500)
web/src/hooks/use-debounce.ts:27
↓ 8 callers
Function
useFrontendOptionMigrationDB
(t *testing.T)
model/frontend_option_migration_test.go:14
↓ 8 callers
Function
useRedemptions
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:66
↓ 8 callers
Function
useSubscriptions
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:82
↓ 8 callers
Function
useSystemConfig
(options: UseSystemConfigOptions = {})
web/src/hooks/use-system-config.ts:60
↓ 8 callers
Function
useTableUrlState
( params: UseTableUrlStateParams )
web/src/hooks/use-table-url-state.ts:107
↓ 8 callers
Function
useUsers
()
web/src/features/users/components/users-provider.tsx:92
↓ 8 callers
Function
userSessionCacheKey
(sid string)
model/user_session.go:126
↓ 7 callers
Method
AddFilter
(f ChannelFilter)
dto/channel_constraints.go:68
↓ 7 callers
Function
AppendTaskPluginIdentityFilter
(c *gin.Context, pluginKey string)
service/channel_select.go:31
↓ 7 callers
Method
BuildModelListRequest
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:195
↓ 7 callers
Function
BuildRequestPolicy
(options map[string]string)
model/request_policy.go:84
↓ 7 callers
Method
BuildRequestURL
── Request / Response ───────────────────────────────────────────
relay/channel/adapter.go:74
↓ 7 callers
Method
ChannelRelayConfig
ChannelRelayConfig is RelayConfig for a channel: an upstream_path that starts with {config.<name>} starts with that address of the channel's plugin co
pkg/jsplugin/registry.go:196
↓ 7 callers
Function
ConfigureTrustedProxies
(engine *gin.Engine)
middleware/trusted_proxies.go:11
↓ 7 callers
Function
ConsumeAuthFlowWithAction
ConsumeAuthFlowWithAction consumes a flow and runs action in the same database transaction. An action failure rolls the consumption back.
model/auth_flow.go:245
↓ 7 callers
Function
ConvertRequestByID
(c context.Context, info convmeta.Meta, converter string, request any)
relaykit/relayconvert/request_registry.go:220
↓ 7 callers
Function
ConvertStreamResponseChunk
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState, response any)
service/response_converter.go:26
↓ 7 callers
Function
ConvertStreamResponseChunk
(c context.Context, info convmeta.Meta, state *ResponseStreamState, response any)
relaykit/relayconvert/response_registry.go:326
↓ 7 callers
Function
DecodeTransformEffects
DecodeTransformEffects reads the effects array of a request processing hook. Types outside allowed are rejected, and each effect's members and bounds
pkg/requestpatch/patch.go:85
↓ 7 callers
Function
FinalizeStreamResponse
(c context.Context, info convmeta.Meta, state *ResponseStreamState)
relaykit/relayconvert/response_registry.go:360
↓ 7 callers
Method
Finish
()
service/responses_usage.go:88
↓ 7 callers
Method
Flush
()
relay/requestplugin/reply.go:859
↓ 7 callers
Function
GenerateRandomCharsKey
(length int)
common/utils.go:206
↓ 7 callers
Method
GetAccessToken
Deprecated: 旧版面板访问令牌,仅在升级后的过渡期内使用;删除 users.access_token 列时一并移除。
model/user.go:134
↓ 7 callers
Function
GetAndValidOpenAIImageRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:208
↓ 7 callers
Function
GetContextKeyBool
(c *gin.Context, key constant.ContextKey)
common/gin.go:251
↓ 7 callers
Function
GetDiskCachePath
GetDiskCachePath 获取磁盘缓存目录
common/disk_cache_config.go:65
↓ 7 callers
Function
GetEnvOrDefaultString
(env string, defaultValue string)
common/env.go:20
↓ 7 callers
Method
GetIgnoringMasterSwitch
GetIgnoringMasterSwitch returns the plugin of key as Get does, and with the master switch off, the enabled plugin the switch leaves out. Request proce
pkg/jsplugin/registry.go:848
↓ 7 callers
Function
GetModelPrice
GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false
setting/ratio_setting/model_ratio.go:360
↓ 7 callers
Function
GetPreferredChannelByAffinity
(c *gin.Context, modelName string, usingGroup string)
service/channel_affinity.go:550
↓ 7 callers
Function
GetRequestAutoGroups
GetRequestAutoGroups resolves the ordered Auto groups for the current token. The absence of the context value means that the token inherits the comple
service/group.go:98
↓ 7 callers
Method
GetResultURL
GetResultURL 获取任务结果 URL(视频地址等) 新数据存在 PrivateData.ResultURL 中;旧数据回退到 FailReason(历史兼容)
model/task.go:219
↓ 7 callers
Function
GetSSRFProtectedHTTPClient
GetSSRFProtectedHTTPClient 返回带拨号时 SSRF 校验的客户端。 ssrfProtectedHTTPClient 由 InitHttpClient 在启动时初始化,运行期只读。
service/http_client.go:167
↓ 7 callers
Function
GetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:163
↓ 7 callers
Function
GetTelegramSettings
()
setting/system_setting/telegram.go:20
↓ 7 callers
Function
HasGeminiUsageMetadataTokens
(metadata *GeminiUsageMetadata)
relaykit/dto/billing_usage.go:425
↓ 7 callers
Method
HasTaskPart
HasTaskPart reports whether the plugin is a task driver: it exports buildSubmitRequest.
pkg/jsplugin/registry.go:166
↓ 7 callers
Function
IsTaskPluginFactoryDisabled
(key string)
setting/task_plugin.go:139
↓ 7 callers
Function
LoadFromJsonStringWithCallback
(m *RWMap[K, V], jsonStr string, onSuccess func())
types/rw_map.go:83
↓ 7 callers
Method
MarkCompleted
MarkCompleted, MarkIncomplete and MarkCancelled keep the first terminal seen; MarkFailed always wins because an error after completion is still a fail
relay/common/stream_status.go:115
↓ 7 callers
Method
MarkFailed
MarkFailed records a protocol failure. Empty details never erase details recorded earlier, so a bare error envelope keeps the structured error.
relay/common/stream_status.go:142
↓ 7 callers
Function
MarkRequestPolicySuccess
(c *gin.Context, stream *relaycommon.StreamStatus)
service/request_policy.go:129
↓ 7 callers
Method
Mismatch
Mismatch reports whether the retained upstream declaration disagrees with both the requested and upstream models.
relay/common/response_model.go:32
↓ 7 callers
Function
NewResponsesUsageAccumulator
(info *relaycommon.RelayInfo)
service/responses_usage.go:28
↓ 7 callers
Function
NodeSyncStates
NodeSyncStates returns a copy of what this node has applied, by topic.
service/node_sync.go:84
↓ 7 callers
Method
Observe
Observe feeds one decoded stream event. raw is the same event's wire bytes; the vendor tool-usage reader runs on it once, at the terminal event.
service/responses_usage.go:34
↓ 7 callers
Function
OpenaiHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:253
↓ 7 callers
Function
PostConsumeUserSubscriptionDelta
Update subscription used amount by delta (positive consume more, negative refund).
model/subscription.go:1528
↓ 7 callers
Function
PrepareTieredBillingForSelectedGroup
PrepareTieredBillingForSelectedGroup refreshes routing-dependent billing state before an upstream attempt. An existing session reserves any higher est
service/tiered_settle.go:206
↓ 7 callers
Method
ReasoningState
ReasoningState returns the suffix-derived reasoning intent attached at the host entry layer. Standalone callers that do not set it receive nil; conver
relaykit/relayconvert/convmeta/meta.go:36
↓ 7 callers
Function
RechargeEpay
RechargeEpay 原子完成易支付订单:订单行锁、状态校验、成功更新与用户额度增加 在同一个事务内完成,因此同一订单的并发/重复回调(包括多实例部署下)最多充值一次。 alreadyDone=true 表示订单此前已完成,本次为幂等重复回调。 进程内的 LockOrder 只是优化,正确性由本
model/topup.go:177
↓ 7 callers
Function
Register
(channelID int, kind string, close func(reason string))
pkg/wsmanager/wsmanager.go:47
↓ 7 callers
Function
RootAuth
()
middleware/auth.go:144
↓ 7 callers
Method
SetBillableToolCount
SetBillableToolCount records an upstream-reported count for one tool-price key, replacing whatever per-item counting produced for the same key. Zero i
relay/common/tool_usage.go:66
↓ 7 callers
Function
SetLogDatabaseType
(databaseType DatabaseType)
common/database.go:29
↓ 7 callers
Method
SetUsage
(usage *dto.Usage)
relaykit/relayconvert/response_registry.go:424
↓ 7 callers
Function
ShouldRetryRelayError
(c *gin.Context, openaiErr *types.NewAPIError, retryTimes int)
service/relay_error.go:59
↓ 7 callers
Function
SplitPluginBillingExprKey
(key string)
setting/billing_setting/tiered_billing.go:90
↓ 7 callers
Function
StartPluginLogin
StartPluginLogin opens a login flow on a channel: keyIndex nil adds a credential, an index logs in again on that key line. add keeps the account of a
service/provider_plugin_login.go:137
↓ 7 callers
Function
StartStreamKeepAlive
StartStreamKeepAlive 按 interval 发送心跳,覆盖请求准备和重试;业务写入开始后交给流处理器。 内层请求复用外层的保活,内层清理不会提前结束它。
relay/helper/common.go:89
↓ 7 callers
Function
StatedLang
StatedLang returns the language the reader of a request stated, or "" when there is none. It checks multiple sources in priority order: 1. User settin
i18n/i18n.go:134
↓ 7 callers
Function
StrToMap
(str string)
common/str.go:49
↓ 7 callers
Function
TelegramConfigurationError
()
oauth/telegram.go:43
↓ 7 callers
Method
ToClaudeError
ToClaudeError masks the upstream addresses like ToOpenAIError.
relaykit/types/error.go:221
↓ 7 callers
Function
UnmarshalJsonStr
(data string, v any)
relaykit/relayconvert/kitutil/json.go:72
↓ 7 callers
Method
Update
Update writes an edited channel, all but its key: a key changes only through UpdateChannelLocked, so an edit never writes back a key a refresh replace
model/channel.go:622
↓ 7 callers
Method
UpdateAbilities
UpdateAbilities updates abilities of this channel. Make sure the channel is completed before calling this function.
model/ability.go:272
↓ 7 callers
Function
UpdateBatchTasks
(ctx context.Context, adaptor BatchTaskPollingAdaptor, taskChannelM map[int][]string, taskM map[string]*model.
service/task_polling.go:258
↓ 7 callers
Function
UpdatePasskeyDomainOptions
UpdatePasskeyDomainOptions keeps every supplied option in one transaction, including unrelated keys from UpdateOptionsBulk. Preview rolls back even th
model/passkey_option.go:96
↓ 7 callers
Function
UpdateUserUsedQuotaAndRequestCount
(id int, quota int)
model/user.go:1434
↓ 7 callers
Function
UpstreamModelName
UpstreamModelName / ChannelTypeOf are nil-safe accessors for optional Meta values (converters are often called with a nil Meta in tests and compat shi
relaykit/relayconvert/convmeta/meta.go:300
↓ 7 callers
Function
UsageFromChatUsage
(src *dto.Usage)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:159
↓ 7 callers
Function
accessTokenRequest
(router http.Handler, method, path, credential, proof, body string)
controller/access_token_audit_test.go:99
↓ 7 callers
Function
allowPrivateTaskMediaTest
(t *testing.T)
controller/task_generic_test.go:57
↓ 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
buildTaskPluginRouteRequest
(c *gin.Context)
middleware/task_plugin.go:1053
↓ 7 callers
Function
cacheGetTokenByKey
cacheGetTokenByKey 从缓存读取 token;不完整的哈希(如仅有配额字段)会被拒绝。
model/token_cache.go:139
↓ 7 callers
Function
callHailuoHook
(t *testing.T, plugin *jsplugin.LoadedPlugin, hook string, args ...any)
plugins/hailuo_responses_test.go:176
↓ 7 callers
Function
closeActiveChannelWebSockets
(channelIDs []int)
controller/channel.go:90
↓ 7 callers
Function
create
(context)
web/scripts/oxlint/intl-locale.mjs:152
↓ 7 callers
Function
createUserSessionTestUser
(t *testing.T, userID int, authVersion int64)
model/user_session_test.go:66
↓ 7 callers
Function
credentialTaskInfo
(baseURL, key string, channelType int)
relay/channel/task/jsplugin/credential_test.go:163
↓ 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:90
↓ 7 callers
Function
currentEnforcer
()
service/authz/enforcer.go:63
↓ 7 callers
Method
disabled
disabled receives the channel reread after UpdateChannelStatus succeeds. Checking the export table precedes all scheduler allocation and JS work.
service/provider_plugin_scheduled.go:146
↓ 7 callers
Function
filterDisabledFactory
(factory map[string]*LoadedPlugin, disabled map[string]struct{})
pkg/jsplugin/registry.go:1304
↓ 7 callers
Function
formatCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:408
↓ 7 callers
Function
formatPricingAmount
( value: string | number, currency = USD_PRICING_CURRENCY )
web/src/features/model-pricing/currency.ts:61
↓ 7 callers
Function
formatUptimePct
(pct: number)
web/src/features/performance-metrics/lib/format.ts:31
↓ 7 callers
Function
getServerErrorMessageKey
(value: unknown)
web/src/lib/server-error-message.ts:111
↓ 7 callers
Function
getServerErrorSources
( value: unknown )
web/src/lib/server-error-message.ts:94
↓ 7 callers
Function
getSubscriptionPlanByIdTx
(tx *gorm.DB, id int)
model/subscription.go:401
↓ 7 callers
Function
getTaskEnumFields
( schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-expr.ts:79
↓ 7 callers
Function
getTaskPricingDisplayTiers
( expression: string | null | undefined, schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-matrix-display.ts:63
↓ 7 callers
Function
getUserQuotaForPaymentGuardTest
(t *testing.T, userID int)
model/payment_method_guard_test.go:84
↓ 7 callers
Function
imageContent
(body)
plugins/tasks/alibaba/plugin.js:733
↓ 7 callers
Function
initCol
()
model/main.go:43
↓ 7 callers
Function
initDefaultHTTPClientFixture
(t *testing.T)
service/http_client_transport_test.go:45
← previous
next →
901–1,000 of 15,409, ranked by callers