Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
↓ 3 callers
Method
GetModelMapping
()
model/channel.go:594
↓ 3 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:52
↓ 3 callers
Function
GetPerformanceMonitorConfig
GetPerformanceMonitorConfig 获取性能监控配置
common/performance_config.go:26
↓ 3 callers
Function
GetPluginBillingExpr
(pluginKey, model string)
setting/billing_setting/tiered_billing.go:102
↓ 3 callers
Function
GetPluginBillingExprCopy
()
setting/billing_setting/tiered_billing.go:98
↓ 3 callers
Function
GetPricingSyncData
(base map[string]any)
setting/billing_setting/tiered_billing.go:189
↓ 3 callers
Method
GetPriority
()
model/channel.go:569
↓ 3 callers
Method
GetRawData
()
relaykit/types/file_source.go:16
↓ 3 callers
Method
GetSendResponseCount
GetSendResponseCount / IncrSendResponseCount expose the shared downstream-chunk counter (the host may also increment it).
relaykit/relayconvert/convmeta/meta.go:56
↓ 3 callers
Method
GetSetting
()
model/channel.go:1205
↓ 3 callers
Function
GetStatus
(c *gin.Context)
controller/misc.go:41
↓ 3 callers
Method
GetStringContent
()
relaykit/dto/claude.go:152
↓ 3 callers
Function
GetSubscriptionOrderByTradeNo
(tradeNo string)
model/subscription.go:253
↓ 3 callers
Function
GetSystemStatus
GetSystemStatus 获取当前系统状态
common/system_monitor.go:139
↓ 3 callers
Method
GetTag
()
model/channel.go:347
↓ 3 callers
Function
GetTaskArtifactStore
GetTaskArtifactStore returns the process-wide artifact storage backend. This release always returns the disabled implementation.
service/task_artifact_store.go:61
↓ 3 callers
Function
GetTaskPluginGatewayID
GetTaskPluginGatewayID returns the gateway id, creating it on first use. The first node to insert the row wins, so every node reads the same value.
model/task_plugin.go:332
↓ 3 callers
Function
GetTaskPluginMarketplaceSources
()
setting/task_plugin.go:56
↓ 3 callers
Function
GetTaskPluginRuntime
(c *gin.Context)
controller/task_plugin.go:400
↓ 3 callers
Function
GetTaskPluginUsage
(key string)
model/task_plugin.go:25
↓ 3 callers
Function
GetUniqueUserByEmail
(email string)
model/user.go:1149
↓ 3 callers
Function
GetUserLogs
(userId int, filter LogFilter, startIdx int, num int)
model/log.go:596
↓ 3 callers
Function
GetUserUsedQuota
(id int)
model/user.go:1264
↓ 3 callers
Function
GetVendors
GetVendors 返回当前定价接口使用到的供应商信息
model/pricing.go:108
↓ 3 callers
Method
GetWeight
()
model/channel.go:576
↓ 3 callers
Function
HardDeleteUserById
HardDeleteUserById permanently deletes a user and returns how many scoped access tokens were deleted with it.
model/user.go:564
↓ 3 callers
Method
HasBody
HasBody reports whether the request carries a body, a form or a file.
pkg/jsplugin/provider.go:625
↓ 3 callers
Function
HasOpenAIUsageTokens
(usage *Usage)
relaykit/dto/billing_usage.go:77
↓ 3 callers
Function
ImageHelper
(c *gin.Context, info *relaycommon.RelayInfo)
relay/image_handler.go:32
↓ 3 callers
Function
ImageTokens
ImageTokens returns the prompt tokens one image costs on model.
tokenkit/image.go:32
↓ 3 callers
Function
InitOpenAIError
(errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:299
↓ 3 callers
Function
InspectResponse
InspectResponse reports protocol information that the current response converters cannot faithfully express. It keeps loss handling centralized so dir
relaykit/relayconvert/internal/toolconv/response.go:17
↓ 3 callers
Function
InvalidatePluginKeyToken
InvalidatePluginKeyToken drops the cached token of a key line after the upstream rejected it, unless another exchange replaced it meanwhile.
service/provider_plugin.go:367
↓ 3 callers
Function
InvalidateProxyClient
InvalidateProxyClient removes every cached policy variant for one proxy and closes their idle connections (including all HTTP/2 shards).
service/http_client.go:445
↓ 3 callers
Function
IsBuiltInToolPriceKey
IsBuiltInToolPriceKey reports whether the built-in price seed prices the tool name, as a default or for a model prefix. Operator prices never count.
setting/operation_setting/tools.go:126
↓ 3 callers
Function
IsChannelError
(err *NewAPIError)
relaykit/types/error.go:374
↓ 3 callers
Method
IsConfigured
()
setting/system_setting/telegram.go:24
↓ 3 callers
Function
IsDiskCacheAvailable
IsDiskCacheAvailable 检查是否可以创建新的磁盘缓存
common/disk_cache_config.go:170
↓ 3 callers
Function
IsExposeRatioEnabled
()
setting/ratio_setting/expose_ratio.go:15
↓ 3 callers
Function
IsIpInCIDRList
(ip net.IP, cidrList []string)
common/ip.go:33
↓ 3 callers
Function
IsModelPricingOption
(key string)
model/model_pricing_config.go:77
↓ 3 callers
Method
IsNative
IsNative reports whether the route forwards requests without protocol conversion. Validate normalizes an empty converter to none, but callers may see
relaykit/dto/channel_settings.go:258
↓ 3 callers
Function
IsProtectedHeader
IsProtectedHeader reports a header no plugin effect may change: the credentials, the request framing and the hop-by-hop headers.
pkg/requestpatch/patch.go:360
↓ 3 callers
Function
IsTaskArtifactAccess
(c *gin.Context)
middleware/task_artifact_access.go:220
↓ 3 callers
Function
IsUserSelectableGroup
(userGroup, groupName string)
service/group.go:49
↓ 3 callers
Function
IsValidateRole
(role int)
common/constants.go:208
↓ 3 callers
Function
IssueTaskArtifactAccess
IssueTaskArtifactAccess creates a stable capability bound to exactly one public task ID and artifact key. It contains no user or upstream data.
service/task_artifact_access.go:32
↓ 3 callers
Method
Items
()
types/set.go:30
↓ 3 callers
Method
JSONTextMember
JSONTextMember names the member of a hook result (a decoded requestBody, a request descriptor's body) that the host also takes as JSON text, for a plu
pkg/jsplugin/registry.go:311
↓ 3 callers
Function
LegacyAccessTokensRetired
(now int64)
model/user_access_token.go:326
↓ 3 callers
Function
ListActiveUserSessions
(userID int, currentSID string, now int64)
model/user_session.go:417
↓ 3 callers
Function
ListTaskPlugins
(c *gin.Context)
controller/task_plugin.go:294
↓ 3 callers
Function
ListTaskPlugins
()
model/task_plugin.go:151
↓ 3 callers
Function
LoadCustomProviders
LoadCustomProviders replaces the custom OAuth providers with the ones in the database, all at once: a login never finds a provider missing mid-load. A
oauth/registry.go:112
↓ 3 callers
Function
LoadFromJsonString
(m *RWMap[K, V], jsonStr string)
types/rw_map.go:76
↓ 3 callers
Function
LoadPasswordEncryptionPrivateKey
LoadPasswordEncryptionPrivateKey validates a persisted key before replacing the active in-memory key used by request handlers.
common/password_crypto.go:50
↓ 3 callers
Function
LoadTaskArtifactAccessLimits
LoadTaskArtifactAccessLimits reads startup configuration. Invalid and non-positive values safely fall back to the documented defaults.
setting/system_setting/task_artifact.go:37
↓ 3 callers
Function
LogError
(message string)
relaykit/relayconvert/kitutil/log.go:45
↓ 3 callers
Function
LogQuotaData
(params QuotaDataLogParams)
model/usedata.go:84
↓ 3 callers
Function
LogTaskConsumption
LogTaskConsumption 记录任务消费日志和统计信息(仅记录,不涉及实际扣费)。 实际扣费已由 BillingSession(PreConsumeBilling + SettleBilling)完成。
service/task_billing.go:26
↓ 3 callers
Function
LookupRequestConverter
(converter string)
relaykit/relayconvert/request_registry.go:146
↓ 3 callers
Method
MatchPath
MatchPath returns the first route whose IncomingPath matches requestPath. Matching mirrors the relay adaptor: exact match, {model} placeholder, and :g
relaykit/dto/channel_settings.go:266
↓ 3 callers
Method
MatchesName
MatchesName applies a metadata rule to a concrete channel model name.
model/model_meta.go:64
↓ 3 callers
Method
MergePublic
(values map[string]any)
model/log_other.go:73
↓ 3 callers
Function
MigrateSensitiveWords
MigrateSensitiveWords moves the words of the retired sensitive word check into one global request-filter instance and deletes the check's options. The
model/sensitive_word_migration.go:28
↓ 3 callers
Method
ModelListRoute
ModelListRoute returns the /v1/models relay route, with the converter as the manifest declares it.
pkg/jsplugin/registry.go:264
↓ 3 callers
Function
ModelPriceHelperPerCall
ModelPriceHelperPerCall 按次/按量计费的 PriceHelper (MJ、Task)
relay/helper/price.go:213
↓ 3 callers
Function
NativeRouteCredential
NativeRouteCredential accepts, on the native routes of the built-in plugins listed here, the vendor's official API-key form as the gateway token and r
middleware/task_plugin.go:68
↓ 3 callers
Function
NewNotify
(t string, title string, content string, values []any)
relaykit/dto/notify.go:18
↓ 3 callers
Function
NewResponsesBufferedAccumulator
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:672
↓ 3 callers
Function
NewSSRFProtectionFromFetchSetting
NewSSRFProtectionFromFetchSetting builds an SSRFProtection from persisted fetch_setting values.
common/ssrf_protection.go:34
↓ 3 callers
Function
NewTelegramProvider
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 callers
Method
NormalizeDefaults
()
model/subscription.go:216
↓ 3 callers
Function
NormalizeGeminiThinkingConfig
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 callers
Function
NormalizeHTTPTransportPolicy
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 callers
Function
NormalizeOrigin
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 callers
Function
NormalizeViolationFeeError
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 callers
Function
NotifyUser
(userId int, userEmail string, userSetting dto.UserSetting, data dto.Notify)
service/user_notify.go:68
↓ 3 callers
Function
OaiChatToResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/responses_via_chat.go:66
↓ 3 callers
Function
OaiResponsesCompactionHandler
(c *gin.Context, resp *http.Response)
relay/channel/openai/relay_responses_compact.go:15
↓ 3 callers
Function
OaiResponsesToChatBufferedStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:58
↓ 3 callers
Function
OaiResponsesToChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:172
↓ 3 callers
Method
Observe
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 callers
Function
ObserveResponsesOutcome
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 callers
Function
OpenAIChatRequestToClaudeMessages
(c context.Context, info convmeta.Meta, textRequest dto.GeneralOpenAIRequest)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_req.go:19
↓ 3 callers
Method
OutcomeSnapshot
()
relay/common/stream_status.go:173
↓ 3 callers
Function
OverBodyLimit
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 callers
Function
ParseAcceptLanguage
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 callers
Method
ParseContent
()
relaykit/dto/openai_request.go:742
↓ 3 callers
Function
ParseModelModifiers
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 callers
Function
ParseProxyURLRuntime
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 callers
Function
PasswordEncryptionPublicKey
PasswordEncryptionPublicKey returns the active key identifier and SPKI PEM public key exposed to browser clients.
common/password_crypto.go:92
↓ 3 callers
Method
PendingResponse
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 callers
Function
PingData
(c *gin.Context)
relay/helper/common.go:269
↓ 3 callers
Function
PluginLoginNeededStatus
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 callers
Function
PostConsumeQuota
(relayInfo *relaycommon.RelayInfo, quota int, preConsumedQuota int, sendEmail bool)
service/quota.go:435
↓ 3 callers
Function
PrepareImageBillingForRequest
PrepareImageBillingForRequest reserves the effective outbound image quantity before each attempt, including channel retries and parameter overrides. T
service/image_billing.go:19
↓ 3 callers
Function
PreviewModelPricing
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 callers
Function
ProcessChannelError
(c *gin.Context, channelError types.ChannelError, err *types.NewAPIError, relayInfo *relaycommon.RelayInfo)
service/relay_error.go:63
↓ 3 callers
Function
PublishCloseChannels
(ctx context.Context, channelIDs []int, reason string)
pkg/wsmanager/wsmanager.go:130
← previous
next →
2,201–2,300 of 15,409, ranked by callers