MCPcopy Create free account

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

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

↓ 3 callersFunctionOaiResponsesToChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:188
↓ 3 callersMethodParseContent
()
relaykit/dto/openai_request.go:543
↓ 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 callersMethodParseSystem
()
relaykit/dto/claude.go:480
↓ 3 callersMethodParseTaskResult
(respBody []byte)
relay/channel/adapter.go:79
↓ 3 callersFunctionPaymentReturnURL
(suffix string)
service/return_path.go:9
↓ 3 callersFunctionPostAudioConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent string)
service/quota.go:282
↓ 3 callersMethodProcessEvent
(event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:582
↓ 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:105
↓ 3 callersFunctionRecordOperationAuditLog
RecordOperationAuditLog 记录管理/高危操作审计日志(type=LogTypeManage)。 logUserId 为日志归属者,管理审计日志应归属实际操作者;目标资源/用户放入 action params。username 内部按 logUserId 查询。content 为
model/log.go:229
↓ 3 callersFunctionRecordTaskBillingLog
(params RecordTaskBillingLogParams)
model/log.go:419
↓ 3 callersFunctionRedeem
(key string, userId int)
model/redemption.go:137
↓ 3 callersFunctionRedisDelKey
(key string)
common/redis.go:99
↓ 3 callersFunctionRedisHGetObj
(key string, obj interface{})
common/redis.go:161
↓ 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 callersFunctionRefreshPricing
RefreshPricing 强制立即重新计算与定价相关的缓存。 该方法用于需要最新数据的内部管理 API, 因此会绕过默认的 1 分钟延迟刷新。
model/pricing_refresh.go:6
↓ 3 callersFunctionRequireSecurityProof
RequireSecurityProof validates a proof against the authenticated dashboard session and writes the shared proof error contract on failure.
middleware/secure_verification.go:26
↓ 3 callersFunctionResponseOpenAI2Claude
(openAIResponse *dto.OpenAITextResponse, info convmeta.Meta)
relaykit/relayconvert/response_compat.go:23
↓ 3 callersFunctionResponsesFinishReasonFromStatus
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:38
↓ 3 callersFunctionResponsesStreamEventToChatChunks
(event *dto.ResponsesStreamResponse, state *ResponsesToChatStreamState)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:71
↓ 3 callersFunctionRevokeByRefreshToken
(rawRefreshToken, expectedSID, reason string)
service/auth_session.go:263
↓ 3 callersFunctionRevokeOtherUserSessions
(userID int, currentSID, reason string)
model/user_session.go:704
↓ 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:600
↓ 3 callersFunctionRoleSubject
RoleSubject is the casbin subject string for a role.
service/authz/permission.go:25
↓ 3 callersFunctionRootUserExists
()
model/user.go:1413
↓ 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:451
↓ 3 callersFunctionSaveQuotaDataCache
()
model/usedata.go:100
↓ 3 callersFunctionSearchModels
(keyword string, vendor string, status string, syncOfficial string, offset int, limit int)
model/model_meta.go:194
↓ 3 callersMethodSetReasoningContent
(s string)
relaykit/dto/openai_response.go:117
↓ 3 callersMethodSetReasoningEffort
SetReasoningEffort records the effort level a converter derived from a model-name suffix so downstream billing/logging can see it.
relaykit/relayconvert/convmeta/meta.go:30
↓ 3 callersMethodSetStringContent
(content string)
relaykit/dto/openai_request.go:525
↓ 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:129
↓ 3 callersFunctionSetUserPermissionsInTx
(tx *gorm.DB, userID int, permissions PermissionsMap)
service/authz/override.go:42
↓ 3 callersMethodSetupRequestHeader
(c *gin.Context, header *http.Header, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:241
↓ 3 callersFunctionShouldRetryByStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:80
↓ 3 callersFunctionStrToMap
(str string)
common/str.go:47
↓ 3 callersFunctionStringsContains
(strs []string, str string)
common/str.go:83
↓ 3 callersMethodSummary
()
relay/common/stream_status.go:97
↓ 3 callersMethodSupplementResponseOutput
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:612
↓ 3 callersMethodSupportsPathForModel
SupportsPathForModel reports whether any route matches requestPath and model.
relaykit/dto/channel_settings.go:203
↓ 3 callersFunctionTaskBulkUpdateByID
TaskBulkUpdateByID performs an unconditional bulk UPDATE by primary key IDs. WARNING: This function has NO CAS (Compare-And-Swap) guard — it will over
model/task.go:436
↓ 3 callersMethodToClaudeError
()
relaykit/types/error.go:213
↓ 3 callersFunctionTrimEffortSuffixWithSuffixes
(modelName string, suffixes []string)
relaykit/relayconvert/reasoning/suffix.go:20
↓ 3 callersMethodTryLock
()
controller/user.go:1332
↓ 3 callersFunctionUpdateModelRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:384
↓ 3 callersFunctionUpdateOption
(c *gin.Context)
controller/option.go:124
↓ 3 callersFunctionUpdatePasskeyAssertionState
UpdatePasskeyAssertionState persists only fields produced by a successful assertion. Registration identity (credential ID, public key, AAGUID, transpo
model/passkey.go:164
↓ 3 callersFunctionUpdatePendingTopUpStatus
(tradeNo string, expectedPaymentProvider string, targetStatus string)
model/topup.go:82
↓ 3 callersMethodValidateBackupCodeAndUpdateUsage
ValidateBackupCodeAndUpdateUsage 验证备用码并更新使用记录
model/twofa.go:366
↓ 3 callersMethodValidateResolvedIP
ValidateResolvedIP validates a domain's resolved IP immediately before dialing it.
common/ssrf_protection.go:319
↓ 3 callersFunctionValidateToolPricesJSON
ValidateToolPricesJSON validates an operator-supplied complete price map. A numeric zero is valid and intentionally disables the matching rule.
setting/operation_setting/tools.go:129
↓ 3 callersFunctionValidateURLWithFetchSetting
ValidateURLWithFetchSetting 使用FetchSetting配置验证URL
common/ssrf_protection.go:380
↓ 3 callersFunctionVerifyCodeWithKey
(key string, code string, purpose string)
common/verification.go:47
↓ 3 callersMethodWriteHeaders
(originModel string, httpHeader *http.Header)
setting/model_setting/claude.go:53
↓ 3 callersFunctionallFormats
--------------------------------------------------------------------------- Tests --------------------------------------------------------------------
relaykit/relayconvert/golden_test.go:300
↓ 3 callersFunctionapiKeyHeaderAuth
()
web/src/features/channels/lib/advanced-custom.ts:208
↓ 3 callersFunctionapplyAuthTemplate
(template string, apiKey string)
relay/channel/advancedcustom/adaptor.go:509
↓ 3 callersFunctionapplyExplicitLogTextFilter
(tx *gorm.DB, column string, value string)
model/log.go:19
↓ 3 callersFunctionapplyHeaderOverrideToRequest
(req *http.Request, headerOverride map[string]string)
relay/channel/api_request.go:294
↓ 3 callersFunctionapplyUpstreamContentLength
applyUpstreamContentLength populates req.ContentLength when the upstream body is wrapped in a BodyStorage (see relay/common/outbound_body.go). net/ht
relay/channel/api_request.go:36
↓ 3 callersFunctionasGeminiChatResponse
(response any)
relaykit/relayconvert/response_registry.go:1088
↓ 3 callersFunctionasOAIChatResponse
(response any)
relaykit/relayconvert/response_registry.go:1033
↓ 3 callersFunctionasOAIChatStreamResponse
(response any)
relaykit/relayconvert/response_registry.go:1044
↓ 3 callersFunctionassignDisplayLogIds
(logs []*Log, startIdx int)
model/log.go:110
↓ 3 callersFunctionauditOperatorInfo
auditOperatorInfo 从上下文构建操作者身份信息(管理员 id/用户名/角色)。
controller/audit.go:69
↓ 3 callersFunctionauthFlowTokenHash
(token string)
model/auth_flow.go:92
↓ 3 callersFunctionauthHelper
(c *gin.Context, minRole int)
middleware/auth.go:45
↓ 3 callersFunctionawsStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, a *Adaptor)
relay/channel/aws/relay-aws.go:260
↓ 3 callersFunctionbearerHeaderAuth
()
web/src/features/channels/lib/advanced-custom.ts:202
↓ 3 callersFunctionbuildAlphaSearchRequestBody
buildAlphaSearchRequestBody returns RawBody unchanged unless the model was mapped, in which case only the "model" field is rewritten so unknown fields
relay/alpha_search_handler.go:126
↓ 3 callersFunctionbuildChannelAffinityCacheKeySuffix
(rule operation_setting.ChannelAffinityRule, modelName string, usingGroup string, affinityValue string)
service/channel_affinity.go:337
↓ 3 callersFunctionbuildChannelAffinityStatsContextForTest
(ruleName, usingGroup, keyFP string)
service/channel_affinity_usage_cache_test.go:15
↓ 3 callersFunctionbuildFormDefaults
(defaults: FlatOAuthDefaults)
web/src/features/system-settings/auth/oauth-section.tsx:178
↓ 3 callersFunctionbuildLogLikeCondition
(column string, value string)
model/log.go:33
↓ 3 callersFunctionbuildMessageDeltaPatchUsage
(claudeResponse *dto.ClaudeResponse, claudeInfo *ClaudeResponseInfo)
relay/channel/claude/relay-claude.go:64
↓ 3 callersFunctionbuildOAuthCallbackUrl
( serverAddress: string, callbackPath: string, fallback: string )
web/src/features/system-settings/auth/oauth-callback-url.ts:27
↓ 3 callersFunctionbuildOpenAIModel
(modelName string, ownerByModel map[string]string)
controller/model.go:154
↓ 3 callersFunctionbuildSelfUserData
buildSelfUserData is the single safe dashboard-user DTO used by GetSelf, login and refresh. It intentionally excludes password, management PAT and adm
controller/user.go:515
↓ 3 callersFunctionbuildUsageFromGeminiResponse
(c *gin.Context, info *relaycommon.RelayInfo, response *dto.GeminiChatResponse)
relay/channel/gemini/relay-gemini.go:91
↓ 3 callersFunctioncacheGetTokenByKey
CacheGetTokenByKey 从缓存中获取 token,如果缓存中不存在,则从数据库中获取
model/token_cache.go:53
↓ 3 callersFunctioncacheGetUserBase
(userId int)
model/user_cache.go:123
↓ 3 callersFunctioncacheIncrUserQuota
Add atomic quota operations using hash fields
model/user_cache.go:147
↓ 3 callersMethodcacheKeyPart
()
service/http_transport_policy.go:85
↓ 3 callersFunctioncalculateAudioQuota
(info QuotaInfo)
service/quota.go:50
↓ 3 callersFunctionchartRecordValue
(value: unknown)
web/src/features/dashboard/components/flow/flow-charts.tsx:177
↓ 3 callersFunctioncheckAndPersistChannelUpstreamModelUpdates
( channel *model.Channel, settings *dto.ChannelOtherSettings, force bool, allowAutoApply bool, )
controller/channel_upstream_update.go:474
↓ 3 callersFunctioncheckGolden
(t *testing.T, name string, got []byte)
relaykit/relayconvert/golden_test.go:63
↓ 3 callersFunctioncheckIsActive
( href: string, item: NavItem, mainNav = false )
web/src/components/layout/lib/url-utils.ts:57
↓ 3 callersFunctioncheckUpdatePassword
(originalPassword string, newPassword string, userId int)
controller/user.go:934
↓ 3 callersFunctionchooseDB
(envName string, isLog bool)
model/main.go:127
↓ 3 callersFunctionchooseStatus
(primary, fallback int)
controller/model_sync.go:488
↓ 3 callersFunctionclamp
(v: number)
web/src/features/channels/components/numeric-spinner-input.tsx:59
↓ 3 callersFunctionclickHouseLogTTLExpression
(ttlDays int)
model/main.go:422
↓ 3 callersFunctioncloneRequestConverterSpec
(spec RequestConverterSpec)
relaykit/relayconvert/request_registry.go:371
↓ 3 callersFunctioncloneStringMap
(src map[string]string)
relay/helper/billing_expr_request.go:79
↓ 3 callersFunctioncollectPendingUpstreamModelChangesFromModels
( localModels []string, upstreamModels []string, ignoredModels []string, modelMapping map[string]string, )
controller/channel_upstream_update.go:179
↓ 3 callersFunctioncombineBillingExpr
( baseExpr: string, requestRuleExpr: string )
web/src/features/pricing/lib/billing-expr.ts:565
↓ 3 callersFunctioncompareAny
(left any, right any)
oauth/generic.go:534
↓ 3 callersFunctioncompileFromCacheByHash
(exprStr, hash string)
pkg/billingexpr/compile.go:87
← previousnext →1,001–1,100 of 9,514, ranked by callers