MCPcopy Create free account

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

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

↓ 9 callersFunctionEffectiveEffort
(intent Intent)
relaykit/relayconvert/reasoning/intent.go:654
↓ 9 callersMethodEnsureClaudeConvertInfo
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 callersFunctionEnsureLegacyAccessTokenRetireAt
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 callersMethodEvents
()
service/request_policy.go:84
↓ 9 callersFunctionFormatClaudeResponseInfo
(claudeResponse *dto.ClaudeResponse, oaiResponse *dto.ChatCompletionsStreamResponse, claudeInfo *ClaudeRespons
relay/channel/claude/relay-claude.go:85
↓ 9 callersFunctionGenerateHMACWithKey
(key []byte, data string)
common/crypto.go:12
↓ 9 callersFunctionGetByTaskId
(userId int, taskId string)
model/task.go:472
↓ 9 callersFunctionGetContextKeyType
(c *gin.Context, key constant.ContextKey)
common/gin.go:267
↓ 9 callersFunctionGetJsonString
(data any)
common/str.go:100
↓ 9 callersMethodGetMaxTokens
()
relaykit/dto/openai_request.go:470
↓ 9 callersFunctionGetModelRatioCopy
()
setting/ratio_setting/model_ratio.go:684
↓ 9 callersMethodGetScopes
GetScopes returns the stored scope list; a malformed value grants nothing.
model/user_access_token.go:59
↓ 9 callersFunctionGetTaskPluginDisabledFactoryKeys
()
setting/task_plugin.go:101
↓ 9 callersFunctionGetVerificationRequirements
(identity AuthIdentity, scope string)
service/security_verification.go:367
↓ 9 callersFunctionInitSessionCookieSettings
()
common/session_cookie.go:44
↓ 9 callersFunctionIsPaymentComplianceConfirmed
()
setting/operation_setting/payment_setting.go:55
↓ 9 callersFunctionIssueAccessToken
(identity AuthIdentity)
service/auth_token.go:60
↓ 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
pluginkit/routing.go:269
↓ 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 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 callersFunctionRoutingMatchModelName
RoutingMatchModelName returns the name used for channel-ability and token-limit fallback matching: strip @ modifiers and legacy aliases first, then ap
setting/ratio_setting/model_ratio.go:711
↓ 9 callersMethodSetRequestPluginIngress
SetRequestPluginIngress keeps what the request's ingress stage did, which every channel attempt starts from.
relay/common/request_plugin.go:235
↓ 9 callersFunctionSetTaskPluginProtocolRouter
(router *gin.Engine)
router/task-plugin-protocol-router.go:13
↓ 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 callersFunctionValidateSSRFProtectedFetchURL
(urlStr string)
service/http_client.go:71
↓ 9 callersFunctionWithFetcher
WithFetcher makes utils.fetch available to the hook called with ctx.
pluginkit/fetch.go:70
↓ 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 callersFunctioncompilePluginProtocolRetrieveEndpoint
(t *testing.T, key, source string, options pluginruntime.Options)
controller/plugin_protocol_test.go:1565
↓ 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.
pluginkit/meta.go:2133
↓ 9 callersFunctiondefaultHTTPTransportPolicy
()
service/http_transport_policy.go:24
↓ 9 callersFunctioneffectiveBillingUsage
(usage *dto.Usage)
service/billing_usage.go:19
↓ 9 callersFunctionfindMarketplaceVersion
( plugin: MarketplacePlugin, version: string )
web/src/features/task-plugins/lib/marketplace.ts:369
↓ 9 callersFunctionflattenBinary
( node: ExpressionNode, operator: string )
web/src/features/pricing/lib/billing-expression/display.ts:49
↓ 9 callersFunctionformatBillingCondition
( source: string, t: Translate, locale = 'en' )
web/src/features/pricing/lib/billing-expression/condition-display.ts:243
↓ 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 callersFunctionhostConfig
()
pluginkit/host.go:115
↓ 9 callersFunctionintPtr
(v int)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:314
↓ 9 callersFunctionintegerValue
(value any)
pluginkit/provider.go:1734
↓ 9 callersFunctionnewAuthzTestDB
(t *testing.T)
service/authz/authz_test.go:14
↓ 9 callersFunctionnewConvertRequestFailedError
(c *gin.Context, info *relaycommon.RelayInfo, err error)
relay/convert_request_error.go:13
↓ 9 callersFunctionnewDoubaoPlugin
(t *testing.T)
plugins/doubao_responses_test.go:59
↓ 9 callersFunctionnewPluginProtocolRetrieveContext
(responseID string)
controller/plugin_protocol_test.go:1581
↓ 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:1591
↓ 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:792
↓ 9 callersMethodreset
()
router/provider_plugin_relay_test.go:94
↓ 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 callersFunctionsetupDashboardAuthMiddlewareTest
(t *testing.T)
middleware/auth_test.go:27
↓ 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 callersFunctionstop
()
web/src/features/playground/hooks/use-stream-request.ts:177
↓ 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:126
↓ 9 callersFunctionvalidateChannel
validateChannel 通用的渠道校验函数
controller/channel.go:584
↓ 9 callersFunctionwriteAuthSessionError
(c *gin.Context, err error)
controller/auth_session.go:164
↓ 8 callersMethodAddAbilities
(tx *gorm.DB)
model/ability.go:237
↓ 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:90
↓ 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 callersFunctionConvertStreamResponseChunk
(c context.Context, info convmeta.Meta, state *ResponseStreamState, response any)
relaykit/relayconvert/response_registry.go:326
↓ 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 callersFunctionDecreaseUserQuota
(id int, quota int, db bool)
model/user.go:1403
← previousnext →701–800 of 15,592, ranked by callers