Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
10,934 in github.com/QuantumNous/new-api
⨍
Functions
10,934
◇
Types & classes
1,622
↓ 9 callers
Function
safeNumberFieldProps
(field: ControllerRenderProps<TFieldValues, TName>)
web/src/features/system-settings/utils/numeric-field.ts:76
↓ 9 callers
Function
seedTaskPollingChannel
(t *testing.T, id int, disableSleep bool)
service/task_polling_test.go:157
↓ 9 callers
Function
streamValuesFromAny
(value any)
relaykit/relayconvert/response_registry.go:626
↓ 9 callers
Function
useApiKeys
()
web/src/features/keys/components/api-keys-provider.tsx:182
↓ 9 callers
Function
useIsMobile
()
web/src/hooks/use-mobile.ts:23
↓ 9 callers
Function
useModels
()
web/src/features/models/components/models-provider.tsx:131
↓ 9 callers
Function
useThemeCustomization
()
web/src/context/theme-customization-provider.tsx:260
↓ 8 callers
Method
ApplyTick
ApplyTick maps bounded plugin semantics onto host-owned Responses events. taskStatus is the current durable DB status (for example, IN_PROGRESS, SUCCE
relay/plugin_protocol.go:443
↓ 8 callers
Method
BuildRequestBody
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:69
↓ 8 callers
Method
Close
()
relay/channel/openai/image_stream_test.go:165
↓ 8 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/adapter.go:22
↓ 8 callers
Function
ConvertStreamResponseChunk
(c context.Context, info convmeta.Meta, state *ResponseStreamState, response any)
relaykit/relayconvert/response_registry.go:301
↓ 8 callers
Method
CreatedEvent
()
relay/plugin_protocol.go:429
↓ 8 callers
Function
DecreaseUserQuota
(id int, quota int, db bool)
model/user.go:1317
↓ 8 callers
Method
DeleteMany
DeleteMany accepts either fully namespaced keys or raw keys and deletes them. It returns a map keyed by fully namespaced keys.
pkg/cachex/hybrid_cache.go:231
↓ 8 callers
Method
Export
Export returns one module export without exposing Sobek values outside the engine boundary. It is used for declarative exports such as meta.
pkg/jsplugin/engine.go:186
↓ 8 callers
Function
FinalizeStreamResponse
(c context.Context, info convmeta.Meta, state *ResponseStreamState)
relaykit/relayconvert/response_registry.go:326
↓ 8 callers
Function
GetGeminiSettings
GetGeminiSettings 获取Gemini配置
setting/model_setting/gemini.go:65
↓ 8 callers
Function
GetOIDCSettings
()
setting/system_setting/oidc.go:28
↓ 8 callers
Function
GetSystemTaskByTaskID
(taskID string)
model/system_task.go:121
↓ 8 callers
Function
GetTopUpByTradeNo
(tradeNo string)
model/topup.go:136
↓ 8 callers
Function
GetUUID
()
relaykit/relayconvert/kitutil/value.go:44
↓ 8 callers
Method
HasChannelMeta
HasChannelMeta reports whether upstream channel information is attached; converters use it to decide if GetUpstreamModelName is meaningful.
relaykit/relayconvert/convmeta/meta.go:23
↓ 8 callers
Function
LogDatabaseType
()
common/database.go:19
↓ 8 callers
Function
NewOpenAIChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:56
↓ 8 callers
Function
NewResponseStreamState
(from types.RelayFormat, target types.RelayFormat, options ResponseStreamOptions)
relaykit/relayconvert/response_registry.go:272
↓ 8 callers
Function
OaiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:20
↓ 8 callers
Function
OpenaiImageStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_image.go:93
↓ 8 callers
Method
OverridePlugins
()
pkg/jsplugin/registry.go:595
↓ 8 callers
Function
ParseAccessToken
(raw string)
service/auth_token.go:85
↓ 8 callers
Function
PrepareMidjourneyTaskBilling
PrepareMidjourneyTaskBilling sets the durable refund marker before the task is inserted.
service/midjourney.go:35
↓ 8 callers
Method
Read
(p []byte)
common/body_storage.go:196
↓ 8 callers
Function
RecordConsumeLog
(c *gin.Context, userId int, params RecordConsumeLogParams)
model/log.go:358
↓ 8 callers
Method
RecordError
(msg string)
relay/common/stream_status.go:55
↓ 8 callers
Method
Reset
Reset clears pending observations (used when a terminal response fails).
relay/common/tool_usage.go:129
↓ 8 callers
Function
ResetProxyClientCache
ResetProxyClientCache clears cached proxy and non-default direct policy clients and closes idle connections on every transport/shard. The package-leve
service/http_client.go:453
↓ 8 callers
Method
SaveToDB
SaveToDB 将配置保存到数据库
setting/config/config.go:71
↓ 8 callers
Method
SetEstimatePromptTokens
func (info *RelayInfo) SetPromptTokens(promptTokens int) { info.promptTokens = promptTokens }
relay/common/relay_info.go:714
↓ 8 callers
Function
SetMainDatabaseType
(databaseType DatabaseType)
common/database.go:23
↓ 8 callers
Function
SetToolPriceForTest
SetToolPriceForTest injects a tool price and rebuilds the lookup index. Tests only.
setting/operation_setting/tools.go:222
↓ 8 callers
Method
Snapshot
()
pkg/jsplugin/registry.go:807
↓ 8 callers
Function
Source
Source returns the embedded factory source for a task plugin key.
plugins/embed.go:35
↓ 8 callers
Function
UpdateUserUsableGroupsByJSONString
(jsonStr string)
setting/user_usable_group.go:38
↓ 8 callers
Function
ValidateSSRFProtectedFetchURL
(urlStr string)
service/http_client.go:71
↓ 8 callers
Function
calculateTextToolCallSurcharge
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, summary *textQuotaSummary)
service/text_quota.go:148
↓ 8 callers
Function
canManageTargetRole
(myRole int, targetRole int)
controller/user.go:401
↓ 8 callers
Function
compilePluginProtocolRetrieveEndpoint
(t *testing.T, key, source string, options pluginruntime.Options)
controller/plugin_protocol_test.go:1537
↓ 8 callers
Function
createLog
(log *Log)
model/log.go:101
↓ 8 callers
Function
defaultHTTPTransportPolicy
()
service/http_transport_policy.go:22
↓ 8 callers
Function
formatLogQuota
(quota: number)
web/src/lib/format.ts:237
↓ 8 callers
Function
getTaskEnumFields
( schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-expr.ts:78
↓ 8 callers
Function
getTokenUsedQuota
(t *testing.T, id int)
service/task_billing_test.go:482
↓ 8 callers
Function
getUserAuthVersionKey
(userId int)
model/user_auth_cache.go:30
↓ 8 callers
Method
hasHook
(ctx context.Context, hook string)
relay/channel/task/jsplugin/adaptor.go:1384
↓ 8 callers
Function
hasParsedChildren
( node: ParsedNode )
web/src/components/ai-elements/response-node-guards.ts:36
↓ 8 callers
Function
insertOriginTaskChannel
(t *testing.T, status int)
middleware/task_plugin_origin_task_test.go:43
↓ 8 callers
Function
insertPricingEndpointChannel
(t *testing.T, channelID int, channelType int, settings dto.ChannelOtherSettings)
model/pricing_endpoint_test.go:34
↓ 8 callers
Function
isTagAggregateRow
(row: Channel | TagRow)
web/src/features/channels/lib/channel-utils.ts:617
↓ 8 callers
Function
jsonValue
(value any)
relay/channel/task/jsplugin/adaptor.go:1396
↓ 8 callers
Method
memCache
()
pkg/cachex/hybrid_cache.go:69
↓ 8 callers
Function
metricValue
(metrics: FlowMetrics, metric: FlowMetric)
web/src/features/dashboard/lib/flow.ts:164
↓ 8 callers
Function
newAuthzTestDB
(t *testing.T)
service/authz/authz_test.go:14
↓ 8 callers
Function
newImageTestContext
(t *testing.T, body, contentType string, isStream bool)
relay/channel/openai/image_stream_test.go:19
↓ 8 callers
Function
newOuterPluginTestEngine
()
router/plugin_router_test.go:812
↓ 8 callers
Function
newPluginProtocolObservationLimiter
(limits pluginProtocolObservationLimits)
controller/plugin_protocol_limiter.go:56
↓ 8 callers
Function
newPluginProtocolRetrieveContext
(responseID string)
controller/plugin_protocol_test.go:1553
↓ 8 callers
Function
newTestResponsesStreamState
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:436
↓ 8 callers
Function
normalizeHeaderContextKey
(key string)
relay/common/override.go:1558
↓ 8 callers
Function
pluginProtocolRetrieveDeps
(pinned pluginruntime.PinnedEndpoint, task *model.Task, exists bool, err error)
controller/plugin_protocol_test.go:1563
↓ 8 callers
Method
redisOn
()
pkg/cachex/hybrid_cache.go:59
↓ 8 callers
Function
requireDeploymentID
(c *gin.Context)
controller/deployment.go:120
↓ 8 callers
Function
resetBatchUpdateTestState
(t *testing.T)
model/quota_reserve_test.go:58
↓ 8 callers
Function
resetSessionCookieSettingsAfterTest
(t *testing.T)
common/url_validator_test.go:125
↓ 8 callers
Function
setupTaskSubmissionDatabase
(t *testing.T, migrate bool, events *[]string)
controller/relay_task_plugin_test.go:354
↓ 8 callers
Function
staticProtection
(protection *common.SSRFProtection)
service/protected_fetch_client_test.go:26
↓ 8 callers
Method
submitContext
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/task/jsplugin/adaptor.go:1033
↓ 8 callers
Function
taskPluginControllerTestSource
(key, version string)
controller/task_plugin_test.go:42
↓ 8 callers
Function
tieredQuota
--------------------------------------------------------------------------- BuildTieredTokenParams: token normalization and ratio parity tests -------
service/tiered_settle_test.go:664
↓ 8 callers
Function
trimmed
(value)
plugins/tasks/alibaba/plugin.js:42
↓ 8 callers
Function
useContextValue
()
web/src/components/ai-elements/context.tsx:52
↓ 8 callers
Function
useRateLimitMiniRedis
(t *testing.T)
middleware/rate_limit_test.go:20
↓ 8 callers
Function
useSubscriptions
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:82
↓ 8 callers
Function
useSystemConfig
(options: UseSystemConfigOptions = {})
web/src/hooks/use-system-config.ts:144
↓ 8 callers
Function
useUsageLogsContext
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:88
↓ 7 callers
Function
BuildTaskPluginView
BuildTaskPluginView converts a persisted task into the deliberately narrow public shape permitted at JavaScript plugin boundaries.
service/task_plugin_view.go:11
↓ 7 callers
Function
ConfigureTrustedProxies
(engine *gin.Engine)
middleware/trusted_proxies.go:11
↓ 7 callers
Method
FinalResponse
FinalResponse validates a plugin-authored complete Responses object and overwrites every host-owned identity and lifecycle field. Unknown protocol fie
relay/plugin_protocol.go:562
↓ 7 callers
Method
GetAutoBan
()
model/channel.go:343
↓ 7 callers
Function
GetByTaskId
(userId int, taskId string)
model/task.go:413
↓ 7 callers
Function
GetContextKeyString
(c *gin.Context, key constant.ContextKey)
common/gin.go:165
↓ 7 callers
Function
GetEnvOrDefaultString
(env string, defaultValue string)
common/env.go:21
↓ 7 callers
Function
GetGroupRatioCopy
()
setting/ratio_setting/group_ratio.go:62
↓ 7 callers
Method
GetImageMedia
()
relaykit/dto/openai_request.go:329
↓ 7 callers
Function
GetModelRatio
(name string)
setting/ratio_setting/model_ratio.go:385
↓ 7 callers
Function
GetMonitorSetting
()
setting/operation_setting/monitor_setting.go:41
↓ 7 callers
Function
GetPasskeyByUserID
(userID int)
model/passkey.go:123
↓ 7 callers
Function
GetPaymentSetting
()
setting/operation_setting/payment_setting.go:29
↓ 7 callers
Method
GetResultURL
GetResultURL 获取任务结果 URL(视频地址等) 新数据存在 PrivateData.ResultURL 中;旧数据回退到 FailReason(历史兼容)
model/task.go:175
↓ 7 callers
Function
GetSSRFProtectedHTTPClient
GetSSRFProtectedHTTPClient 返回带拨号时 SSRF 校验的客户端。 ssrfProtectedHTTPClient 由 InitHttpClient 在启动时初始化,运行期只读。
service/http_client.go:159
↓ 7 callers
Function
GetTaskPluginDisabledFactoryKeys
()
setting/task_plugin.go:75
← previous
next →
401–500 of 10,934, ranked by callers