Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,592 in github.com/QuantumNous/new-api
⨍
Functions
15,592
◇
Types & classes
2,267
↓ 11 callers
Function
registerTestPlugin
(registry *Registry, version string, factory bool)
pkg/jsplugin/registry_test.go:215
↓ 11 callers
Function
requirePaymentCompliance
(c *gin.Context)
controller/payment_compliance.go:20
↓ 11 callers
Function
responseSemanticLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/response.go:509
↓ 11 callers
Method
run
()
relay/requestplugin/pdf.go:912
↓ 11 callers
Method
scan
scan examines a plugin-channel snapshot. Workers exist only while a hook is running; a busy key waits for the next scan.
service/provider_plugin_scheduled.go:70
↓ 11 callers
Function
seedTaskPollingChannel
(t *testing.T, id int, disableSleep bool)
service/task_polling_test.go:192
↓ 11 callers
Function
setupManageUserTestDB
(t *testing.T)
controller/user_manage_test.go:32
↓ 11 callers
Function
sideDrawerFooterClassName
(className?: string)
web/src/components/drawer-layout.ts:42
↓ 11 callers
Method
submitContext
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/task/jsplugin/adaptor.go:1530
↓ 11 callers
Function
taskPriceLabel
( description: LocalizedTextValue | undefined, field: string, language: string )
web/src/features/pricing/lib/task-price-display.ts:39
↓ 11 callers
Function
trimmed
(value)
plugins/tasks/kling/plugin.js:98
↓ 11 callers
Function
useSidebar
()
web/src/components/ui/sidebar.tsx:67
↓ 11 callers
Function
withSMTPSettings
(t *testing.T)
common/email_test.go:243
↓ 10 callers
Function
AccountMailLanguage
AccountMailLanguage is the language of mail about a user's account: the language the user saved, else the one the request stated.
service/account_security.go:36
↓ 10 callers
Method
AddEvent
(event PolicyEvent)
service/request_policy.go:69
↓ 10 callers
Function
ApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:218
↓ 10 callers
Function
BuildTaskPluginView
BuildTaskPluginView converts a persisted task into the deliberately narrow public shape permitted at JavaScript plugin boundaries.
service/task_plugin_view.go:11
↓ 10 callers
Method
CacheCreationTokensTotal
CacheCreationTokensTotal returns the cache-write token count regardless of which field the upstream reported it in. Claude-derived conversions populat
relaykit/dto/openai_response.go:338
↓ 10 callers
Method
CallTransform
CallTransform runs one stage hook, tctx.Stage, and validates the result shape. tctx.Config, req.Body and req.Headers are passed to JavaScript without
pluginkit/transform.go:289
↓ 10 callers
Method
ChannelRelayConfig
ChannelRelayConfig is RelayConfig for a channel: only the routes its plugin_routes (toggles) leave on, and an upstream_path that starts with {config.<
pluginkit/meta.go:267
↓ 10 callers
Method
ConvertGeminiRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest)
relay/channel/adapter.go:34
↓ 10 callers
Method
ConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/adapter.go:28
↓ 10 callers
Function
DefaultPluginProtocolLimits
()
relay/plugin_protocol.go:43
↓ 10 callers
Function
FlushWriter
(c *gin.Context)
relay/helper/common.go:155
↓ 10 callers
Function
GenerateTextOtherInfo
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, modelRatio, groupRatio, completionRatio float64, cacheTo
service/log_info_generate.go:103
↓ 10 callers
Method
GetAutoBan
()
model/channel.go:358
↓ 10 callers
Function
GetBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:70
↓ 10 callers
Function
GetInstances
GetInstances returns the instance list in option order. The list is shared and must not be changed.
setting/request_plugin_setting/config.go:83
↓ 10 callers
Function
GetModelPricingSnapshot
(names []string)
model/model_pricing_config.go:242
↓ 10 callers
Method
GetNextEnabledKey
()
model/channel.go:219
↓ 10 callers
Method
GetOriginModelName
()
relaykit/relayconvert/convmeta/meta.go:21
↓ 10 callers
Method
GetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/adapter.go:21
↓ 10 callers
Function
GetTokenByKey
(key string, fromDB bool)
model/token.go:284
↓ 10 callers
Method
HasExport
HasExport reports whether a module export was defined when the plugin loaded: an export that was undefined then counts as absent, and a later assignme
pluginkit/engine.go:274
↓ 10 callers
Method
HasProviderPart
HasProviderPart reports whether the plugin declares relay routes.
pluginkit/meta.go:170
↓ 10 callers
Method
HasTransformPart
HasTransformPart reports whether the plugin exports a stage hook.
pluginkit/transform.go:110
↓ 10 callers
Function
HashAccountPassword
HashAccountPassword is for account passwords, not MFA backup codes. The temporary bcrypt mode permits rolling out dual-format readers to all nodes bef
common/account_password.go:44
↓ 10 callers
Method
IsDisk
IsDisk 是否是磁盘存储
common/body_storage.go:26
↓ 10 callers
Method
IsStringContent
()
relaykit/dto/claude.go:144
↓ 10 callers
Method
Line
Line encodes the credential as one compact JSON line.
pluginkit/provider.go:88
↓ 10 callers
Function
LockOrder
LockOrder 尝试对给定订单号加锁
controller/topup.go:399
↓ 10 callers
Method
MarshalJSONString
()
types/rw_map.go:94
↓ 10 callers
Function
NewOAuthError
NewOAuthError creates a new OAuth error with the given web console message
oauth/types.go:55
↓ 10 callers
Function
NewOpenAIChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:58
↓ 10 callers
Function
NewOpenAIResponsesBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:62
↓ 10 callers
Function
NewStreamStatus
()
relay/common/stream_status.go:73
↓ 10 callers
Function
OaiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:69
↓ 10 callers
Function
OpenaiImageStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_image.go:122
↓ 10 callers
Method
Plugins
()
pkg/jsplugin/routing.go:246
↓ 10 callers
Function
RebuildToolPriceIndex
RebuildToolPriceIndex rebuilds the lookup index from the current config. Called on init and after config updates. Not on the billing hot path.
setting/operation_setting/tools.go:211
↓ 10 callers
Function
RelayTaskSubmit
RelayTaskSubmit 完成 task 提交的全部流程(每次尝试调用一次): 刷新渠道元数据 → 确定 platform/adaptor → 验证请求 → 估算计费(EstimateBilling) → 计算价格 → 预扣费(重试时补足差额)→ 构建/发送/解析上游请求 → 提交后计费调整(
relay/relay_task.go:203
↓ 10 callers
Function
ReloadPolicy
()
service/authz/enforcer.go:69
↓ 10 callers
Function
RequestId
()
middleware/request-id.go:10
↓ 10 callers
Method
SetupRequestHeader
(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo)
relay/channel/adapter.go:22
↓ 10 callers
Function
StorePluginLoginCredential
StorePluginLoginCredential writes the credential of a finished login: it replaces the line at keyIndex, or adds one (a new line in multi-key mode, oth
service/provider_plugin_login.go:621
↓ 10 callers
Function
UnlockOrder
UnlockOrder 释放给定订单号的锁
controller/topup.go:414
↓ 10 callers
Function
UpdateConfigFromMap
UpdateConfigFromMap 从map更新配置对象(导出函数)
setting/config/config.go:281
↓ 10 callers
Function
UpdateGroupRatioByJSONString
(jsonStr string)
setting/ratio_setting/group_ratio.go:75
↓ 10 callers
Function
UpdateMaxTokenAutoGroups
(value string)
setting/auto_group.go:59
↓ 10 callers
Function
UpdateOption
(c *gin.Context)
controller/option.go:187
↓ 10 callers
Function
UserSubject
UserSubject is the casbin subject string for a single user.
service/authz/permission.go:20
↓ 10 callers
Method
WriteHeader
(statusCode int)
router/plugin-router.go:543
↓ 10 callers
Function
addNewRecord
(type_ int, id int, value int)
model/utils.go:43
↓ 10 callers
Function
auditSteps
(outcome Outcome)
relay/requestplugin/relay.go:472
↓ 10 callers
Function
channelMatchesExpectedTaskPlugin
(c *gin.Context, channel *model.Channel, expected string)
middleware/distributor.go:165
↓ 10 callers
Method
channelType
channelType is the channel type of the call, 0 before a channel is selected.
relay/requestplugin/plan.go:262
↓ 10 callers
Function
fetchChannelUpstreamModelIDs
(channel *model.Channel)
controller/channel_upstream_update.go:377
↓ 10 callers
Function
formatBillingCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:471
↓ 10 callers
Function
geminiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response, callback func(data string, geminiResponse *
relay/channel/gemini/relay-gemini.go:317
↓ 10 callers
Function
getChannelAffinityCache
()
service/channel_affinity.go:83
↓ 10 callers
Function
getCurrencyLabel
()
web/src/lib/currency.ts:546
↓ 10 callers
Function
getTokenCacheKey
(key string)
model/token_cache.go:28
↓ 10 callers
Function
insertPricingEndpointChannel
(t *testing.T, channelID int, channelType int, settings dto.ChannelOtherSettings)
model/pricing_endpoint_test.go:34
↓ 10 callers
Function
insertUserForPaymentGuardTest
(t *testing.T, id int, quota int)
model/payment_method_guard_test.go:12
↓ 10 callers
Function
localizedPluginName
( plugin: { name: string; name_i18n?: LocalizedTextValue | null }, language: string )
web/src/features/task-plugins/lib/plugin-name.ts:25
↓ 10 callers
Function
modelKey
(model)
plugins/tasks/alibaba/plugin.js:465
↓ 10 callers
Function
newMantleTestInfo
()
relay/channel/aws/relay_aws_test.go:591
↓ 10 callers
Function
newTaskSubmitContext
(t *testing.T, originalModel, mapping string)
relay/relay_task_test.go:220
↓ 10 callers
Function
performHeaderNavRequest
(t *testing.T, handler gin.HandlerFunc, authenticated bool)
middleware/header_nav_test.go:41
↓ 10 callers
Function
populateUserCache
(user User)
model/user_cache.go:82
↓ 10 callers
Function
pricingOptions
( values: Record<string, string | boolean> )
web/src/features/model-pricing/pricing.ts:147
↓ 10 callers
Function
rawJSONPresent
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:707
↓ 10 callers
Function
recordManageAuditFor
recordManageAuditFor 记录一条管理审计日志,日志归属于操作者;targetUserId 只表示被操作用户,用于在结构化参数中保留目标上下文。
controller/audit.go:150
↓ 10 callers
Function
requireBrowserSession
(c *gin.Context)
controller/auth_session.go:151
↓ 10 callers
Function
retrieveTaskPluginResponse
(c *gin.Context, deps pluginProtocolBridgeDeps)
controller/plugin_protocol.go:950
↓ 10 callers
Function
settleTaskBillingOnComplete
settleTaskBillingOnComplete 任务完成时的统一计费调整。 返回 true 表示用量结算路径已接管最终计费;失败任务仅在返回 false 时补做全额退款。 优先级:1. tiered snapshot → 2. adaptor 调整 → 3. token 重算。 表达式求值
service/task_polling.go:774
↓ 10 callers
Function
setupAccessTokenAudit
(t *testing.T)
controller/access_token_audit_test.go:34
↓ 10 callers
Function
setupTaskSubmissionDatabase
setupTaskSubmissionDatabase opens the dialect selected by TEST_TASK_DB_DIALECT (SQLite in memory by default) and records every task INSERT in events s
controller/relay_task_plugin_test.go:465
↓ 10 callers
Function
taskSubmissionRelayInfo
(billing relaycommon.BillingSettler)
controller/relay_task_plugin_test.go:488
↓ 10 callers
Function
translateServerText
( t: (key: string, options?: Record<string, unknown>) => string, text: string )
web/src/lib/server-error-message.ts:179
↓ 10 callers
Function
updateOptionMap
(key string, value string)
model/option.go:389
↓ 10 callers
Function
useSearch
()
web/src/context/search-provider.tsx:54
↓ 10 callers
Function
useSecureVerification
()
web/src/features/auth/secure-verification/hooks/use-secure-verification.ts:141
↓ 10 callers
Function
useThemeCustomization
()
web/src/context/theme-customization-provider.tsx:243
↓ 10 callers
Function
useUsageLogsContext
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:88
↓ 10 callers
Function
visitAuthorize
visitAuthorize follows the step's URL like the browser does and returns the query the vendor redirects back with.
service/provider_plugin_login_test.go:30
↓ 9 callers
Method
AdjustBillingOnSubmit
AdjustBillingOnSubmit returns adjusted OtherRatios from the upstream submit response. Called after a successful ParseResponse. If the upstream returne
relay/channel/adapter.go:63
↓ 9 callers
Method
CloseIdleConnections
()
service/http_transport_sharded.go:91
↓ 9 callers
Function
DecideRelayRetry
DecideRelayRetry is the single retry decision for relay attempts. The reason is recorded in the request policy decision events of the log details.
service/relay_error.go:20
↓ 9 callers
Method
DeleteMany
DeleteMany accepts either fully namespaced keys or raw keys and deletes them. It returns a map keyed by fully namespaced keys.
pkg/cachex/hybrid_cache.go:231
← previous
next →
601–700 of 15,592, ranked by callers