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
↓ 54 callers
Method
Open
(name string)
common/embed-file-system.go:26
↓ 54 callers
Function
lockForUpdate
lockForUpdate makes the next query emit SELECT ... FOR UPDATE so the matched rows stay locked until the surrounding transaction ends. GORM v2 silentl
model/locking.go:20
↓ 54 callers
Function
onChange
()
web/src/hooks/use-mobile.ts:28
↓ 53 callers
Method
GetSetting
()
model/user.go:165
↓ 53 callers
Method
Write
(p []byte)
relay/channel/openai/image_stream_test.go:298
↓ 52 callers
Function
CloseResponseBodyGracefully
(httpResponse *http.Response)
service/http.go:16
↓ 52 callers
Function
ExprHashString
ExprHashString returns the SHA-256 hex digest of an expression string.
pkg/billingexpr/types.go:108
↓ 52 callers
Function
NewErrorWithStatusCode
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:307
↓ 51 callers
Function
Interface2String
(inter any)
relaykit/relayconvert/kitutil/value.go:16
↓ 50 callers
Method
boolean
(node: ExpressionNode)
web/src/features/pricing/lib/billing-expression/runtime.ts:301
↓ 49 callers
Method
Remove
(item T)
types/set.go:17
↓ 47 callers
Function
BumpSyncTopic
BumpSyncTopic adds a sync task for topic. Call it after the write to the topic's data has committed. A failed bump is only logged: the periodic full r
model/system_sync_task.go:47
↓ 47 callers
Function
LogInfo
(ctx context.Context, msg string)
logger/logger.go:76
↓ 47 callers
Method
RegisterFactory
(source string, options Options)
pkg/jsplugin/registry.go:472
↓ 47 callers
Function
SetContextKey
(c *gin.Context, key constant.ContextKey, value any)
common/gin.go:178
↓ 47 callers
Method
delete
(identity *AuthSessionIdentity)
model/user.go:955
↓ 47 callers
Method
number
()
relay/requestplugin/pdf.go:551
↓ 47 callers
Function
seedUser
(t *testing.T, id int, quota int)
service/task_billing_test.go:90
↓ 47 callers
Function
writeSecurityOperationError
writeSecurityOperationError only exposes known, fixed business messages. Unexpected errors retain their cause for the existing server-side auth logger
controller/secure_verification.go:37
↓ 46 callers
Function
InitHttpClient
()
service/http_client.go:147
↓ 46 callers
Function
RunExpr
RunExpr compiles (with cache) and executes an expression string. The environment exposes: - p, c — prompt / completion tokens (auto-exclud
pkg/billingexpr/run.go:26
↓ 44 callers
Method
CallPath
CallPath invokes a function nested below an exported object. It is used for protocol hooks such as protocols.openai_responses.renderEvents.
pkg/jsplugin/engine.go:371
↓ 44 callers
Function
createProviderChannel
(t *testing.T, pluginKey, baseURL, key string, multiKey bool)
service/provider_plugin_test.go:281
↓ 43 callers
Method
Register
Register 注册一个配置模块
setting/config/config.go:28
↓ 42 callers
Method
GetEstimatePromptTokens
()
relaykit/relayconvert/convmeta/meta.go:37
↓ 42 callers
Method
call
(ctx context.Context, opts callOptions, exportName string, members []string, args ...any)
pkg/jsplugin/engine.go:439
↓ 42 callers
Method
install
install makes channel the only one and returns it stored.
router/provider_plugin_relay_test.go:174
↓ 42 callers
Function
newRelayHarness
(t *testing.T)
router/provider_plugin_relay_test.go:132
↓ 41 callers
Method
Error
()
relaykit/types/error.go:126
↓ 41 callers
Method
Keys
Keys returns keys with valid values. In Redis, it returns all matching keys.
pkg/cachex/hybrid_cache.go:132
↓ 41 callers
Method
Write
(data []byte)
controller/responses_websocket.go:71
↓ 41 callers
Function
makeTask
(userId, channelId, quota, tokenId int, billingSource string, subscriptionId int)
service/task_billing_test.go:144
↓ 40 callers
Method
GetBaseURL
()
model/channel.go:583
↓ 40 callers
Method
LoadFromDB
LoadFromDB 从数据库加载配置
setting/config/config.go:42
↓ 40 callers
Method
Migrator
(db *gorm.DB)
model/migration_dialector.go:18
↓ 40 callers
Method
ValidateRequestAndSetAction
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:46
↓ 38 callers
Function
toIntlLocale
(value?: string | null)
web/src/i18n/languages.ts:87
↓ 37 callers
Method
GetOtherSettings
()
model/channel.go:1229
↓ 37 callers
Function
Init
Init initializes the i18n bundle and loads all translation files
i18n/i18n.go:37
↓ 37 callers
Function
useUpdateOption
()
web/src/features/system-settings/hooks/use-update-option.ts:54
↓ 36 callers
Method
Stop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:37
↓ 36 callers
Method
Write
(p []byte)
common/sys_log.go:32
↓ 35 callers
Method
Encode
(v V)
pkg/cachex/codec.go:11
↓ 35 callers
Function
UsingMainDatabase
(databaseType DatabaseType)
common/database.go:38
↓ 35 callers
Method
addEventListener
( type: string, listener: (event: Event & { data?: string; readyState?: number }) => void )
web/src/features/playground/hooks/use-stream-request.test.ts:41
↓ 35 callers
Method
captured
()
router/provider_plugin_relay_test.go:88
↓ 35 callers
Function
issueSecurityEnrollmentProof
(t *testing.T, identity service.AuthIdentity, operation service.VerificationOperation, method string)
controller/security_enrollment_test.go:133
↓ 35 callers
Method
pluginChannel
(pluginKey, key string)
router/provider_plugin_relay_test.go:167
↓ 34 callers
Function
StreamScannerHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo, dataHandler func(data string, sr *StreamRes
relay/helper/stream_scanner.go:120
↓ 34 callers
Method
WriteString
(s string)
middleware/audit.go:37
↓ 33 callers
Function
GetGlobalSettings
()
setting/model_setting/global.go:75
↓ 33 callers
Function
SetupApiRequestHeader
(info *common.RelayInfo, c *gin.Context, req *http.Header)
relay/channel/api_request.go:52
↓ 33 callers
Method
Source
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 33 callers
Function
getUserQuota
--------------------------------------------------------------------------- Read-back helpers --------------------------------------------------------
service/task_billing_test.go:520
↓ 33 callers
Function
registerRelayPlugin
(t *testing.T, source string)
router/provider_plugin_relay_test.go:224
↓ 33 callers
Function
setupTaskPluginControllerTest
(t *testing.T)
controller/task_plugin_test.go:34
↓ 32 callers
Method
GetErrorCode
()
relaykit/types/error.go:112
↓ 32 callers
Function
MainDatabaseType
()
common/database.go:17
↓ 32 callers
Function
ParseCredential
ParseCredential reads one channel key line as a plugin credential. Any other line is a static key.
pkg/jsplugin/provider.go:74
↓ 32 callers
Method
ReplaceOverrides
ReplaceOverrides atomically publishes a complete override layer.
pkg/jsplugin/registry.go:947
↓ 32 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:62
↓ 32 callers
Function
channelActionConfig
( config: ApiRequestConfig = {} )
web/src/features/channels/api.ts:56
↓ 32 callers
Function
recordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:144
↓ 32 callers
Function
storedChannel
(t *testing.T, id int)
service/provider_plugin_test.go:307
↓ 31 callers
Function
GetChannelConstraints
(c *gin.Context)
service/channel_select.go:19
↓ 31 callers
Function
GetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:89
↓ 31 callers
Method
Open
(name string)
middleware/frontend_static_test.go:28
↓ 31 callers
Method
match
()
service/provider_plugin_login.go:317
↓ 30 callers
Function
DoApiRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:377
↓ 30 callers
Method
RoutingErrors
()
pkg/jsplugin/registry.go:1008
↓ 30 callers
Function
routingTestPluginSource
(key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1207
↓ 30 callers
Function
useNodeSync
useNodeSync installs a database with the sync tables (TEST_TASK_DB_DIALECT selects it, see useProviderPluginDatabase) and an empty topic registry.
service/node_sync_test.go:22
↓ 29 callers
Method
StringContent
()
relaykit/dto/openai_request.go:696
↓ 29 callers
Method
Validate
()
relaykit/dto/channel_settings.go:485
↓ 29 callers
Method
Write
(data []byte)
relay/requestplugin/reply.go:831
↓ 29 callers
Function
advancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:1119
↓ 29 callers
Function
formatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:183
↓ 29 callers
Function
useStatus
()
web/src/hooks/use-status.ts:35
↓ 28 callers
Method
Close
()
common/body_storage.go:240
↓ 28 callers
Function
Compile
Compile performs upload-time syntax checks and compiles an ESM plugin once. All engine-specific module and runtime handling is intentionally kept here
pkg/jsplugin/engine.go:161
↓ 28 callers
Method
DoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:29
↓ 28 callers
Function
WithOpenAIError
(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:325
↓ 28 callers
Function
compileTaskRoutePlugin
(t *testing.T, source string)
middleware/task_plugin_test.go:1932
↓ 28 callers
Function
formatNumber
( value: number | null | undefined, locales?: Intl.LocalesArgument )
web/src/lib/format.ts:32
↓ 28 callers
Function
setupPlugins
(t *testing.T, instances string)
relay/requestplugin/requestplugin_test.go:74
↓ 27 callers
Function
ApiErrorMsg
(c *gin.Context, msg string)
common/gin.go:318
↓ 27 callers
Function
CreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:52
↓ 27 callers
Function
pluginProtocolTestDeps
()
controller/plugin_protocol_test.go:1509
↓ 26 callers
Method
BuildRequestBody
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:76
↓ 26 callers
Function
T
T translates a message key in the language the reader of the request stated
i18n/i18n.go:91
↓ 26 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:244
↓ 26 callers
Function
authResult
( request: Promise<{ data: { success: boolean; message?: string; code?: string; data?: T } }>, fallb
web/src/lib/secure-verification.ts:69
↓ 26 callers
Function
mustApplyReasoningModelSuffix
(t *testing.T, info *relaycommon.RelayInfo, outbound ...dto.Request)
relay/helper/reasoning_suffix_test.go:28
↓ 26 callers
Method
resolve
resolve reads a member of an object stream's dictionary as the library does: a reference reads the object it names from the file. A reference to an ob
relay/requestplugin/pdf.go:1174
↓ 25 callers
Method
Error
Error renders the English text, so a Message can be returned as an error and reach the web console through ApiError.
common/message.go:30
↓ 25 callers
Function
GetPasskeySettings
()
setting/system_setting/passkey.go:150
↓ 25 callers
Function
IOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 25 callers
Method
SetOtherSettings
(setting dto.ChannelOtherSettings)
model/channel.go:1246
↓ 25 callers
Function
alibabaObject
(t *testing.T, value any)
plugins/alibaba_responses_test.go:318
↓ 25 callers
Method
open
(_method: string, url: string)
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:185
← previous
next →
101–200 of 15,409, ranked by callers