Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,592 in github.com/QuantumNous/new-api
⨍
Functions
15,592
◇
Types & classes
2,267
↓ 4 callers
Function
taskPricingConditions
( conditions: TaskTierCondition[], schema: BillingUsageSchema | undefined, language: string, t: (key:
web/src/features/pricing/lib/task-price-display.ts:68
↓ 4 callers
Function
taskReportError
taskReportError is the error a task submission's client received, as the request plugins' report record shows it; nil when it succeeded.
controller/relay.go:580
↓ 4 callers
Function
testConn
(t *testing.T)
service/protected_fetch_client_test.go:32
↓ 4 callers
Function
toCustomOAuthProviderResponse
(p *model.CustomOAuthProvider)
controller/custom_oauth.go:52
↓ 4 callers
Function
tokenLines
( tokens: readonly { raw?: string }[], raw: string, firstLine: number )
web/src/features/task-plugins/lib/plugin-document.ts:349
↓ 4 callers
Function
toolChoiceWithoutToolsDiagnostics
toolChoiceWithoutToolsDiagnostics reports the tool_choice and parallel_tool_calls controls omitted because no tool reached the target; upstreams rejec
relaykit/relayconvert/internal/toolconv/encode.go:220
↓ 4 callers
Method
toolDelta
(tool *responsesStreamTool, explicitDelta string)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:474
↓ 4 callers
Function
transformFormDataToUpdatePayload
( formData: ChannelFormValues, channelId: number )
web/src/features/channels/lib/channel-form.ts:985
↓ 4 callers
Function
trimmed
(value)
plugins/tasks/sora/plugin.js:39
↓ 4 callers
Function
unsupportedHostedHistoryDiagnostics
(format types.RelayFormat, history []HostedHistoryItem)
relaykit/relayconvert/internal/toolconv/encode.go:1399
↓ 4 callers
Function
updateChannelBalance
updateChannelBalance queries a built-in channel type's balance and stores its detail next to the USD balance the query writes.
controller/channel-billing.go:629
↓ 4 callers
Function
updateModelStatus
( id: number, status: number )
web/src/features/models/api.ts:103
↓ 4 callers
Function
updateUserSettings
( data: UpdateUserSettingsRequest )
web/src/features/profile/api.ts:79
↓ 4 callers
Function
usageFromClaudeResponse
(resp *dto.ClaudeResponse)
relaykit/relayconvert/response_registry.go:883
↓ 4 callers
Function
useCarousel
()
web/src/components/ui/carousel.tsx:54
↓ 4 callers
Function
useChatPresets
()
web/src/features/chat/hooks/use-chat-presets.ts:67
↓ 4 callers
Function
useConfirmation
()
web/src/components/ai-elements/confirmation.tsx:48
↓ 4 callers
Function
useCountdown
(options: UseCountdownOptions = {})
web/src/hooks/use-countdown.ts:26
↓ 4 callers
Function
useFormField
()
web/src/components/ui/form.tsx:153
↓ 4 callers
Function
useLayout
()
web/src/context/layout-provider.tsx:98
↓ 4 callers
Function
useModelPricing
(names: string[] = [], enabled = true)
web/src/features/model-pricing/api.ts:141
↓ 4 callers
Function
usePromptInputAttachments
()
web/src/components/ai-elements/prompt-input.tsx:263
↓ 4 callers
Method
useTarget
useTarget sends the next request to path or target, or to the route's address when both are empty.
relay/channel/providerplugin/chain.go:177
↓ 4 callers
Function
useTaskPluginOption
(pluginKey?: string)
web/src/features/channels/hooks/use-task-plugin-option.ts:48
↓ 4 callers
Function
useThemeRadiusPx
( cssVariable = '--radius-md', refreshKey?: string )
web/src/lib/theme-radius.ts:40
↓ 4 callers
Function
userCacheTTLSeconds
()
model/user_cache.go:66
↓ 4 callers
Function
userRateLimitFactory
userRateLimitFactory creates a rate limiter keyed by authenticated user ID instead of client IP, making it resistant to proxy rotation attacks. Must b
middleware/rate-limit.go:219
↓ 4 callers
Function
validAuthCacheMAC
(expected, actual string, expiresAt int64)
model/auth_cache_integrity.go:20
↓ 4 callers
Method
validate
validate checks a decoded config value against the field and returns it with the defaults of absent properties filled in. path names the value in erro
pluginkit/config_schema.go:782
↓ 4 callers
Function
validateModelPricing
Writes pass the locked database snapshot here, so allowing an unchanged stale override cannot bypass validation through an out-of-date process-local c
model/model_pricing_config.go:502
↓ 4 callers
Method
value
value reads one object; values counts down the values an object may hold.
relay/requestplugin/pdf.go:794
↓ 4 callers
Function
vendorErrorMessage
(error: unknown)
web/src/features/models/vendor-api.ts:57
↓ 4 callers
Function
waitPerfCounters
waitPerfCounters waits for the asynchronous health samples of the fixture model to reach wantRequests and returns the request and success counters.
controller/responses_websocket_test.go:311
↓ 4 callers
Function
watchRuntimeContext
(runtime *moejs.Runtime, ctx context.Context, timeout time.Duration, timeoutError error)
pluginkit/engine.go:820
↓ 4 callers
Method
withDefaults
()
controller/plugin_protocol.go:98
↓ 4 callers
Function
withSystemTaskRegistry
withSystemTaskRegistry swaps the package registry for the given handlers for the duration of a test and restores the original registry afterward.
service/system_task_test.go:17
↓ 4 callers
Method
write
write adds s and reports whether the sink takes more.
relay/requestplugin/extract.go:32
↓ 4 callers
Function
writeAccessTokenError
writeAccessTokenError responds with a stable code and a web console message.
controller/access_token.go:47
↓ 4 callers
Function
writeRateLimited
writeRateLimited rejects the request with 429 and a Retry-After hint so clients can back off instead of treating the rejection as a fatal error. The i
middleware/rate-limit.go:140
↓ 4 callers
Method
writeRune
(char rune)
relay/requestplugin/extract.go:44
↓ 4 callers
Function
writeUserSessionDenyFence
(session *UserSession, status string, now int64, reason string)
model/user_session.go:406
↓ 3 callers
Function
AccessTokenCatalog
AccessTokenCatalog lists the scopes this user may grant right now, grouped for display. Resources without a grantable action and empty groups are omit
service/access_token_scope.go:125
↓ 3 callers
Function
AcquireLogExportLock
AcquireLogExportLock reserves the one log export a user may run at a time. With Redis the reservation spans all nodes and lapses within a minute if th
service/log_export.go:33
↓ 3 callers
Function
AdminBindSubscription
Admin bind (no payment). Creates a UserSubscription from a plan.
model/subscription.go:726
↓ 3 callers
Function
AdminResetPlanSubscriptions
(planId int, advanceResetTime bool)
model/subscription.go:1129
↓ 3 callers
Function
AllPermissions
AllPermissions returns every registered permission.
service/authz/registry.go:42
↓ 3 callers
Method
Apply
(query *gorm.DB)
model/user.go:52
↓ 3 callers
Function
ApplyChannelGroupFilter
(query *gorm.DB, group string)
model/channel.go:171
↓ 3 callers
Function
ApplyOriginTaskAffinity
ApplyOriginTaskAffinity is the compatibility name for ApplyChannelPin.
relay/relay_task.go:194
↓ 3 callers
Function
AutomaticRetryStatusCodesToString
()
setting/operation_setting/status_code_ranges.go:57
↓ 3 callers
Function
BaseModelName
BaseModelName strips explicit model modifiers and any enabled legacy alias. Names on the thinking-suffix blacklist stay verbatim, including @ tails. M
setting/reasoning/suffix.go:76
↓ 3 callers
Method
BuildBalanceRequest
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:209
↓ 3 callers
Function
BuildParamOverrideContext
BuildParamOverrideContext 提供 ApplyParamOverride 可用的上下文信息。 目前内置以下字段: - upstream_model/model:始终为通道映射后的上游模型名。 - original_model:请求最初指定的模型名。 - user_id:已认证用
relay/common/override.go:2207
↓ 3 callers
Function
BuildProxyURL
BuildProxyURL constructs the video proxy URL using the public task ID. e.g., "https://your-server.com/v1/videos/task_xxxx/content"
relay/channel/task/taskcommon/helpers.go:65
↓ 3 callers
Function
CORS
()
middleware/cors.go:9
↓ 3 callers
Function
Cache
()
middleware/cache.go:7
↓ 3 callers
Method
CallCredentialRejected
CallCredentialRejected runs credentialRejected(ctx, {status, headers, body}) for a non-2xx response.
pluginkit/provider.go:532
↓ 3 callers
Method
CallInto
CallInto invokes one named module export and stores its result in target as the host codec decodes the encoding of the value Call returns, without tha
pluginkit/engine.go:339
↓ 3 callers
Method
CallRefresh
CallRefresh runs refresh(ctx).
pluginkit/provider.go:326
↓ 3 callers
Method
CallUsage
CallUsage runs a usage hook (extractUsage, extractUsageOnSubmit, extractUsageOnComplete) and returns its facts as the plugin reported them: nil for a
pluginkit/task.go:256
↓ 3 callers
Method
ChannelRelayRoutes
ChannelRelayRoutes returns the relay routes that serve a channel whose plugin_routes are toggles, with the converter as the manifest declares it.
pluginkit/meta.go:226
↓ 3 callers
Function
ChannelSupportsPluginLogin
ChannelSupportsPluginLogin reports a task plugin channel whose plugin exports login, which may be created without a key.
service/provider_plugin_login.go:121
↓ 3 callers
Function
CheckNotificationLimit
CheckNotificationLimit checks if the user has exceeded their notification limit Returns true if the user can send notification, false if limit exceede
service/notify-limit.go:50
↓ 3 callers
Function
CheckSubmittedPluginCredentials
CheckSubmittedPluginCredentials rejects a key an administrator submits for a channel when it holds a plugin credential only a login can create: one no
service/provider_plugin.go:625
↓ 3 callers
Function
CheckSystemOverload
CheckSystemOverload 返回哨兵应据以熔断的过载项。监控关闭、采样缺失或已超过 systemStatusMaxAge 时返回 nil。过载标记来自连续采样,阈值按当前配置复核, 运行时关闭或调高阈值后立即放行,不必等待下一次采样。
common/system_monitor.go:146
↓ 3 callers
Function
CloneBillingUsageWithEstimatedCompletion
CloneBillingUsageWithEstimatedCompletion preserves the original upstream billing dialect and fills a missing completion count without rebuilding the p
relaykit/dto/billing_usage.go:165
↓ 3 callers
Function
CloseChannels
(channelIDs []int, reason string)
pkg/wsmanager/wsmanager.go:93
↓ 3 callers
Function
CompleteSecurityVerification
CompleteSecurityVerification runs after the concrete authentication ceremony. Recheck the session and policy after potentially slow external authentic
service/security_verification.go:491
↓ 3 callers
Function
CompletionRatio2JSONString
()
setting/ratio_setting/model_ratio.go:428
↓ 3 callers
Function
ConsumeCodeWithKey
ConsumeCodeWithKey atomically verifies and removes a single-use code so concurrent requests cannot replay the same token.
common/verification.go:61
↓ 3 callers
Function
ContainsGroupRatio
(name string)
setting/ratio_setting/group_ratio.go:66
↓ 3 callers
Method
ConvertChunk
(geminiResponse *dto.GeminiChatResponse, model string, usage *dto.Usage)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go:361
↓ 3 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/advancedcustom/adaptor.go:52
↓ 3 callers
Function
ConvertRequestVia
(c context.Context, info convmeta.Meta, request any, path ...types.RelayFormat)
relaykit/relayconvert/request_registry.go:180
↓ 3 callers
Method
ConvertRerankRequest
(c *gin.Context, relayMode int, request dto.RerankRequest)
relay/channel/adapter.go:24
↓ 3 callers
Function
CountUserSessionsCreatedSince
CountUserSessionsCreatedSince counts every issued row, regardless of its current status or expiry. userID zero selects the global count.
model/user_session.go:195
↓ 3 callers
Function
CountUserTokens
CountUserTokens returns total number of tokens for the given user, used for pagination
model/token.go:443
↓ 3 callers
Function
CreateDiskCacheFile
CreateDiskCacheFile 创建磁盘缓存文件 cacheType: 缓存类型(body/file) 返回文件路径和文件句柄
common/disk_cache.go:42
↓ 3 callers
Function
CreateTwoFAEnrollment
CreateTwoFAEnrollment stores the pending credential, recovery codes and session-bound flow atomically. Reinitialization invalidates the previous setup
model/twofa_enrollment.go:23
↓ 3 callers
Function
DecompressRequestMiddleware
()
middleware/gzip.go:26
↓ 3 callers
Function
DecryptPassword
DecryptPassword accepts legacy RSA-OAEP/SHA-256 ciphertext and v2 envelopes. V2 wraps a fresh AES-256 key with RSA-OAEP and encrypts the password with
common/password_crypto.go:102
↓ 3 callers
Method
DefaultMaxTokensFor
(modelName string)
relaykit/relayconvert/convmeta/options.go:97
↓ 3 callers
Method
Delete
()
model/redemption.go:218
↓ 3 callers
Function
DeleteOldLogBatch
(ctx context.Context, targetTimestamp int64, limit int)
model/log.go:784
↓ 3 callers
Function
DeleteTaskPluginVersion
(key, version string)
model/task_plugin.go:287
↓ 3 callers
Function
DeleteVendors
(ids []int)
model/vendor_management.go:208
↓ 3 callers
Function
DisablePluginCredentialForLogin
DisablePluginCredentialForLogin disables the key holding line, a credential only a new login restores, for the reason a successful login clears, so re
service/provider_plugin.go:284
↓ 3 callers
Function
DoMidjourneyHttpRequest
(c *gin.Context, timeout time.Duration, fullRequestURL string)
service/midjourney.go:299
↓ 3 callers
Function
EmailVerificationRateLimit
()
middleware/email-verification-rate-limit.go:54
↓ 3 callers
Function
EnsureEmailAvailable
(email string, excludeUserID int)
model/user.go:348
↓ 3 callers
Function
ErrOptionWithStatusCode
(statusCode int)
relaykit/types/error.go:401
↓ 3 callers
Method
Error
()
pluginkit/transform.go:259
↓ 3 callers
Method
Event
Event passes one event of the response to the client once the reply check released its text. After a stop it drops the event.
relay/requestplugin/socket.go:95
↓ 3 callers
Function
ExpireSubscriptionOrder
(tradeNo string, expectedPaymentProvider string)
model/subscription.go:700
↓ 3 callers
Method
ExpiresWithin
ExpiresWithin reports whether the credential has an expiry and reaches it within margin of now.
pluginkit/provider.go:111
↓ 3 callers
Method
FailResponsesStream
FailResponsesStream emits protocol-native terminal error events when the target is OpenAI Responses. It returns handled=false for other targets.
relaykit/relayconvert/response_registry.go:438
↓ 3 callers
Method
FailureResponse
FailureResponse returns a sanitized non-stream failure for host-side protocol errors.
relay/plugin_protocol.go:629
↓ 3 callers
Function
FetchModelList
FetchModelList fetches the model list of a channel through its plugin's v1/models relay route, built as a relay request on that route is: a credential
relay/channel/providerplugin/management.go:83
↓ 3 callers
Function
FetchModels
(c *gin.Context)
controller/channel.go:1694
↓ 3 callers
Function
FromClaude
FromClaude reads Claude's native thinking and output_config controls. Budget bounds are not enforced here: the Claude renderer clamps budgets into 102
relaykit/relayconvert/reasoning/intent.go:561
← previous
next →
2,101–2,200 of 15,592, ranked by callers