MCPcopy Create free account

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

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

↓ 2 callersMethodPush
(target string, options *http.PushOptions)
router/plugin-router.go:591
↓ 2 callersFunctionQueryBalance
QueryBalance queries a channel's balance with the plugin's buildBalanceRequest and parseBalance, which may chain more requests. A request's path joins
relay/channel/providerplugin/management.go:160
↓ 2 callersFunctionQuerySummaryAll
(hours int, groups []string, recentModels ...string)
pkg/perf_metrics/metrics.go:212
↓ 2 callersFunctionQuotaFromFloat
QuotaFromFloat converts a computed quota value to int, truncating toward zero, with saturation. Use for float products of prices, ratios, and user-con
common/quota_math.go:112
↓ 2 callersFunctionQuotaRound
QuotaRound converts a float64 quota value to int using half-away-from-zero rounding, with saturation. Every tiered billing path (pre-consume, settleme
common/quota_math.go:133
↓ 2 callersFunctionRawJSONPresent
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:718
↓ 2 callersMethodRead
([]byte)
middleware/gzip_test.go:141
↓ 2 callersFunctionReadStartupSyncRevisions
ReadStartupSyncRevisions reads the newest sync task of every topic before the startup loads, so a write made while they run is reloaded once the loop
service/node_sync.go:98
↓ 2 callersFunctionRechargeWaffoPancake
(tradeNo string)
model/topup.go:657
↓ 2 callersFunctionRecordLogWithAdminInfo
RecordLogWithAdminInfo stores operator metadata under other.admin_info and an optional, user-visible operation descriptor under other.op for localizat
model/log.go:171
↓ 2 callersFunctionRedisDelKey
(key string)
common/redis.go:99
↓ 2 callersFunctionRedisKeyCacheSeconds
()
common/redis.go:19
↓ 2 callersMethodRefresh
Refresh is RefreshPluginCredential on this refresher's single-flight group.
service/provider_plugin.go:165
↓ 2 callersFunctionRefreshTaskPluginRequest
RefreshTaskPluginRequest decodes a task submission again after a request plugin changed its stored body, so validation, pricing and the upstream body
middleware/task_plugin.go:994
↓ 2 callersFunctionRefreshTokenSID
(rawRefreshToken string)
service/auth_session.go:308
↓ 2 callersMethodRefund
Refund 退还所有预扣费
service/funding_source.go:23
↓ 2 callersFunctionRefundFailedRequestBilling
RefundFailedRequestBilling applies the common final-failure policy after all eligible attempts have ended. A settled BillingSession never refunds agai
relay/request_billing.go:58
↓ 2 callersFunctionRegisterOrUpdateCustomProvider
RegisterOrUpdateCustomProvider registers or updates a single custom provider
oauth/registry.go:150
↓ 2 callersFunctionRegisterSystemTaskHandler
RegisterSystemTaskHandler registers a handler keyed by its Type(). It must be called before StartSystemTaskRunner (or any time, since the runner snaps
service/system_task.go:57
↓ 2 callersFunctionRegisterVerificationCodeWithKey
(key string, code string, purpose string)
common/verification.go:35
↓ 2 callersFunctionRejectConversionLoss
(policy ConversionLossPolicy, diagnostics []ConversionDiagnostic)
relaykit/types/conversion.go:61
↓ 2 callersFunctionRelayNotFound
(c *gin.Context)
controller/relay.go:471
↓ 2 callersFunctionReleaseExternalIdentityWithTx
(tx *gorm.DB, provider string, userId int)
model/external_identity_claim.go:70
↓ 2 callersFunctionReleaseSystemTaskLock
(taskID string, lockedBy string)
model/system_task.go:534
↓ 2 callersMethodRemoveFilteredPolicy
(_ string, ptype string, fieldIndex int, fieldValues ...string)
service/authz/adapter.go:95
↓ 2 callersMethodRemoveOtherRatiosFromFloat
(value float64)
types/price_data.go:106
↓ 2 callersFunctionRenewSystemTaskLock
(taskID string, lockedBy string, lockUntil int64)
model/system_task.go:487
↓ 2 callersFunctionReorderChannelPriority
ReorderChannelPriority updates only priorities, including the routing copy in abilities. A snapshot check also protects preview/commit and undo from s
model/channel_priority.go:68
↓ 2 callersFunctionReportCurrentSystemInstance
()
service/system_instance.go:85
↓ 2 callersFunctionReportTask
ReportTask hands a task that reached its final state to the report hooks of the instances that matched its submission and are still enabled. It reads
relay/requestplugin/task_report.go:126
↓ 2 callersFunctionRequestAmount
(c *gin.Context)
controller/topup.go:507
↓ 2 callersFunctionRequestFunctionDeclarations
(raw []byte)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:157
↓ 2 callersFunctionRequestToolChoiceToChat
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:447
↓ 2 callersFunctionRerankHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/common_handler/rerank.go:19
↓ 2 callersFunctionResendAccountEmailBinding
(identity AuthIdentity, token string, lang string)
service/email_binding.go:96
↓ 2 callersFunctionResetDiskCacheStats
ResetDiskCacheStats 重置命中统计信息(不重置当前使用量)
common/disk_cache_config.go:147
↓ 2 callersMethodResolve
(task *model.Task, artifactKey string)
service/task_artifact_store.go:28
↓ 2 callersFunctionResolveCompletionRatio
ResolveCompletionRatio applies relay's enforced and fallback ratios to a configuration snapshot or draft without consulting mutable saved settings.
setting/ratio_setting/model_ratio.go:456
↓ 2 callersFunctionResolveIncomingBillingExprRequestInput
ResolveIncomingBillingExprRequestInput freezes the request context a billing expression reads. Only expressions that call param() read the body; for t
relay/helper/billing_expr_request.go:18
↓ 2 callersFunctionResolveTaskBillingExpr
ResolveTaskBillingExpr selects the executing plugin's override before the model expression, retaining the model alias fallback and explicit modes. ove
setting/billing_setting/tiered_billing.go:110
↓ 2 callersFunctionResolveTrustedProxies
ResolveTrustedProxies parses TRUSTED_PROXIES without applying it to an engine. The returned slice can be reused by the outer and plugin engines.
common/trusted_proxies.go:22
↓ 2 callersFunctionResponseClaude2OpenAI
(claudeResponse *dto.ClaudeResponse)
relaykit/relayconvert/response_compat.go:100
↓ 2 callersFunctionResponseGeminiChat2OpenAI
(id string, created int64, response *dto.GeminiChatResponse)
relaykit/relayconvert/response_compat.go:140
↓ 2 callersFunctionResponseOpenAI2Gemini
(openAIResponse *dto.OpenAITextResponse, info convmeta.Meta)
relaykit/relayconvert/response_compat.go:128
↓ 2 callersFunctionResponsesArgumentsString
ResponsesArgumentsString returns function call arguments in the string form expected by Chat Completions.
relaykit/dto/openai_response.go:572
↓ 2 callersFunctionResponsesResponseToChatCompletionsResponse
(resp *dto.OpenAIResponsesResponse, id string)
relaykit/relayconvert/response_compat.go:176
↓ 2 callersFunctionResponsesStatusFromChatFinishReason
(finishReason string)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:148
↓ 2 callersMethodResponsesToolState
ResponsesToolState returns the Responses tool encoding recorded by the latest request conversion, or nil when none was recorded. Response converters r
relaykit/relayconvert/convmeta/meta.go:48
↓ 2 callersFunctionResponsesWebSocketHelper
(c *gin.Context, client *websocket.Conn, runner ResponsesWSRequestRunner)
relay/responses_websocket.go:130
↓ 2 callersFunctionRouteTaskPluginEndpoint
RouteTaskPluginEndpoint selects between ordinary relay and plugin channels before a plugin can validate or rewrite the client's request. Plugin calls
middleware/task_plugin.go:520
↓ 2 callersFunctionRunTaskPollingOnce
RunTaskPollingOnce performs one async-task (Suno/video) polling pass synchronously. It honors ctx cancellation (the system-task runner cancels it when
service/task_polling.go:164
↓ 2 callersMethodSafetySettingFor
(category string)
relaykit/relayconvert/convmeta/options.go:112
↓ 2 callersMethodScan
Scan implements sql.Scanner interface
model/channel.go:191
↓ 2 callersFunctionSearchModels
(keyword string, vendor string, status string, syncOfficial string, offset int, limit int)
model/model_meta.go:486
↓ 2 callersFunctionSearchRedemptions
(keyword string, status string, startIdx int, num int)
model/redemption.go:62
↓ 2 callersFunctionSearchUsers
(keyword string, group string, role *int, status *int, startIdx int, num int, sortOptions ...UserSortOptions)
model/user.go:438
↓ 2 callersFunctionSecureVerificationRequired
SecureVerificationRequired protects channel key disclosure. Other sensitive operations validate their narrower proof scopes in their controller.
middleware/secure_verification.go:17
↓ 2 callersMethodServe
(c *gin.Context, task *model.Task, ref *StoredArtifactRef)
service/task_artifact_store.go:30
↓ 2 callersFunctionServeFrontendFiles
ServeFrontendFiles serves files from the embedded frontend build. The build never changes while the process runs, so each file is gzip-compressed once
middleware/frontend_static.go:34
↓ 2 callersMethodSetAudit
(key string, value any)
model/log_other.go:128
↓ 2 callersMethodSetContent
(content any)
relaykit/dto/claude.go:106
↓ 2 callersFunctionSetExposeRatioEnabled
(enabled bool)
setting/ratio_setting/expose_ratio.go:11
↓ 2 callersMethodSetIndex
(i int)
relaykit/dto/openai_response.go:135
↓ 2 callersFunctionSetLogLanguage
SetLogLanguage selects the language of server log lines. A language that starts with "zh" prints the Chinese text; anything else prints English.
common/log_text.go:20
↓ 2 callersFunctionSetLogging
(info LogFunc, errorFn LogFunc)
relaykit/relayconvert/kitutil/log.go:21
↓ 2 callersFunctionSetMediaResolver
(resolver MediaResolver)
relaykit/relayconvert/media.go:7
↓ 2 callersMethodSetResponsesToolState
SetResponsesToolState replaces that record; nil clears it. Request conversion calls it on every attempt so retries never inherit a record from another
relaykit/relayconvert/convmeta/meta.go:52
↓ 2 callersFunctionSetSyncTopicErrors
SetSyncTopicErrors records the items of topic this node failed to load, by key; nil or empty clears them.
service/node_sync.go:66
↓ 2 callersFunctionSetSystemErrorLogging
SetSystemErrorLogging configures the hook for internal converter failures.
relaykit/relayconvert/kitutil/log.go:31
↓ 2 callersFunctionSetTaskPluginDisabledFactoryKeysOption
(keys []string)
setting/task_plugin.go:111
↓ 2 callersFunctionSetTaskPluginStatus
(c *gin.Context)
controller/task_plugin.go:711
↓ 2 callersFunctionSetUserLangLoader
SetUserLangLoader sets the function to load user language (called from model package)
i18n/i18n.go:124
↓ 2 callersFunctionSetWebRouter
(router *gin.Engine, assets WebAssets, pluginDispatcher gin.HandlerFunc)
router/web-router.go:21
↓ 2 callersMethodSettle
Settle 根据实际消耗额度进行结算,计算 delta = actualQuota - preConsumedQuota, 同时调整资金来源(钱包/订阅)和令牌额度。
relay/common/billing.go:10
↓ 2 callersMethodSetupRequestHeader
(c *gin.Context, header *http.Header, info *relaycommon.RelayInfo)
relay/channel/providerplugin/adaptor.go:106
↓ 2 callersMethodSharedModel
SharedModel reports whether multiple plugins declare a model without copying its provider list on the relay hot path.
pkg/jsplugin/routing.go:537
↓ 2 callersFunctionShouldAttachThoughtSignature
(opts *convmeta.Options)
relaykit/relayconvert/internal/shared/gemini/request.go:66
↓ 2 callersFunctionShouldChatCompletionsUseResponsesGlobal
(channelID int, channelType int, model string)
service/openai_chat_responses_mode.go:47
↓ 2 callersFunctionShouldDisableByStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:53
↓ 2 callersMethodStart
(server *smtp.ServerInfo)
common/email_ntlm_auth.go:21
↓ 2 callersMethodStartHostedTool
(start HostedToolStreamStart)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:139
↓ 2 callersFunctionStartOAuthVerification
(identity AuthIdentity, operation VerificationOperation, provider string)
service/oauth_verification.go:15
↓ 2 callersFunctionStartRealtime
StartRealtime takes the execution plan of a Realtime session. Its instances run on the session's events once the session knows its channel (NewRealtim
relay/requestplugin/socket.go:164
↓ 2 callersFunctionStopReasonClaudeToOpenAI
(reason string)
relaykit/relayconvert/internal/claude_messages/to_oai_chat_resp.go:31
↓ 2 callersMethodStopped
Stopped returns the error the client gets for a response an instance stopped, and nil for any other.
relay/requestplugin/socket.go:151
↓ 2 callersFunctionStreamResponseClaude2OpenAI
(claudeResponse *dto.ClaudeResponse)
relaykit/relayconvert/response_compat.go:50
↓ 2 callersFunctionStreamResponseGeminiChat2OpenAI
(geminiResponse *dto.GeminiChatResponse)
relaykit/relayconvert/response_compat.go:144
↓ 2 callersFunctionStreamResponseOpenAI2Claude
(openAIResponse *dto.ChatCompletionsStreamResponse, info *relaycommon.RelayInfo)
service/convert.go:13
↓ 2 callersFunctionStreamResponseOpenAI2Gemini
(openAIResponse *dto.ChatCompletionsStreamResponse, info *relaycommon.RelayInfo)
service/convert.go:25
↓ 2 callersFunctionStreamResponseOpenAI2Gemini
(openAIResponse *dto.ChatCompletionsStreamResponse, info convmeta.Meta)
relaykit/relayconvert/response_compat.go:132
↓ 2 callersFunctionString2Int
(str string)
common/str.go:77
↓ 2 callersFunctionSumUsedQuota
(logType int, startTimestamp int64, endTimestamp int64, modelName string, username string, tokenName string, c
model/log.go:693
↓ 2 callersMethodSupportsImagineModel
(modelName string)
relaykit/relayconvert/convmeta/options.go:104
↓ 2 callersMethodSupportsPassThroughBody
SupportsPassThroughBody reports whether the route converter leaves the request body untouched.
relaykit/dto/channel_settings.go:209
↓ 2 callersFunctionSyncTopicLoadFailed
SyncTopicLoadFailed records that this node's startup load of topic failed: StartNodeSync then leaves the topic unapplied, so the first tick loads it a
service/node_sync.go:112
↓ 2 callersFunctionTaskCreated
TaskCreated marks a submission whose task is stored: the task reports at its final state, so the submission does not report.
relay/requestplugin/task_report.go:116
↓ 2 callersFunctionTaskEgress
TaskEgress runs the egress stage on the upstream body a task submission attempt built, before it is sent. It changes nothing; an instance can only sto
relay/requestplugin/relay.go:172
↓ 2 callersFunctionTaskError
TaskError is the task error of a request plugin's rejection or failure: a local error, which never counts against the channel.
relay/requestplugin/relay.go:205
↓ 2 callersFunctionTaskExecutionSnapshotFromContext
TaskExecutionSnapshotFromContext captures immutable request and plugin provenance at submission time. It never copies plugin source or payloads.
service/task_plugin_audit.go:12
↓ 2 callersFunctionTaskGetAllTasks
(startIdx int, num int, queryParams SyncTaskQueryParams)
model/task.go:354
← previousnext →3,401–3,500 of 15,409, ranked by callers