MCPcopy Create free account

hub / github.com/QuantumNous/new-api / functions

Functions15,409 in github.com/QuantumNous/new-api

↓ 9 callersMethodJSONString
JSONString returns the complete stored representation, including all privileged scopes. API projections must use the role-specific formatter.
model/log_other.go:187
↓ 9 callersMethodJSValue
JSValue shares the request with hooks without copying it: the engine never writes JavaScript changes back into Go values, so the request must only sta
pkg/jsplugin/routing.go:350
↓ 9 callersFunctionNotifyAccountSecurityChange
NotifyAccountSecurityChange never includes credentials or tokens. The caller records delivery failure independently from the already-committed change.
service/account_security.go:47
↓ 9 callersFunctionPassThrough
PassThrough runs the attempt stages of a channel attempt whose upstream body no effect can change: the stored client body of a pass-through channel, o
relay/requestplugin/relay.go:400
↓ 9 callersFunctionPluginOfChannel
PluginOfChannel returns the plugin a task plugin channel is bound to. Its credential hooks serve the channel whatever parts the plugin has.
service/provider_plugin.go:50
↓ 9 callersMethodPlugins
()
pkg/jsplugin/routing.go:612
↓ 9 callersFunctionRecalculateTaskQuota
RecalculateTaskQuota 通用的异步差额结算。 actualQuota 是任务完成后的实际应扣额度,与预扣额度 (task.Quota) 做差额结算。 reason 写入日志内容(例如按 token 重算或 adaptor 调整)。 clamps 可选:若计算 actualQuota
service/task_billing.go:314
↓ 9 callersFunctionRecordConsumeLog
(c *gin.Context, userId int, params RecordConsumeLogParams)
model/log.go:340
↓ 9 callersMethodRecordError
(msg string)
relay/common/stream_status.go:87
↓ 9 callersFunctionRecordLog
(userId int, logType int, content *common.Message)
model/log.go:149
↓ 9 callersMethodRequest
Request parameter duration's unit is seconds
common/rate-limit.go:152
↓ 9 callersFunctionRevokeUserSession
(userID int, sid, reason string)
model/user_session.go:566
↓ 9 callersFunctionRouteTag
(tag string)
middleware/logger.go:14
↓ 9 callersMethodSetRequestPluginIngress
SetRequestPluginIngress keeps what the request's ingress stage did, which every channel attempt starts from.
relay/common/request_plugin.go:235
↓ 9 callersFunctionShouldPreserveThinkingSuffix
ShouldPreserveThinkingSuffix reports whether the full model name is exempt from host thinking-suffix and @-modifier parsing. Exact blacklist entries m
setting/model_setting/global.go:145
↓ 9 callersFunctionTaskErrorWrapper
TaskErrorWrapper masks the upstream addresses of the task channel in network errors; see common.MaskSensitiveInfo.
service/error.go:202
↓ 9 callersFunctionUpdateVideoTasks
UpdateVideoTasks 按渠道更新所有视频任务
service/task_polling.go:461
↓ 9 callersFunctionUserUsableGroups2JSONString
()
setting/user_usable_group.go:28
↓ 9 callersFunctionValidateSSRFProtectedFetchURL
(urlStr string)
service/http_client.go:71
↓ 9 callersMethodWrite
(b []byte)
middleware/audit.go:25
↓ 9 callersFunctionauthSigningKey
(purpose string)
service/auth_token.go:54
↓ 9 callersFunctioncalculateTextToolCallSurcharge
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, summary *textQuotaSummary)
service/text_quota.go:152
↓ 9 callersFunctioncallbackParams
(values url.Values)
service/provider_plugin_login_test.go:42
↓ 9 callersFunctionchannelMatchesExpectedTaskPlugin
(c *gin.Context, channel *model.Channel, expected string)
middleware/distributor.go:164
↓ 9 callersFunctioncompilePluginProtocolRetrieveEndpoint
(t *testing.T, key, source string, options pluginruntime.Options)
controller/plugin_protocol_test.go:1561
↓ 9 callersFunctioncreateScopedAccessToken
(t *testing.T, userID int, expiresAt int64, scopes ...string)
controller/access_token_audit_test.go:112
↓ 9 callersFunctioncredentialLine
(t *testing.T, credential jsplugin.Credential)
service/provider_plugin_test.go:292
↓ 9 callersFunctiondecodeLocalizedText
decodeLocalizedText reads a string or locale object as LocalizedText; subject names it in errors.
pkg/jsplugin/registry.go:2531
↓ 9 callersFunctiondefaultHTTPTransportPolicy
()
service/http_transport_policy.go:24
↓ 9 callersFunctioneffectiveBillingUsage
(usage *dto.Usage)
service/billing_usage.go:19
↓ 9 callersFunctionflattenBinary
( node: ExpressionNode, operator: string )
web/src/features/pricing/lib/billing-expression/display.ts:49
↓ 9 callersFunctionformatLogQuota
(quota: number)
web/src/lib/format.ts:253
↓ 9 callersFunctionformatPricingNumber
(value: unknown)
web/src/features/system-settings/models/pricing-format.ts:55
↓ 9 callersFunctiongetUserAuthFenceKey
Fence and version keys use the user cache key as their hash tag so the cache fill script and the floor MGET stay in one slot on sharded Redis.
model/user_auth_cache.go:29
↓ 9 callersFunctionintPtr
(v int)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:314
↓ 9 callersFunctionintegerValue
(value any)
pkg/jsplugin/provider.go:1750
↓ 9 callersFunctionnewAuthzTestDB
(t *testing.T)
service/authz/authz_test.go:14
↓ 9 callersFunctionnewDoubaoPlugin
(t *testing.T)
plugins/doubao_responses_test.go:59
↓ 9 callersFunctionnewPluginProtocolRetrieveContext
(responseID string)
controller/plugin_protocol_test.go:1577
↓ 9 callersFunctionnewTestResponsesStreamState
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:578
↓ 9 callersFunctionperformRateLimitRequest
(router http.Handler, path string, remoteAddr string)
middleware/rate_limit_test.go:43
↓ 9 callersFunctionplainObject
(value)
plugins/tasks/kling/plugin.js:285
↓ 9 callersFunctionpluginProtocolRetrieveDeps
(pinned pluginruntime.PinnedEndpoint, task *model.Task, exists bool, err error)
controller/plugin_protocol_test.go:1587
↓ 9 callersFunctionprocessHeaderOverride
processHeaderOverride applies channel header overrides, with placeholder substitution. Supported placeholders: - {api_key}: resolved to the channel AP
relay/channel/api_request.go:197
↓ 9 callersFunctionrawJSON
(value any)
relaykit/relayconvert/internal/toolconv/decode.go:923
↓ 9 callersFunctionreceive
(t *testing.T, received chan serviceRequest)
relay/requestplugin/requestplugin_test.go:711
↓ 9 callersMethodreset
()
router/provider_plugin_relay_test.go:94
↓ 9 callersFunctionroutingProtocolExport
(name string)
pkg/jsplugin/routing_test.go:1232
↓ 9 callersFunctionrun
( raceAttempt: number, allowMismatchRetry: boolean )
web/src/lib/auth-session.ts:218
↓ 9 callersFunctionrunScheduledPlugin
runScheduledPlugin calls the hook without channel locks. Its result is applied only while the prepared key still matches the stored key.
service/provider_plugin_scheduled.go:260
↓ 9 callersFunctionsafeJsonParse
( value: string | undefined | null, options: SafeJsonParseOptions<T> = {} )
web/src/features/system-settings/utils/json-parser.ts:113
↓ 9 callersFunctionsetupOriginTaskDB
(t *testing.T)
middleware/task_plugin_origin_task_test.go:26
↓ 9 callersFunctionsetupSub2APIBalanceTest
setupSub2APIBalanceTest wires an in-memory SQLite DB into model.DB so Channel.UpdateBalance can persist, mirroring the pattern used by other controlle
controller/channel_billing_sub2api_test.go:20
↓ 9 callersFunctionsetupTelegramOAuthTest
(t *testing.T)
controller/telegram_test.go:60
↓ 9 callersFunctionsetupTokenControllerTestDB
(t *testing.T)
controller/token_test.go:115
↓ 9 callersMethodstop
()
web/src/components/ai-elements/prompt-input.tsx:1052
↓ 9 callersFunctionsubmitAlibabaRequest
Exercise the production host's usage validation as well as the converter, without sending a paid generation request or needing a database.
plugins/alibaba_responses_test.go:329
↓ 9 callersFunctiontrimmed
(value)
plugins/tasks/xai/plugin.js:132
↓ 9 callersFunctionupdate
()
web/src/lib/theme-color.ts:55
↓ 9 callersFunctionuseApiKeys
()
web/src/features/keys/components/api-keys-provider.tsx:182
↓ 9 callersFunctionuseCredentialTestDB
useCredentialTestDB points model.DB at a new in-memory SQLite database holding models.
relay/channel/task/jsplugin/credential_test.go:134
↓ 9 callersFunctionuseModels
()
web/src/features/models/components/models-provider.tsx:125
↓ 9 callersFunctionvalidateChannel
validateChannel 通用的渠道校验函数
controller/channel.go:580
↓ 9 callersFunctionwriteAuthSessionError
(c *gin.Context, err error)
controller/auth_session.go:164
↓ 8 callersMethodAdjustBillingOnSubmit
AdjustBillingOnSubmit returns adjusted OtherRatios from the upstream submit response. Called after a successful ParseResponse. If the upstream returne
relay/channel/adapter.go:63
↓ 8 callersMethodApplyTick
ApplyTick maps bounded plugin semantics onto host-owned Responses events. taskStatus is the current durable DB status (for example, IN_PROGRESS, SUCCE
relay/plugin_protocol.go:443
↓ 8 callersMethodBeginAttempt
(channel *model.Channel, group string)
service/request_policy.go:89
↓ 8 callersMethodCallPathWithMemberJSON
CallPathWithMemberJSON is CallPathWithAdmissionTimeout that also returns the result's member as the text JSON.stringify writes for it, which keeps the
pkg/jsplugin/engine.go:401
↓ 8 callersFunctionChannelSatisfiesFilters
ChannelSatisfiesFilters reports whether ch passes every filter. On false, it returns the first violated filter in filterEvalOrder for error attributio
model/channel_constraint.go:21
↓ 8 callersMethodClose
()
relay/channel/openai/image_stream_test.go:275
↓ 8 callersFunctionCompileFromCache
CompileFromCache compiles an expression string, using a cached program when available. The cache is keyed by the SHA-256 hex digest of the expression.
pkg/billingexpr/compile.go:171
↓ 8 callersFunctionComputeTieredQuotaWithRequest
(snap *BillingSnapshot, params TokenParams, request RequestInput)
pkg/billingexpr/settle.go:28
↓ 8 callersMethodConvOptions
ConvOptions returns the request-scoped conversion options snapshot. Must never return nil.
relaykit/relayconvert/convmeta/meta.go:64
↓ 8 callersFunctionCount
Count returns the token count of text for model. GPT and o-series models are counted with their tiktoken encoding; other models use Estimate.
tokenkit/tokenizer.go:27
↓ 8 callersFunctionCreateBodyStorage
CreateBodyStorage stores data in memory or on disk according to cache settings. It takes ownership of data; callers must keep its backing array immuta
common/body_storage.go:313
↓ 8 callersMethodCreatedEvent
()
relay/plugin_protocol.go:429
↓ 8 callersMethodDeadline
Deadline returns the write deadline for n more bytes written at now.
relay/helper/stream_scanner.go:89
↓ 8 callersFunctionDecideRelayRetry
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
↓ 8 callersFunctionDecreaseUserQuota
(id int, quota int, db bool)
model/user.go:1387
↓ 8 callersFunctionDisableChannel
disable & notify
service/channel.go:30
↓ 8 callersMethodError
()
relay/requestplugin/socket.go:378
↓ 8 callersMethodEvents
()
service/request_policy.go:83
↓ 8 callersMethodExport
Export returns one module export without exposing engine values outside the engine boundary. It is used for declarative exports such as meta.
pkg/jsplugin/engine.go:219
↓ 8 callersMethodFields
Fields returns the response fields the web console translates. Callers put the English text in the field their response shape already uses.
common/message.go:44
↓ 8 callersMethodFinalResponse
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
↓ 8 callersFunctionFormatClaudeResponseInfo
(claudeResponse *dto.ClaudeResponse, oaiResponse *dto.ChatCompletionsStreamResponse, claudeInfo *ClaudeRespons
relay/channel/claude/relay-claude.go:85
↓ 8 callersFunctionGetAuditLogs
(filter AuditLogFilter, start, limit, viewerRole int)
model/audit_log.go:139
↓ 8 callersFunctionGetClaudeSettings
GetClaudeSettings 获取Claude配置
setting/model_setting/claude.go:45
↓ 8 callersFunctionGetContextKey
(c *gin.Context, key constant.ContextKey)
common/gin.go:182
↓ 8 callersFunctionGetGroupRatioCopy
()
setting/ratio_setting/group_ratio.go:62
↓ 8 callersMethodGetHeaderOverride
()
model/channel.go:1266
↓ 8 callersFunctionGetHttpClientWithProxy
GetHttpClientWithProxy returns the default client or a cached proxy-enabled client.
service/http_client.go:393
↓ 8 callersFunctionGetInstances
GetInstances returns the instance list in option order. The list is shared and must not be changed.
setting/request_plugin_setting/config.go:66
↓ 8 callersFunctionGetModelRatio
(name string)
setting/ratio_setting/model_ratio.go:385
↓ 8 callersFunctionGetMonitorSetting
()
setting/operation_setting/monitor_setting.go:41
↓ 8 callersFunctionGetOIDCSettings
()
setting/system_setting/oidc.go:28
↓ 8 callersFunctionGetQuotaSetting
()
setting/operation_setting/quota_setting.go:29
↓ 8 callersMethodGetTokenCountMeta
()
relaykit/dto/request_common.go:9
↓ 8 callersFunctionGetTopUpByTradeNo
(tradeNo string)
model/topup.go:136
↓ 8 callersMethodGetUpstreamModelName
()
relaykit/relayconvert/convmeta/meta.go:22
← previousnext →701–800 of 15,409, ranked by callers