MCPcopy Create free account

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

Functions9,514 in github.com/QuantumNous/new-api

↓ 9 callersFunctionuseApiKeys
()
web/src/features/keys/components/api-keys-provider.tsx:182
↓ 9 callersFunctionuseIsMobile
()
web/src/hooks/use-mobile.ts:23
↓ 9 callersFunctionuseModels
()
web/src/features/models/components/models-provider.tsx:131
↓ 9 callersFunctionuseThemeCustomization
()
web/src/context/theme-customization-provider.tsx:260
↓ 8 callersMethodClose
()
relay/channel/openai/image_stream_test.go:165
↓ 8 callersMethodConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/adapter.go:21
↓ 8 callersFunctionConvertStreamResponseChunk
(c context.Context, info convmeta.Meta, state *ResponseStreamState, response any)
relaykit/relayconvert/response_registry.go:301
↓ 8 callersMethodDeleteMany
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 callersMethodDialContext
(ctx context.Context, network, addr string)
service/protected_fetch_client.go:170
↓ 8 callersFunctionFinalizeStreamResponse
(c context.Context, info convmeta.Meta, state *ResponseStreamState)
relaykit/relayconvert/response_registry.go:326
↓ 8 callersFunctionFlushWriter
(c *gin.Context)
relay/helper/common.go:17
↓ 8 callersFunctionGetContextKeyString
(c *gin.Context, key constant.ContextKey)
common/gin.go:165
↓ 8 callersFunctionGetFetchSetting
()
setting/system_setting/fetch_setting.go:32
↓ 8 callersFunctionGetGeminiSettings
GetGeminiSettings 获取Gemini配置
setting/model_setting/gemini.go:65
↓ 8 callersFunctionGetOIDCSettings
()
setting/system_setting/oidc.go:28
↓ 8 callersFunctionGetSystemTaskByTaskID
(taskID string)
model/system_task.go:121
↓ 8 callersFunctionGetUUID
()
relaykit/relayconvert/kitutil/value.go:44
↓ 8 callersFunctionGetUserQuota
GetUserQuota gets quota from Redis first, falls back to DB if needed
model/user.go:1129
↓ 8 callersMethodHasChannelMeta
HasChannelMeta reports whether upstream channel information is attached; converters use it to decide if GetUpstreamModelName is meaningful.
relaykit/relayconvert/convmeta/meta.go:23
↓ 8 callersFunctionNewResponseStreamState
(from types.RelayFormat, target types.RelayFormat, options ResponseStreamOptions)
relaykit/relayconvert/response_registry.go:272
↓ 8 callersFunctionOaiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:20
↓ 8 callersFunctionOpenaiImageStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_image.go:93
↓ 8 callersFunctionParseAccessToken
(raw string)
service/auth_token.go:85
↓ 8 callersFunctionRecalculateTaskQuota
RecalculateTaskQuota 通用的异步差额结算。 actualQuota 是任务完成后的实际应扣额度,与预扣额度 (task.Quota) 做差额结算。 reason 用于日志记录(例如 "token重算" 或 "adaptor调整")。 clamps 可选:若计算 actualQuo
service/task_billing.go:210
↓ 8 callersFunctionRecordConsumeLog
(c *gin.Context, userId int, params RecordConsumeLogParams)
model/log.go:343
↓ 8 callersMethodRecordError
(msg string)
relay/common/stream_status.go:55
↓ 8 callersFunctionResetProxyClientCache
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:430
↓ 8 callersFunctionResponsesRequestToChatCompletionsRequest
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:27
↓ 8 callersFunctionSetDatabaseTypes
(mainType DatabaseType, logType DatabaseType)
common/database.go:31
↓ 8 callersMethodSetEstimatePromptTokens
func (info *RelayInfo) SetPromptTokens(promptTokens int) { info.promptTokens = promptTokens }
relay/common/relay_info.go:684
↓ 8 callersMethodSetProgressStr
(progress string)
relaykit/dto/openai_video.go:33
↓ 8 callersFunctionSetToolPriceForTest
SetToolPriceForTest injects a tool price and rebuilds the lookup index. Tests only.
setting/operation_setting/tools.go:222
↓ 8 callersFunctionT
T translates a message key using the language from gin context
i18n/i18n.go:90
↓ 8 callersFunctionUpdateChannelUsedQuota
(id int, quota int)
model/channel.go:861
↓ 8 callersFunctionUpdateUserUsableGroupsByJSONString
(jsonStr string)
setting/user_usable_group.go:38
↓ 8 callersFunctionUpdateUserUsedQuotaAndRequestCount
(id int, quota int)
model/user.go:1309
↓ 8 callersFunctionValidateSSRFProtectedFetchURL
(urlStr string)
service/http_client.go:70
↓ 8 callersFunctioncalculateTextToolCallSurcharge
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, summary *textQuotaSummary)
service/text_quota.go:148
↓ 8 callersFunctioncanManageTargetRole
(myRole int, targetRole int)
controller/user.go:371
↓ 8 callersFunctioncreateLog
(log *Log)
model/log.go:101
↓ 8 callersFunctiondefaultHTTPTransportPolicy
()
service/http_transport_policy.go:22
↓ 8 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:280
↓ 8 callersFunctiongetUserAuthVersionKey
(userId int)
model/user_auth_cache.go:30
↓ 8 callersFunctionhasParsedChildren
( node: ParsedNode )
web/src/components/ai-elements/response-node-guards.ts:36
↓ 8 callersFunctionisTagAggregateRow
(row: Channel | TagRow)
web/src/features/channels/lib/channel-utils.ts:617
↓ 8 callersMethodmemCache
()
pkg/cachex/hybrid_cache.go:69
↓ 8 callersFunctionmetricValue
(metrics: FlowMetrics, metric: FlowMetric)
web/src/features/dashboard/lib/flow.ts:164
↓ 8 callersFunctionmustRawMessage
(t *testing.T, value any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req_test.go:298
↓ 8 callersFunctionnewImageTestContext
(t *testing.T, body, contentType string, isStream bool)
relay/channel/openai/image_stream_test.go:19
↓ 8 callersFunctionnewTestResponsesStreamState
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:436
↓ 8 callersFunctionnormalizeHeaderContextKey
(key string)
relay/common/override.go:1507
↓ 8 callersMethodredisOn
()
pkg/cachex/hybrid_cache.go:59
↓ 8 callersFunctionrequireDeploymentID
(c *gin.Context)
controller/deployment.go:120
↓ 8 callersFunctionresetPricingEndpointTestTables
(t *testing.T)
model/pricing_endpoint_test.go:14
↓ 8 callersFunctionresetSessionCookieSettingsAfterTest
(t *testing.T)
common/url_validator_test.go:125
↓ 8 callersFunctionstaticProtection
(protection *common.SSRFProtection)
service/protected_fetch_client_test.go:26
↓ 8 callersFunctiontieredQuota
--------------------------------------------------------------------------- BuildTieredTokenParams: token normalization and ratio parity tests -------
service/tiered_settle_test.go:664
↓ 8 callersFunctionuseContextValue
()
web/src/components/ai-elements/context.tsx:52
↓ 8 callersFunctionuseRateLimitMiniRedis
(t *testing.T)
middleware/rate_limit_test.go:20
↓ 8 callersFunctionuseSubscriptions
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:82
↓ 8 callersFunctionuseSystemConfig
(options: UseSystemConfigOptions = {})
web/src/hooks/use-system-config.ts:144
↓ 8 callersFunctionuseUsageLogsContext
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:78
↓ 7 callersFunctionApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:178
↓ 7 callersFunctionConfigureTrustedProxies
(engine *gin.Engine)
middleware/trusted_proxies.go:22
↓ 7 callersFunctionDecreaseUserQuota
(id int, quota int, db bool)
model/user.go:1257
↓ 7 callersFunctionGenerateHMAC
(data string)
common/crypto.go:17
↓ 7 callersFunctionGetGroupRatioCopy
()
setting/ratio_setting/group_ratio.go:62
↓ 7 callersMethodGetImageMedia
()
relaykit/dto/openai_request.go:327
↓ 7 callersFunctionGetModelRatio
(name string)
setting/ratio_setting/model_ratio.go:396
↓ 7 callersFunctionGetPasskeyByUserID
(userID int)
model/passkey.go:123
↓ 7 callersFunctionGetPaymentSetting
()
setting/operation_setting/payment_setting.go:29
↓ 7 callersMethodGetResultURL
GetResultURL 获取任务结果 URL(视频地址等) 新数据存在 PrivateData.ResultURL 中;旧数据回退到 FailReason(历史兼容)
model/task.go:136
↓ 7 callersFunctionGetSSRFProtectedHTTPClient
GetSSRFProtectedHTTPClient 返回带拨号时 SSRF 校验的客户端。 ssrfProtectedHTTPClient 由 InitHttpClient 在启动时初始化,运行期只读。
service/http_client.go:136
↓ 7 callersFunctionGetTopUpByTradeNo
(tradeNo string)
model/topup.go:72
↓ 7 callersMethodGetUpstreamModelName
()
relaykit/relayconvert/convmeta/meta.go:20
↓ 7 callersMethodGetUsageMetadata
()
relaykit/dto/gemini.go:496
↓ 7 callersFunctionGetUserSessionCached
GetUserSessionCached validates cached state first and falls back to the database on a miss or Redis read failure. A deny tombstone never falls back.
model/user_session.go:211
↓ 7 callersFunctionHeaderNavModuleAuth
(module string)
middleware/header_nav.go:104
↓ 7 callersMethodIsNormalEnd
()
relay/common/stream_status.go:88
↓ 7 callersFunctionIssueSecurityProof
(identity AuthIdentity, method string, scopes []string)
service/auth_token.go:132
↓ 7 callersFunctionLoadFromJsonStringWithCallback
(m *RWMap[K, V], jsonStr string, onSuccess func())
types/rw_map.go:83
↓ 7 callersFunctionModelPriceHelper
(c *gin.Context, info *relaycommon.RelayInfo, promptTokens int, meta *types.TokenCountMeta)
relay/helper/price.go:73
↓ 7 callersFunctionNewOpenAIChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:56
↓ 7 callersFunctionOptionsOf
OptionsOf returns m's conversion options, or empty defaults when m is nil.
relaykit/relayconvert/convmeta/meta.go:210
↓ 7 callersFunctionParseHTTPStatusCodeRanges
(input string)
setting/operation_setting/status_code_ranges.go:117
↓ 7 callersFunctionPostConsumeUserSubscriptionDelta
Update subscription used amount by delta (positive consume more, negative refund).
model/subscription.go:1500
↓ 7 callersMethodRead
(p []byte)
common/body_storage.go:169
↓ 7 callersMethodRead
(p []byte)
relay/channel/openai/image_stream_test.go:152
↓ 7 callersMethodSetMetadata
(k string, v any)
relaykit/dto/openai_video.go:37
↓ 7 callersMethodSetWithTTL
(key string, v V, ttl time.Duration)
pkg/cachex/hybrid_cache.go:111
↓ 7 callersMethodToVideoStatus
()
model/task.go:17
↓ 7 callersMethodUsage
()
relaykit/relayconvert/response_registry.go:368
↓ 7 callersFunctionUserAuth
()
middleware/auth.go:92
↓ 7 callersFunctionUserUsableGroups2JSONString
()
setting/user_usable_group.go:27
↓ 7 callersFunctionUsingLogDatabase
(databaseType DatabaseType)
common/database.go:40
↓ 7 callersFunctionValidateLoginSession
(identity AuthIdentity)
service/auth_session.go:114
↓ 7 callersMethodWriteString
(s string)
middleware/audit.go:36
↓ 7 callersFunctionattachQuotaSaturation
attachQuotaSaturation records the request's quota clamp (if any) onto the consume log's other.admin_info and emits a request-correlated backend audit
service/log_info_generate.go:40
↓ 7 callersFunctionauthSigningKey
(purpose string)
service/auth_token.go:54
↓ 7 callersFunctioncreateUserSessionTestUser
(t *testing.T, userID int, authVersion int64)
model/user_session_test.go:66
← previousnext →301–400 of 9,514, ranked by callers