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
↓ 11 callers
Function
useSidebar
()
web/src/components/ui/sidebar.tsx:67
↓ 11 callers
Method
value
()
pkg/jsplugin/provider.go:265
↓ 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:68
↓ 10 callers
Function
ApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:203
↓ 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
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
Method
GetByChannelType
(channelType int)
pkg/jsplugin/registry.go:860
↓ 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
pkg/jsplugin/engine.go:283
↓ 10 callers
Method
HasProviderPart
HasProviderPart reports whether the plugin declares relay routes.
pkg/jsplugin/registry.go:171
↓ 10 callers
Method
HasTransformPart
HasTransformPart reports whether the plugin exports a stage hook.
pkg/jsplugin/transform.go:48
↓ 10 callers
Function
InitLogDB
()
model/main.go:235
↓ 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.
pkg/jsplugin/provider.go:90
↓ 10 callers
Function
LockOrder
LockOrder 尝试对给定订单号加锁
controller/topup.go:384
↓ 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
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:399
↓ 10 callers
Function
UpdateConfigFromMap
UpdateConfigFromMap 从map更新配置对象(导出函数)
setting/config/config.go:281
↓ 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
UpdateUserUsableGroupsByJSONString
(jsonStr string)
setting/user_usable_group.go:39
↓ 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
configureEmailDelivery
(t *testing.T, options map[string]string)
controller/email_delivery_test.go:27
↓ 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
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
seedTaskPollingChannel
(t *testing.T, id int, disableSleep bool)
service/task_polling_test.go:192
↓ 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:386
↓ 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
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
pkg/jsplugin/transform.go:213
↓ 9 callers
Method
CloseIdleConnections
()
service/http_transport_sharded.go:91
↓ 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
↓ 9 callers
Function
EffectiveEffort
(intent Intent)
relaykit/relayconvert/reasoning/intent.go:654
↓ 9 callers
Method
EnsureClaudeConvertInfo
EnsureClaudeConvertInfo lazily creates and returns the mutable OpenAI→Claude stream conversion state. For non-nil receivers, the same instance must be
relaykit/relayconvert/convmeta/meta.go:43
↓ 9 callers
Function
EnsureLegacyAccessTokenRetireAt
EnsureLegacyAccessTokenRetireAt records the legacy token deadline on first start (now + 30 days) and loads the stored value. The first node to start w
model/user_access_token.go:305
↓ 9 callers
Function
GenerateHMACWithKey
(key []byte, data string)
common/crypto.go:12
↓ 9 callers
Function
GetByTaskId
(userId int, taskId string)
model/task.go:471
↓ 9 callers
Function
GetContextKeyType
(c *gin.Context, key constant.ContextKey)
common/gin.go:267
↓ 9 callers
Function
GetJsonString
(data any)
common/str.go:100
↓ 9 callers
Method
GetMaxTokens
()
relaykit/dto/openai_request.go:467
↓ 9 callers
Function
GetModelRatioCopy
()
setting/ratio_setting/model_ratio.go:684
↓ 9 callers
Method
GetScopes
GetScopes returns the stored scope list; a malformed value grants nothing.
model/user_access_token.go:59
↓ 9 callers
Function
GetTaskPluginDisabledFactoryKeys
()
setting/task_plugin.go:101
↓ 9 callers
Function
GetVerificationRequirements
(identity AuthIdentity, scope string)
service/security_verification.go:367
↓ 9 callers
Function
InitSessionCookieSettings
()
common/session_cookie.go:44
↓ 9 callers
Function
IsPaymentComplianceConfirmed
()
setting/operation_setting/payment_setting.go:55
↓ 9 callers
Function
IssueAccessToken
(identity AuthIdentity)
service/auth_token.go:60
← previous
next →
601–700 of 15,409, ranked by callers