MCPcopy Create free account

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

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

↓ 3 callersFunctionNewGeminiToChatStreamState
(id string, created int64)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go:342
↓ 3 callersFunctionNewNotify
(t string, title string, content string, values []any)
relaykit/dto/notify.go:18
↓ 3 callersFunctionNewResponsesBufferedAccumulator
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:672
↓ 3 callersFunctionNewSSRFProtectionFromFetchSetting
NewSSRFProtectionFromFetchSetting builds an SSRFProtection from persisted fetch_setting values.
common/ssrf_protection.go:34
↓ 3 callersFunctionNewTelegramProvider
NewTelegramProvider shares the HTTP client with a long-lived, cached JWKS verifier. Tests can exercise the real protocol using a local HTTP transport.
oauth/telegram.go:93
↓ 3 callersMethodNormalizeDefaults
()
model/subscription.go:216
↓ 3 callersFunctionNormalizeGeminiThinkingConfig
NormalizeGeminiThinkingConfig rewrites a provider-native thinkingConfig in place into the dialect the target model accepts: budgets become levels on G
relaykit/relayconvert/reasoning/gemini.go:251
↓ 3 callersFunctionNormalizeHTTPTransportPolicy
NormalizeHTTPTransportPolicy converts channel settings into a safe runtime policy. Invalid stored values never panic; they clamp to defaults and warn
service/http_transport_policy.go:33
↓ 3 callersFunctionNormalizeOrigin
NormalizeOrigin validates and canonicalizes a browser origin. Only an exact scheme/host/effective-port match is meaningful; paths and wildcards are no
common/session_cookie.go:14
↓ 3 callersFunctionNormalizeViolationFeeError
NormalizeViolationFeeError ensures: - if the CSAM marker is present, error.code is set to a stable violation-fee code and skip-retry is enabled. - if
service/violation_fee.go:56
↓ 3 callersFunctionNotifyUser
(userId int, userEmail string, userSetting dto.UserSetting, data dto.Notify)
service/user_notify.go:68
↓ 3 callersFunctionOaiChatToResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/responses_via_chat.go:66
↓ 3 callersFunctionOaiResponsesCompactionHandler
(c *gin.Context, resp *http.Response)
relay/channel/openai/relay_responses_compact.go:15
↓ 3 callersFunctionOaiResponsesToChatBufferedStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:58
↓ 3 callersFunctionOaiResponsesToChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:172
↓ 3 callersMethodObserve
Observe records one completed final image output when billable. outputIndex may be nil; when set and nonnegative it participates in dedup.
relay/common/tool_usage.go:145
↓ 3 callersFunctionObserveResponsesOutcome
ObserveResponsesOutcome records the protocol outcome of one Responses event on the stream status for health classification. Only codes and types are k
service/responses_usage.go:121
↓ 3 callersFunctionOpenAIChatRequestToClaudeMessages
(c context.Context, info convmeta.Meta, textRequest dto.GeneralOpenAIRequest)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_req.go:19
↓ 3 callersMethodOutcomeSnapshot
()
relay/common/stream_status.go:173
↓ 3 callersFunctionOverBodyLimit
OverBodyLimit reports whether a body is larger than MAX_REQUEST_BODY_MB, the limit a client body is read with.
relay/requestplugin/relay.go:282
↓ 3 callersFunctionParseAcceptLanguage
ParseAcceptLanguage returns the first language of an Accept-Language header, or "" when the header is absent or states no preference ("*").
i18n/i18n.go:179
↓ 3 callersMethodParseContent
()
relaykit/dto/openai_request.go:745
↓ 3 callersFunctionParseCredential
ParseCredential reads one channel key line as a plugin credential. Any other line is a static key.
pluginkit/provider.go:72
↓ 3 callersFunctionParseModelModifiers
ParseModelModifiers removes only a contiguous trailing chain of @key:value segments. Other @ characters remain part of the opaque model name.
relaykit/relayconvert/reasoning/suffix.go:41
↓ 3 callersFunctionParseProxyURLRuntime
ParseProxyURLRuntime validates and normalizes a proxy URL for runtime use. The boolean result reports whether a legacy path, query, or fragment was re
common/proxy_url.go:19
↓ 3 callersFunctionPasswordEncryptionPublicKey
PasswordEncryptionPublicKey returns the active key identifier and SPKI PEM public key exposed to browser clients.
common/password_crypto.go:92
↓ 3 callersMethodPendingResponse
PendingResponse is the host-synthesized non-terminal Responses snapshot. Callers must pass a non-terminal task status; completed/failed/incomplete inp
relay/plugin_protocol.go:404
↓ 3 callersFunctionPingData
(c *gin.Context)
relay/helper/common.go:269
↓ 3 callersFunctionPluginLoginNeededStatus
PluginLoginNeededStatus marks a new task plugin channel that has no credential yet as disabled until a login stores one.
service/provider_plugin_login.go:743
↓ 3 callersFunctionPostConsumeQuota
(relayInfo *relaycommon.RelayInfo, quota int, preConsumedQuota int, sendEmail bool)
service/quota.go:435
↓ 3 callersFunctionPrepareImageBillingForRequest
PrepareImageBillingForRequest reserves the effective outbound image quantity before each attempt, including channel retries and parameter overrides. T
service/image_billing.go:19
↓ 3 callersFunctionPreviewModelPricing
PreviewModelPricing resolves a complete editable draft using the same defaults as the saved-price display and conversion. It has no write side effects
model/model_pricing_config.go:227
↓ 3 callersFunctionProcessChannelError
(c *gin.Context, channelError types.ChannelError, err *types.NewAPIError, relayInfo *relaycommon.RelayInfo)
service/relay_error.go:63
↓ 3 callersFunctionPublishCloseChannels
(ctx context.Context, channelIDs []int, reason string)
pkg/wsmanager/wsmanager.go:130
↓ 3 callersFunctionQuotaFromDecimalChecked
QuotaFromDecimalChecked is QuotaFromDecimal but also returns a non-nil *QuotaClamp when the value was clamped, so billing callers can audit it.
common/quota_math.go:159
↓ 3 callersFunctionQuotaFromFloatChecked
QuotaFromFloatChecked is QuotaFromFloat but also returns a non-nil *QuotaClamp when the value was clamped, so billing callers can audit it.
common/quota_math.go:119
↓ 3 callersFunctionReadBodyJSONFields
ReadBodyJSONFields returns owned copies of the requested values. For valid JSON, simple member and array-index paths read disk storage through a bound
common/body_storage.go:46
↓ 3 callersFunctionRecord
(sample Sample)
pkg/perf_metrics/metrics.go:125
↓ 3 callersFunctionRecordExist
(err error)
model/utils.go:127
↓ 3 callersFunctionRecordMidjourneyPolicyResponse
RecordMidjourneyPolicyResponse distinguishes accepted tasks from errors inside HTTP 200 responses. Submissions are single-attempt: an ambiguous transp
service/midjourney.go:277
↓ 3 callersMethodRecordRequestInferredToolCall
RecordRequestInferredToolCall bills one call of key that the request itself proves: a forced hosted search on an upstream whose response reports no se
relay/common/tool_usage.go:98
↓ 3 callersFunctionRecordTaskBillingLog
(params RecordTaskBillingLogParams)
model/log.go:430
↓ 3 callersFunctionRefreshCodexChannelCredential
(ctx context.Context, channelID int, opts CodexCredentialRefreshOptions)
service/codex_credential_refresh.go:42
↓ 3 callersFunctionRefreshCodexOAuthTokenWithProxy
(ctx context.Context, refreshToken string, proxyURL string)
service/codex_oauth.go:33
↓ 3 callersFunctionRegisterPasskeyForSession
(identity AuthSessionIdentity, credential *PasskeyCredential)
model/passkey.go:228
↓ 3 callersFunctionRegisterResource
RegisterResource adds a resource definition to the permission registry.
service/authz/registry.go:24
↓ 3 callersFunctionRegisterVerificationCodeWithKey
(key string, code string, purpose string)
common/verification.go:36
↓ 3 callersMethodRelayConfig
RelayConfig returns the relay routes as the Advanced Custom configuration of one request. A plugin-converter route reaches the Advanced Custom code as
pluginkit/meta.go:178
↓ 3 callersMethodRelayRouteDefault
RelayRouteDefault reports whether a channel that has not switched route index serves it: false only for a route declared default_enabled: false.
pluginkit/meta.go:208
↓ 3 callersFunctionRelayRouteKey
RelayRouteKey names a relay route in a channel's plugin_routes: its incoming_path, followed by "|" and its models joined with "," when it lists models
pluginkit/meta.go:198
↓ 3 callersFunctionRenderGemini
RenderGemini maps a portable intent onto the target model's thinkingConfig. The capability table only maps and clamps: budgets become levels on Gemini
relaykit/relayconvert/reasoning/gemini.go:72
↓ 3 callersMethodRequestedImageCount
()
relay/common/relay_info.go:268
↓ 3 callersFunctionRequireLoginVerification
(token, method string)
service/login_verification.go:91
↓ 3 callersFunctionResolveImageBillingRequestInput
ResolveImageBillingRequestInput freezes only the validated scalar image parameters needed by pricing. Image files, prompts and base64 payloads are del
relay/helper/billing_expr_request.go:55
↓ 3 callersFunctionResolveLegacyBillingDetails
(name string, effective, configured PricingValues)
model/model_pricing_conversion.go:64
↓ 3 callersFunctionResolveOriginTask
ResolveOriginTask 处理基于已有任务的提交(remix / continuation): 查找原始任务、从中提取模型名称、将渠道锁定到原始任务的渠道 (通过 info.LockedChannel,重试时复用同一渠道并轮换 key), 以及提取 OtherRatios(时长、分辨率)。
relay/relay_task.go:50
↓ 3 callersFunctionResolveTaskPluginForPlatform
(generation *pluginruntime.RoutingGeneration, platform constant.TaskPlatform)
relay/relay_adaptor.go:159
↓ 3 callersFunctionResolveTaskPluginModel
ResolveTaskPluginModel matches a client model name against a plugin's declared models as the host protocols do: a case variant is served under the dec
model/task_model_alias.go:54
↓ 3 callersFunctionResponseOpenAI2Claude
(openAIResponse *dto.OpenAITextResponse, info convmeta.Meta)
relaykit/relayconvert/response_compat.go:38
↓ 3 callersFunctionResponseOpenAI2Claude
(openAIResponse *dto.OpenAITextResponse, info convmeta.Meta)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go:450
↓ 3 callersFunctionResponsesCustomToolNames
ResponsesCustomToolNames returns the Responses custom tools that AttachRequest sends upstream as functions. The response side restores function calls
relaykit/relayconvert/internal/toolconv/encode.go:293
↓ 3 callersFunctionResponsesSocket
ResponsesSocket starts the reply check and the report capture of one Responses WebSocket response, once its upstream request is sent. send writes one
relay/requestplugin/socket.go:63
↓ 3 callersFunctionResponsesToolStateOf
ResponsesToolStateOf is a nil-safe reader for Meta.ResponsesToolState.
relaykit/relayconvert/convmeta/meta.go:323
↓ 3 callersFunctionRevokeByRefreshToken
(rawRefreshToken, expectedSID, reason string)
service/auth_session.go:296
↓ 3 callersFunctionRevokeOtherUserSessions
(userID int, currentSID, reason string)
model/user_session.go:726
↓ 3 callersFunctionRevokeRemovedChannelCredentials
RevokeRemovedChannelCredentials revokes the credential lines of a task plugin channel's key before an edit that its key after it no longer holds. stor
service/provider_plugin.go:718
↓ 3 callersFunctionRevokeUserSessionByRefreshHash
RevokeUserSessionByRefreshHash is used when logout is authenticated only by the HttpOnly refresh cookie. Possession of a SID alone is insufficient. Th
model/user_session.go:622
↓ 3 callersFunctionRootUserExists
()
model/user.go:1547
↓ 3 callersFunctionRotateUserSessionRefresh
RotateUserSessionRefresh atomically rotates HMAC digests. The UPDATE itself is a compare-and-swap so SQLite, where lockForUpdate is intentionally a no
model/user_session.go:473
↓ 3 callersFunctionRouteParams
RouteParams names the inner router's positional wildcards after the parameters route declares.
pkg/jsplugin/routing.go:300
↓ 3 callersMethodRun
Run runs call.Stage on the instances in scope. It stops at the first rejection or failure of an instance whose plugin is not optional.
relay/requestplugin/plan.go:350
↓ 3 callersFunctionRunCLI
RunCLI implements the `new-api plugin` subcommand: linting a plugin source and replaying a golden fixture against it. It returns a process exit code.
pkg/jsplugin/cli.go:13
↓ 3 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
↓ 3 callersMethodRuntimeHandler
RuntimeHandler is the inner router built for this exact generation. It is published in the same atomic pointer as the routing indexes.
pkg/jsplugin/routing.go:349
↓ 3 callersFunctionSaveQuotaDataCache
()
model/usedata.go:108
↓ 3 callersFunctionSearchVendors
SearchVendors filters persisted vendor records and counts actual model assignments.
model/vendor_meta.go:103
↓ 3 callersMethodSelectUpdate
()
model/token.go:324
↓ 3 callersMethodSemanticLoss
SemanticLoss builds an error-severity diagnostic for this definition.
relaykit/relayconvert/convmeta/websearch.go:88
↓ 3 callersMethodSetBackground
(background bool)
relay/plugin_protocol.go:397
↓ 3 callersMethodSetReasoningContent
(s string)
relaykit/dto/openai_response.go:122
↓ 3 callersFunctionSetScheduledChannelKeyStatus
SetScheduledChannelKeyStatus applies an automatic status transition to the stored key. Call it only inside UpdateScheduledChannelLocked, after locatin
model/channel_plugin_credential.go:354
↓ 3 callersMethodSetStringContent
(content string)
relaykit/dto/claude.go:178
↓ 3 callersMethodSetStringContent
(content string)
relaykit/dto/openai_request.go:727
↓ 3 callersFunctionSetTaskPluginEnabled
(key string, enabled bool)
model/task_plugin.go:270
↓ 3 callersMethodSetText
(s string)
relaykit/dto/claude.go:53
↓ 3 callersMethodSetTools
(tools []GeminiChatTool)
relaykit/dto/gemini.go:203
↓ 3 callersFunctionSetUnloadedPlugins
SetUnloadedPlugins publishes what the plugin sync found: the enabled, active plugins it could not load, with their load errors.
relay/requestplugin/plan.go:116
↓ 3 callersFunctionSetUserAuthVersionFence
SetUserAuthVersionFence publishes a fail-closed version before a restrictive database update. Pending fences expire only after every pre-existing user
model/user_auth_cache.go:136
↓ 3 callersMethodSettle
Settle 根据差额调整资金来源(正数补扣,负数退还)
service/funding_source.go:21
↓ 3 callersFunctionSetupLogger
()
logger/logger.go:42
↓ 3 callersFunctionShouldRetryByStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:80
↓ 3 callersFunctionSmokeTestExpr
--------------------------------------------------------------------------- Smoke test (called externally for validation before save) ----------------
setting/billing_setting/tiered_billing.go:204
↓ 3 callersFunctionSocketIngress
SocketIngress takes the execution plan of one Responses WebSocket response.create and runs the ingress stage on its stored body, as Ingress does for a
relay/requestplugin/socket.go:40
↓ 3 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
pluginkit/meta.go:152
↓ 3 callersFunctionStartTwoFASetup
(identity AuthIdentity, authorization *model.AuthFlowAuthorization)
service/twofa.go:19
↓ 3 callersFunctionStateFromIntent
StateFromIntent copies the portable fields of an intent into conversion state. Empty intents produce nil so callers can omit the field.
relaykit/relayconvert/reasoning/intent.go:112
↓ 3 callersFunctionStreamResponseOpenAI2Claude
(openAIResponse *dto.ChatCompletionsStreamResponse, info convmeta.Meta)
relaykit/relayconvert/response_compat.go:42
↓ 3 callersMethodSupplementResponseOutput
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:758
↓ 3 callersFunctionSupportedLanguages
SupportedLanguages returns a list of supported language codes
i18n/i18n.go:209
↓ 3 callersMethodSupportsUpstream
SupportsUpstream reports whether the driver handles channels of the given upstream kind. The vendor kind is implied for every plugin.
pluginkit/meta.go:385
← previousnext →2,301–2,400 of 15,592, ranked by callers