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
↓ 31 callers
Method
Error
()
relaykit/types/error.go:123
↓ 31 callers
Method
Get
(platform string)
pkg/jsplugin/registry.go:441
↓ 31 callers
Method
GetSetting
()
model/user.go:179
↓ 31 callers
Function
InitChannelCache
()
model/channel_cache.go:27
↓ 31 callers
Function
SetContextKey
(c *gin.Context, key constant.ContextKey, value any)
common/gin.go:157
↓ 30 callers
Function
recordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:106
↓ 29 callers
Function
GetChannelById
GetChannelById loads a channel directly from the database, bypassing the in-memory channel cache. WARNING: do NOT call this on request hot paths (mid
model/channel.go:436
↓ 28 callers
Function
New
(plugin *pluginruntime.LoadedPlugin)
relay/channel/task/jsplugin/adaptor.go:90
↓ 28 callers
Method
Register
Register 注册一个配置模块
setting/config/config.go:28
↓ 27 callers
Method
SetPublic
SetPublic records metadata that log owners may receive from self/token log APIs. It rejects role-scoped and legacy-sensitive keys so new writers canno
model/log_other.go:60
↓ 27 callers
Method
Stop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:29
↓ 27 callers
Function
channelActionConfig
( config: ApiRequestConfig = {} )
web/src/features/channels/api.ts:43
↓ 26 callers
Function
GetGlobalSettings
()
setting/model_setting/global.go:76
↓ 26 callers
Function
GetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:30
↓ 26 callers
Method
StringContent
()
relaykit/dto/openai_request.go:569
↓ 26 callers
Function
UsingMainDatabase
(databaseType DatabaseType)
common/database.go:36
↓ 26 callers
Function
advancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:832
↓ 26 callers
Method
call
( ctx context.Context, admissionTimeout time.Duration, exportName string, members []string, args ...any,
pkg/jsplugin/engine.go:331
↓ 26 callers
Function
issueSecurityEnrollmentProof
(t *testing.T, identity service.AuthIdentity, operation service.VerificationOperation, method string)
controller/security_enrollment_test.go:120
↓ 26 callers
Method
open
(_method: string, url: string)
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:185
↓ 25 callers
Method
RoutingErrors
()
pkg/jsplugin/registry.go:628
↓ 25 callers
Function
TryTieredSettle
TryTieredSettle checks if the request uses tiered_expr billing and, if so, computes the actual quota using the captured BillingSnapshot. Returns: - ok
service/tiered_settle.go:163
↓ 25 callers
Function
WithOpenAIError
(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:317
↓ 25 callers
Function
mustApplyReasoningModelSuffix
(t *testing.T, info *relaycommon.RelayInfo, outbound ...dto.Request)
relay/helper/reasoning_suffix_test.go:22
↓ 24 callers
Method
GetBaseURL
()
model/channel.go:521
↓ 24 callers
Function
GetResponseID
(c *gin.Context)
relay/helper/common.go:174
↓ 24 callers
Function
GetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:131
↓ 24 callers
Function
IOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 24 callers
Method
RegisterFactory
(source string, options Options)
pkg/jsplugin/registry.go:205
↓ 24 callers
Method
addEventListener
( type: string, listener: (event: Event & { data?: string; readyState?: number }) => void )
web/src/features/playground/hooks/use-stream-request.test.ts:41
↓ 24 callers
Function
formatQuota
(quota: number)
web/src/lib/format.ts:73
↓ 24 callers
Function
formatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:167
↓ 24 callers
Function
setupTaskPluginControllerTest
(t *testing.T)
controller/task_plugin_test.go:25
↓ 23 callers
Method
Decode
(s string)
pkg/cachex/codec.go:12
↓ 23 callers
Method
Error
()
relaykit/relayconvert/reasoning/intent.go:35
↓ 23 callers
Method
GetPageSize
()
common/page_info.go:25
↓ 23 callers
Function
GetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:88
↓ 23 callers
Function
NewErrorWithStatusCode
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:299
↓ 23 callers
Method
Value
()
model/task.go:98
↓ 23 callers
Method
makeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callers
Method
match
(response *dto.GeminiFunctionResponse)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_req.go:241
↓ 23 callers
Function
performPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:879
↓ 23 callers
Function
pluginProtocolTestDeps
()
controller/plugin_protocol_test.go:1485
↓ 23 callers
Function
seedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:91
↓ 23 callers
Function
useStatus
()
web/src/hooks/use-status.ts:40
↓ 22 callers
Function
CompilePlugin
CompilePlugin validates a plugin without publishing it. Callers that refresh multiple plugins use this together with ReplaceOverrides so readers obser
pkg/jsplugin/registry.go:243
↓ 22 callers
Function
authResult
( request: Promise<{ data: { success: boolean; message?: string; code?: string; data?: T } }>, fallb
web/src/lib/secure-verification.ts:64
↓ 22 callers
Function
compileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:842
↓ 22 callers
Function
recordUserSecurityAudit
recordUserSecurityAudit 记录普通用户自己的安全敏感操作(如 passkey 绑定/解绑)。 这类日志没有管理员操作者,不写 admin_info;同时不依赖 AdminAuth/RootAuth 的兜底。
controller/audit.go:126
↓ 22 callers
Function
seedChannel
(t *testing.T, id int)
service/task_billing_test.go:119
↓ 21 callers
Method
AddOtherRatio
(key string, ratio float64)
types/price_data.go:35
↓ 21 callers
Function
CreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:52
↓ 21 callers
Method
Encode
(v V)
pkg/cachex/codec.go:11
↓ 21 callers
Method
Error
Error lets the same typed value serve both as the settlement audit marker and as the fail-fast error returned by strict pre-consume conversions.
common/quota_math.go:52
↓ 21 callers
Function
GetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 21 callers
Method
GetStartIdx
()
common/page_info.go:17
↓ 21 callers
Function
ParseAccessToken
(raw string)
service/auth_token.go:84
↓ 21 callers
Function
ResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:22
↓ 21 callers
Method
Validate
()
relaykit/dto/channel_settings.go:389
↓ 21 callers
Function
calculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:231
↓ 21 callers
Function
getTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:475
↓ 21 callers
Function
serveTaskPluginProtocol
( c *gin.Context, pinned pluginruntime.PinnedEndpoint, deps pluginProtocolBridgeDeps, )
controller/plugin_protocol.go:140
↓ 21 callers
Function
testPluginRouteHandlers
( handler func(*gin.Context, *jsplugin.RoutingGeneration, jsplugin.RouteBinding), )
router/plugin_router_test.go:823
↓ 20 callers
Function
CreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 20 callers
Function
GetEnvOrDefault
(env string, defaultValue int)
common/env.go:9
↓ 20 callers
Function
SaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:50
↓ 20 callers
Function
compilePluginProtocolTestEndpoint
(t *testing.T, key, source string)
controller/plugin_protocol_test.go:1420
↓ 20 callers
Function
compileTaskRoutePlugin
(t *testing.T, source string)
middleware/task_plugin_test.go:1587
↓ 20 callers
Function
copyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 20 callers
Function
getLastLog
(t *testing.T)
service/task_billing_test.go:510
↓ 20 callers
Method
resolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:367
↓ 20 callers
Function
useUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:17
↓ 19 callers
Method
Close
()
relaykit/types/file_source.go:209
↓ 19 callers
Function
GetAuthFlow
GetAuthFlow validates a flow without consuming it. Callers must still use ConsumeAuthFlow with all identity-bound fields before performing the action.
model/auth_flow.go:212
↓ 19 callers
Function
MainDatabaseType
()
common/database.go:15
↓ 19 callers
Function
PrepareTaskPluginRoute
PrepareTaskPluginRoute resolves and executes the pinned declarative route. Query requests terminate here so channel distribution and billing are never
middleware/task_plugin.go:50
↓ 19 callers
Function
Register
Register registers an OAuth provider with the given name
oauth/registry.go:20
↓ 19 callers
Function
newPluginProtocolTestContext
(stream, requestBodyStream bool)
controller/plugin_protocol_test.go:1456
↓ 18 callers
Function
CloneBillingUsage
(usage *BillingUsage)
relaykit/dto/billing_usage.go:225
↓ 18 callers
Method
Commit
Commit writes the capped completed-output count into RelayInfo once. Request tool declarations alone must not become billable calls.
relay/common/tool_usage.go:147
↓ 18 callers
Function
GetPageQuery
(c *gin.Context)
common/page_info.go:41
↓ 18 callers
Method
InitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:207
↓ 18 callers
Method
Migrator
(db *gorm.DB)
model/migration_dialector.go:17
↓ 18 callers
Function
NormalizeEmail
(email string)
model/user.go:325
↓ 18 callers
Method
SetItems
(items any)
common/page_info.go:37
↓ 18 callers
Method
SetTotal
(total int)
common/page_info.go:33
↓ 18 callers
Function
UnmarshalBodyReusable
(c *gin.Context, v any)
common/gin.go:108
↓ 18 callers
Function
getCurrencyDisplay
()
web/src/lib/currency.ts:365
↓ 18 callers
Function
routingTestPluginSource
(key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1015
↓ 18 callers
Function
safeJsonParseWithValidation
( value: string | undefined | null, options: SafeJsonParseWithValidationOptions<T> )
web/src/features/system-settings/utils/json-parser.ts:141
↓ 18 callers
Function
useChannels
()
web/src/features/channels/components/channels-provider.tsx:145
↓ 17 callers
Method
DoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:28
↓ 17 callers
Method
GetOtherSettings
()
model/channel.go:1035
↓ 17 callers
Function
GetPasskeySettings
()
setting/system_setting/passkey.go:35
↓ 17 callers
Method
GetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:171
↓ 17 callers
Function
ModelMappedHelper
(c *gin.Context, info *relaycommon.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:14
↓ 17 callers
Method
ParseContent
()
relaykit/dto/claude.go:182
↓ 17 callers
Method
ParseToolCalls
()
relaykit/dto/openai_request.go:553
↓ 17 callers
Method
Source
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 17 callers
Function
ValidateLoginSession
(identity AuthIdentity)
service/auth_session.go:130
← previous
next →
101–200 of 11,918, ranked by callers