MCPcopy Create free account

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

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

↓ 4 callersMethodImageCount
ImageCount resolves the validated request quantity. Top-level zero retains its legacy default of one; an explicit provider count must be positive.
relaykit/dto/openai_image.go:60
↓ 4 callersFunctionImageHelper
(c *gin.Context, info *relaycommon.RelayInfo)
relay/image_handler.go:32
↓ 4 callersMethodIncrSendResponseCount
()
relaykit/relayconvert/convmeta/meta.go:57
↓ 4 callersFunctionIncrementDiskFiles
IncrementDiskFiles 增加磁盘文件计数
common/disk_cache_config.go:109
↓ 4 callersMethodInit
(info *relaycommon.RelayInfo)
relay/channel/aws/adaptor.go:83
↓ 4 callersFunctionInitTask
(platform constant.TaskPlatform, relayInfo *commonRelay.RelayInfo)
model/task.go:272
↓ 4 callersFunctionInjectTieredBillingInfo
InjectTieredBillingInfo overlays tiered billing fields onto an existing module-specific other map. Call this after GenerateTextOtherInfo / GenerateCla
service/log_info_generate.go:350
↓ 4 callersMethodInsert
()
model/model_meta.go:236
↓ 4 callersMethodInsert
(inviterId int)
model/user.go:675
↓ 4 callersMethodInsert
()
model/token.go:307
↓ 4 callersFunctionInvalidateSubscriptionPlanCache
InvalidateSubscriptionPlanCache drops a plan written on this node from the cache and tells the other nodes to drop their copies.
model/subscription.go:137
↓ 4 callersFunctionIsAlwaysSkipRetryStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:70
↓ 4 callersMethodIsCustomTool
IsCustomTool reports whether name was encoded from a Responses custom tool.
relaykit/relayconvert/convmeta/meta.go:126
↓ 4 callersFunctionIsDiskCacheEnabled
IsDiskCacheEnabled 是否启用磁盘缓存
common/disk_cache_config.go:44
↓ 4 callersMethodIsEnabled
IsEnabled returns whether this OAuth provider is enabled
oauth/provider.go:16
↓ 4 callersFunctionIsQwenThinkingBudgetModel
(modelName string)
relaykit/dto/openai_request.go:398
↓ 4 callersFunctionIsRequestBodyTooLargeError
(err error)
common/gin.go:29
↓ 4 callersMethodIsStream
(c *http.Request)
relaykit/dto/request_common.go:10
↓ 4 callersMethodIsToolCall
()
relaykit/dto/openai_response.go:164
↓ 4 callersFunctionLegacyAccessTokenRetireAt
()
model/user_access_token.go:322
↓ 4 callersFunctionListSystemInstances
()
model/system_instance.go:72
↓ 4 callersFunctionLocalLogPreview
LocalLogPreview limits log-only content unless debug logging is enabled.
common/str.go:20
↓ 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 /v1/models relay route, with the converter as the manifest declares it.
pluginkit/meta.go:353
↓ 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:302
↓ 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 callersFunctionNormalizeRouteMethod
NormalizeRouteMethod returns the canonical spelling of a plugin route method, rejecting methods routes may not use.
pluginkit/routing.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 callersMethodPluginsByModel
PluginsByModel returns all plugins declaring model, in ascending key order.
pkg/jsplugin/routing.go:162
↓ 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 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 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
pluginkit/meta.go:316
↓ 4 callersMethodReplaceOtherRatios
(ratios map[string]float64)
types/price_data.go:54
↓ 4 callersFunctionResetUserPasswordByEmail
(email string, password string)
model/user.go:1204
↓ 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:1628
↓ 4 callersFunctionResponseGeminiChat2OpenAI
(id string, created int64, response *dto.GeminiChatResponse)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go:81
↓ 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:262
↓ 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:304
↓ 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 callersFunctionSetDashboardRouter
(router *gin.Engine)
router/dashboard.go:10
↓ 4 callersMethodSetIndex
set index
relaykit/dto/claude.go:632
↓ 4 callersMethodSetMediaContent
(content []MediaContent)
relaykit/dto/openai_request.go:732
↓ 4 callersMethodSetMessage
(message string)
relaykit/types/error.go:181
↓ 4 callersMethodSetRoot
(key string, value any)
model/log_other.go:111
↓ 4 callersFunctionSettleBilling
--------------------------------------------------------------------------- SettleBilling — 后结算辅助函数 --------------------------------------------------
service/billing.go:65
↓ 4 callersMethodSetupRequestHeader
(c *gin.Context, header *http.Header, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:267
↓ 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 callersFunctionShouldDisableChannel
(err *types.NewAPIError)
service/channel.go:65
↓ 4 callersMethodShouldPreserveThinkingSuffix
(modelName string)
relaykit/relayconvert/convmeta/options.go:119
↓ 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 callersFunctionStreamResponseGeminiChat2OpenAI
(geminiResponse *dto.GeminiChatResponse)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go:193
↓ 4 callersMethodSupportsJSONSchemaModel
(modelName string)
relaykit/relayconvert/convmeta/options.go:108
↓ 4 callersFunctionSystemPerformanceCheck
SystemPerformanceCheck 检查系统性能中间件
middleware/performance.go:14
↓ 4 callersMethodToOpenAIVideo
()
model/task.go:678
↓ 4 callersFunctionTokenAuthReadOnly
TokenAuthReadOnly 宽松版本的令牌认证中间件,用于只读查询接口。 只验证令牌 key 是否存在,不检查过期时间和额度。 即使令牌已过期或已耗尽,也允许访问;已禁用的令牌会被拒绝。 仍然检查令牌 IP 白名单和用户是否被封禁。
middleware/auth.go:459
↓ 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:589
↓ 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:1460
↓ 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
← previousnext →1,701–1,800 of 15,592, ranked by callers