Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
11,560 in github.com/QuantumNous/new-api
⨍
Functions
11,560
◇
Types & classes
1,706
↓ 8 callers
Function
jsonValue
(value any)
relay/channel/task/jsplugin/adaptor.go:1553
↓ 8 callers
Method
memCache
()
pkg/cachex/hybrid_cache.go:69
↓ 8 callers
Function
metricValue
(metrics: FlowMetrics, metric: FlowMetric)
web/src/features/dashboard/lib/flow.ts:164
↓ 8 callers
Function
newAuthzTestDB
(t *testing.T)
service/authz/authz_test.go:14
↓ 8 callers
Function
newConvertRequestFailedError
(c *gin.Context, info *relaycommon.RelayInfo, err error)
relay/convert_request_error.go:13
↓ 8 callers
Function
newImageTestContext
(t *testing.T, body, contentType string, isStream bool)
relay/channel/openai/image_stream_test.go:19
↓ 8 callers
Function
newOuterPluginTestEngine
()
router/plugin_router_test.go:812
↓ 8 callers
Function
newPluginProtocolObservationLimiter
(limits pluginProtocolObservationLimits)
controller/plugin_protocol_limiter.go:56
↓ 8 callers
Function
newPluginProtocolRetrieveContext
(responseID string)
controller/plugin_protocol_test.go:1553
↓ 8 callers
Function
normalizeHeaderContextKey
(key string)
relay/common/override.go:1629
↓ 8 callers
Function
pluginProtocolRetrieveDeps
(pinned pluginruntime.PinnedEndpoint, task *model.Task, exists bool, err error)
controller/plugin_protocol_test.go:1563
↓ 8 callers
Function
presentationLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/encode.go:1302
↓ 8 callers
Function
rawJSONPresent
(value json.RawMessage)
relaykit/relayconvert/internal/toolconv/response_artifacts.go:805
↓ 8 callers
Method
redisOn
()
pkg/cachex/hybrid_cache.go:59
↓ 8 callers
Function
requireDeploymentID
(c *gin.Context)
controller/deployment.go:120
↓ 8 callers
Function
resetBatchUpdateTestState
(t *testing.T)
model/quota_reserve_test.go:58
↓ 8 callers
Function
resetSessionCookieSettingsAfterTest
(t *testing.T)
common/url_validator_test.go:125
↓ 8 callers
Function
responseStreamEventItemID
(event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:363
↓ 8 callers
Function
setupTaskSubmissionDatabase
(t *testing.T, migrate bool, events *[]string)
controller/relay_task_plugin_test.go:354
↓ 8 callers
Function
staticProtection
(protection *common.SSRFProtection)
service/protected_fetch_client_test.go:26
↓ 8 callers
Method
submitContext
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/task/jsplugin/adaptor.go:1190
↓ 8 callers
Function
taskPluginControllerTestSource
(key, version string)
controller/task_plugin_test.go:43
↓ 8 callers
Function
tieredQuota
--------------------------------------------------------------------------- BuildTieredTokenParams: token normalization and ratio parity tests -------
service/tiered_settle_test.go:664
↓ 8 callers
Function
trimmed
(value)
plugins/tasks/alibaba/plugin.js:42
↓ 8 callers
Function
useContextValue
()
web/src/components/ai-elements/context.tsx:52
↓ 8 callers
Function
useRateLimitMiniRedis
(t *testing.T)
middleware/rate_limit_test.go:20
↓ 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:144
↓ 8 callers
Function
useUsageLogsContext
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:88
↓ 7 callers
Method
CanonicalUsage
CanonicalUsage decodes the original provider usage carried across relay hops into the shared accounting shape. The BillingUsage snapshot remains the s
relaykit/dto/billing_usage.go:242
↓ 7 callers
Function
ConfigureTrustedProxies
(engine *gin.Engine)
middleware/trusted_proxies.go:11
↓ 7 callers
Method
ConvertGeminiRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest)
relay/channel/adapter.go:33
↓ 7 callers
Function
ConvertStreamResponseChunk
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState, response any)
service/response_converter.go:26
↓ 7 callers
Method
FinalResponse
FinalResponse validates a plugin-authored complete Responses object and overwrites every host-owned identity and lifecycle field. Unknown protocol fie
relay/plugin_protocol.go:562
↓ 7 callers
Function
FormatClaudeResponseInfo
(claudeResponse *dto.ClaudeResponse, oaiResponse *dto.ChatCompletionsStreamResponse, claudeInfo *ClaudeRespons
relay/channel/claude/relay-claude.go:83
↓ 7 callers
Method
GetAutoBan
()
model/channel.go:343
↓ 7 callers
Function
GetByTaskId
(userId int, taskId string)
model/task.go:421
↓ 7 callers
Function
GetClaudeSettings
GetClaudeSettings 获取Claude配置
setting/model_setting/claude.go:45
↓ 7 callers
Function
GetContextKeyString
(c *gin.Context, key constant.ContextKey)
common/gin.go:165
↓ 7 callers
Function
GetEnvOrDefaultString
(env string, defaultValue string)
common/env.go:21
↓ 7 callers
Function
GetGroupRatioCopy
()
setting/ratio_setting/group_ratio.go:62
↓ 7 callers
Method
GetImageMedia
()
relaykit/dto/openai_request.go:336
↓ 7 callers
Function
GetModelPrice
GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false
setting/ratio_setting/model_ratio.go:359
↓ 7 callers
Function
GetModelRatio
(name string)
setting/ratio_setting/model_ratio.go:384
↓ 7 callers
Function
GetMonitorSetting
()
setting/operation_setting/monitor_setting.go:41
↓ 7 callers
Function
GetPasskeyByUserID
(userID int)
model/passkey.go:123
↓ 7 callers
Function
GetPaymentSetting
()
setting/operation_setting/payment_setting.go:29
↓ 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
Method
GetUpstreamModelName
()
relaykit/relayconvert/convmeta/meta.go:20
↓ 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:211
↓ 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
Function
IssueSecurityProof
(identity AuthIdentity, method string, scopes []string)
service/auth_token.go:132
↓ 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
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
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:700
↓ 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
StrToMap
(str string)
common/str.go:47
↓ 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:1369
↓ 7 callers
Function
UserAuth
()
middleware/auth.go:94
↓ 7 callers
Function
UserUsableGroups2JSONString
()
setting/user_usable_group.go:27
↓ 7 callers
Function
UsingLogDatabase
(databaseType DatabaseType)
common/database.go:40
↓ 7 callers
Function
ValidateLoginSession
(identity AuthIdentity)
service/auth_session.go:121
↓ 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
authSigningKey
(purpose string)
service/auth_token.go:54
↓ 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
hasPermission
( user: AuthUser | null | undefined, resource: string, action: string )
web/src/lib/admin-permissions.ts:77
↓ 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:373
↓ 7 callers
Function
numberValue
(value: unknown)
web/src/features/dashboard/lib/flow.ts:145
↓ 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
← previous
next →
501–600 of 11,560, ranked by callers