MCPcopy Create free account

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

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

↓ 4 callersFunctionLookupResponseConverter
(converter string)
relaykit/relayconvert/response_registry.go:219
↓ 4 callersFunctionMapToJsonStr
(m map[string]any)
common/str.go:41
↓ 4 callersFunctionMergeBillingUsageNonZero
MergeBillingUsageNonZero preserves non-zero provider-native fields across partial stream snapshots. A snapshot from a different billing dialect remain
relaykit/dto/usage_merge.go:101
↓ 4 callersFunctionMergeExplicit
MergeExplicit combines two structured representations of the same request. primary wins wherever they disagree; callers pass the more specific represe
relaykit/relayconvert/reasoning/intent.go:290
↓ 4 callersFunctionMetadataRecordVersion
(local *Model, localVendor, upstreamVendor *Vendor)
model/model_metadata_sync.go:74
↓ 4 callersMethodModelListRoute
ModelListRoute returns the explicitly configured OpenAI Models discovery route. Template routes that merely happen to match /v1/models are not discove
relaykit/dto/channel_settings.go:296
↓ 4 callersFunctionNewChannelSortOptions
(sortBy string, sortOrder string, idSort bool)
model/channel.go:97
↓ 4 callersFunctionNewOutboundJSONBody
NewOutboundJSONBody wraps the already-marshaled upstream request body into a BodyStorage. When disk cache is enabled and the payload exceeds the confi
relay/common/outbound_body.go:26
↓ 4 callersFunctionNewURLFileSource
--------------------------------------------------------------------------- Constructors -------------------------------------------------------------
relaykit/types/file_source.go:123
↓ 4 callersFunctionNormalizeResetPeriod
(period string)
model/subscription.go:347
↓ 4 callersFunctionNormalizeTaskAction
NormalizeTaskAction maps persisted legacy action names to the canonical task action vocabulary. Unknown platform-specific actions pass through unchang
constant/task.go:32
↓ 4 callersFunctionObserveChannelAffinityUsageCacheByRelayFormat
ObserveChannelAffinityUsageCacheByRelayFormat records usage cache stats with a stable rate mode derived from relay format.
service/channel_affinity.go:797
↓ 4 callersMethodOtherRatioMultiplier
()
types/price_data.go:83
↓ 4 callersMethodParseBatchResult
(tasks []*model.Task, resp *http.Response, body []byte)
service/task_polling.go:42
↓ 4 callersFunctionParseGeminiModelSuffix
ParseGeminiModelSuffix is the gemini-* counterpart of ParseClaudeModelSuffix and honours allowSuffixAlias the same way.
relaykit/relayconvert/reasoning/suffix.go:180
↓ 4 callersMethodParseInput
()
relaykit/dto/embedding.go:79
↓ 4 callersFunctionParseOpenAIReasoningEffortFromModelSuffix
ParseOpenAIReasoningEffortFromModelSuffix applies RelayKit's positive family whitelist and the host EffortTailModelIDs escape hatch so real model IDs
setting/reasoning/suffix.go:28
↓ 4 callersMethodPath
Path is the diagnostic path of the definition in the source tool list.
relaykit/relayconvert/convmeta/websearch.go:83
↓ 4 callersFunctionPluginCredentialViews
PluginCredentialViews lists the credential lines of a channel without their secrets; a static key line has no label or account.
service/provider_plugin_login.go:285
↓ 4 callersFunctionPluginRouteBindings
PluginRouteBindings returns the addresses plugin serves: each declared route and, unless the route lives under the plugin's own prefix, its /{key} cop
pkg/jsplugin/routing.go:995
↓ 4 callersMethodPluginsByModel
PluginsByModel returns all plugins declaring model, in ascending key order.
pkg/jsplugin/routing.go:528
↓ 4 callersFunctionPostAudioConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent []*common.Message)
service/quota.go:294
↓ 4 callersFunctionPreviewModelPricingConversion
(name string, draft PricingValues)
model/model_pricing_conversion.go:195
↓ 4 callersMethodProcessEvent
(event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:684
↓ 4 callersMethodProviderUserIDColumn
ProviderUserIDColumn returns the users-table column that stores this provider's user ID, used by bind flows to update only the binding column instead
oauth/provider.go:41
↓ 4 callersFunctionQuotaRoundChecked
QuotaRoundChecked is QuotaRound but also returns a non-nil *QuotaClamp when the value was clamped, so billing callers can audit it.
common/quota_math.go:140
↓ 4 callersFunctionReasoningStateOf
ReasoningStateOf is a nil-safe reader for Meta.ReasoningState.
relaykit/relayconvert/convmeta/meta.go:331
↓ 4 callersFunctionRecordPolicyFailure
RecordPolicyFailure appends the failed attempt and the retry decision made for it. The health entry mirrors the check in ProcessChannelError, which pe
service/request_policy.go:100
↓ 4 callersFunctionRedeem
(key string, userId int)
model/redemption.go:136
↓ 4 callersFunctionRedisHGetObj
(key string, obj any)
common/redis.go:161
↓ 4 callersFunctionRefreshLoginSession
(rawRefreshToken, expectedSID, ip, userAgent string)
service/auth_session.go:234
↓ 4 callersMethodRefund
Refund 退还所有预扣费额度(资金来源 + 令牌),幂等安全。 通过 gopool 异步执行。如果已经结算或退款则不做任何操作。
relay/common/billing.go:14
↓ 4 callersFunctionRefundMidjourneyQuota
RefundMidjourneyQuota reverses every accounting element recorded for a billed legacy task.
service/midjourney.go:96
↓ 4 callersFunctionRegisterCustom
RegisterCustom registers a custom OAuth provider (can be unregistered later)
oauth/registry.go:31
↓ 4 callersMethodRelayConfig
RelayConfig returns the relay routes as the Advanced Custom configuration of one request. A plugin-converter route reaches the Advanced Custom code as
pkg/jsplugin/registry.go:179
↓ 4 callersFunctionRelayTaskPluginEndpoint
RelayTaskPluginEndpoint keeps unclaimed shared-endpoint traffic on its existing handler while claimed requests enter the generation-pinned host-owned
controller/relay.go:491
↓ 4 callersMethodRelaysModel
RelaysModel reports whether a relay route accepts model for client requests: the plugin serves the model on chat paths, not only as a task. The model
pkg/jsplugin/registry.go:237
↓ 4 callersMethodReplaceOtherRatios
(ratios map[string]float64)
types/price_data.go:54
↓ 4 callersFunctionResetUserPasswordByEmail
(email string, password string)
model/user.go:1188
↓ 4 callersFunctionResolveCacheWriteMode
ResolveCacheWriteMode describes display and migration only. A generic engine fallback is not configured cache-write pricing. Only Claude names inherit
model/model_pricing_conversion.go:137
↓ 4 callersFunctionResolveHeaderOverride
(info *common.RelayInfo, c *gin.Context)
relay/channel/api_request.go:296
↓ 4 callersFunctionRespondTaskPluginError
RespondTaskPluginError gives a pinned plugin a sanitized error DTO and writes its native error body with the host's status, unless the body is a reply
middleware/task_plugin.go:1635
↓ 4 callersFunctionResponsesFinishReasonFromStatus
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:39
↓ 4 callersFunctionResponsesStreamEventToChatChunks
(event *dto.ResponsesStreamResponse, state *ResponsesToChatStreamState)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:85
↓ 4 callersMethodResponsesToolName
ResponsesToolName restores the Responses namespace and tool name of an upstream function name. Names that were not flattened from a namespace return a
relaykit/relayconvert/convmeta/meta.go:137
↓ 4 callersFunctionRevokeDeletedChannelCredentials
RevokeDeletedChannelCredentials revokes the plugin credentials of deleted task plugin channels, in the background.
service/provider_plugin.go:706
↓ 4 callersFunctionRevokePluginCredentials
RevokePluginCredentials calls the plugin's revoke for each removed credential line of the plugin, in the background. It never blocks the removal and o
service/provider_plugin.go:540
↓ 4 callersMethodRouteGroups
RouteGroups returns the inner router's registrations: one per method and path shape, without the skipped routes.
pkg/jsplugin/routing.go:628
↓ 4 callersFunctionRunExprByHashWithRequest
(exprStr, hash string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:45
↓ 4 callersFunctionSelectChannelForRequest
SelectChannelForRequest resolves the channel for one attempt with the rules shared by the HTTP distributor and the Responses WebSocket relay: a pinned
service/channel_select.go:308
↓ 4 callersFunctionSessionCookieOriginGuard
SessionCookieOriginGuard protects cookie-authenticated refresh/logout endpoints when secure cookie mode is enabled. In insecure local development mode
middleware/auth_origin.go:18
↓ 4 callersMethodSetAccessToken
Deprecated: 旧版面板访问令牌,仅在升级后的过渡期内使用;删除 users.access_token 列时一并移除。
model/user.go:142
↓ 4 callersFunctionSetApiRouter
(router *gin.Engine)
router/api-router.go:17
↓ 4 callersMethodSetIndex
set index
relaykit/dto/claude.go:632
↓ 4 callersMethodSetMediaContent
(content []MediaContent)
relaykit/dto/openai_request.go:729
↓ 4 callersMethodSetMessage
(message string)
relaykit/types/error.go:181
↓ 4 callersMethodSetRoot
(key string, value any)
model/log_other.go:111
↓ 4 callersFunctionSetTaskRouter
SetTaskRouter registers the generic task-plugin API surface. Gin requires every route sharing a path position to use the same wildcard name, so the f
router/task-router.go:14
↓ 4 callersFunctionSettleBilling
--------------------------------------------------------------------------- SettleBilling — 后结算辅助函数 --------------------------------------------------
service/billing.go:65
↓ 4 callersFunctionShouldCopyUpstreamHeader
ShouldCopyUpstreamHeader checks whether a given upstream response header should be copied to the client response. It returns false for Content-Length
service/http.go:31
↓ 4 callersMethodShouldPreserveThinkingSuffix
(modelName string)
relaykit/relayconvert/convmeta/options.go:119
↓ 4 callersFunctionSplitProviderConverter
SplitProviderConverter returns the converter the host runs for a route converter and whether the plugin's convert hooks run too: "plugin" is "none" wi
pkg/jsplugin/registry.go:153
↓ 4 callersFunctionStopped
Stopped reports a task error a request plugin's rejection or failure caused; it is neither retried nor hidden from the client.
relay/requestplugin/relay.go:214
↓ 4 callersMethodSupportsJSONSchemaModel
(modelName string)
relaykit/relayconvert/convmeta/options.go:108
↓ 4 callersFunctionSystemPerformanceCheck
SystemPerformanceCheck 检查系统性能中间件
middleware/performance.go:14
↓ 4 callersMethodToOpenAIVideo
()
model/task.go:677
↓ 4 callersFunctionTokenModelLimitAllows
TokenModelLimitAllows reports whether a token model-limit map authorizes model. Exact name, wildcard-normalized name, and routing-normalized name (mod
middleware/distributor.go:586
↓ 4 callersFunctionTrimEffortSuffixWithSuffixes
(modelName string, suffixes []string)
relaykit/relayconvert/reasoning/suffix.go:114
↓ 4 callersFunctionTryReserveTokenQuota
TryReserveTokenQuota atomically checks and deducts a token quota. Unlimited tokens skip the balance check but still update remain/used accounting.
model/quota_reserve.go:202
↓ 4 callersFunctionUnregisterCustomProvider
UnregisterCustomProvider unregisters a custom provider by slug
oauth/registry.go:158
↓ 4 callersMethodUpdateImageCount
UpdateImageCount replaces the billable quantity without changing the frozen request parameters or multiplying the legacy and expression prices togethe
relay/common/relay_info.go:255
↓ 4 callersFunctionUpdateUserSetting
(userId int, setting dto.UserSetting)
model/user.go:185
↓ 4 callersFunctionUpdateUserUsedQuota
UpdateUserUsedQuota adjusts accumulated usage without changing request count.
model/user.go:1444
↓ 4 callersFunctionUsageFromResponsesUsage
(src *dto.Usage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:183
↓ 4 callersFunctionUsesFixedPricingByHash
UsesFixedPricingByHash avoids hashing an expression already in a snapshot.
pkg/billingexpr/fixed.go:17
↓ 4 callersFunctionValidateAccountEmail
ValidateAccountEmail is shared with registration mail delivery so binding cannot bypass the site's existing domain, alias and address-length rules.
service/email_binding.go:36
↓ 4 callersFunctionValidateMetadataValues
(values MetadataValues)
model/model_metadata_sync.go:99
↓ 4 callersFunctionValidateNumericCode
ValidateNumericCode 验证数字验证码格式
common/totp.go:129
↓ 4 callersFunctionVendorRecordVersion
(v *Vendor)
model/vendor_management.go:73
↓ 4 callersFunctionVerifyTaskArtifactAccess
VerifyTaskArtifactAccess verifies the route binding without reading task, user, or token state. Signature comparison is constant-time.
service/task_artifact_access.go:48
↓ 4 callersFunctionWaffoPancakeBuyerIdentityFromUserID
WaffoPancakeBuyerIdentityFromUserID renders the canonical buyer identity for checkout. Webhook handlers compare against the value rendered here to rej
service/waffo_pancake.go:161
↓ 4 callersMethodWriteContext
(c *gin.Context)
model/user_cache.go:41
↓ 4 callersFunctionabortTaskPluginRouteErrorDetail
(c *gin.Context, status int, detail string)
middleware/task_plugin.go:1706
↓ 4 callersFunctionabortWithWebMessage
abortWithWebMessage answers a web console request; the web console translates the message, and code, when set, stays a stable error code.
middleware/auth.go:376
↓ 4 callersFunctionactiveRules
(config)
plugins/tasks/request-redact/plugin.js:330
↓ 4 callersMethodadmit
admit reserves size bytes for a request, or drops it when the queue is full.
relay/requestplugin/report.go:467
↓ 4 callersFunctionappendRequestPluginRecord
appendRequestPluginRecord shows users what the request plugins changed in their request. A retry rewrites the attempt's entries in place, so the log k
service/log_info_generate.go:163
↓ 4 callersFunctionappendSeparatedText
(builder *strings.Builder, text string)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:314
↓ 4 callersFunctionapplyAuthBundle
( bundle: AuthBundle, synchronizeTabs = true )
web/src/lib/auth-session.ts:150
↓ 4 callersFunctionapplyAuthFlowMatch
(query *gorm.DB, token string, match AuthFlowMatch)
model/auth_flow.go:127
↓ 4 callersMethodapplyCompletionUsageFacts
(result *relaycommon.TaskInfo, facts any, models ...string)
relay/channel/task/jsplugin/adaptor.go:1178
↓ 4 callersFunctionapplyEffects
applyEffects applies a result's effects to body and headers through the host's own decoder, so every effect also passes the host's checks.
plugins/request_plugins_test.go:53
↓ 4 callersFunctionapplyOriginTaskIntent
(c *gin.Context, intent map[string]any, meta pluginruntime.Meta)
middleware/task_plugin.go:1335
↓ 4 callersFunctionapplyRechargeRate
* Apply recharge rate to price * * priceRate represents how much users need to recharge (in the display currency) * to get 1 USD credit. usdExchang
web/src/features/pricing/lib/price.ts:131
↓ 4 callersFunctionapplyTaskCredential
applyTaskCredential puts a credential's headers and query on a task request.
relay/channel/task/jsplugin/credential.go:103
↓ 4 callersMethodapplyUpstreamCredentials
applyUpstreamCredentials sets ctx.upstream together with the credentials every driver hook reads. A New API channel (type 60) is another gateway: the
relay/channel/task/jsplugin/adaptor.go:1545
↓ 4 callersFunctionapplyWebSocketSubprotocolAuthorization
(header http.Header)
middleware/auth.go:649
↓ 4 callersFunctionarrayIndex
arrayIndex reads an RFC 6901 array index: digits without a leading zero.
pkg/requestpatch/patch.go:573
↓ 4 callersFunctionartifactData
(ctx)
plugins/tasks/alibaba/plugin.js:1289
↓ 4 callersFunctionartifactData
(ctx)
plugins/tasks/doubao/plugin.js:984
← previousnext →1,701–1,800 of 15,409, ranked by callers