Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,514 in github.com/QuantumNous/new-api
⨍
Functions
9,514
◇
Types & classes
1,507
↓ 3 callers
Function
OaiResponsesToChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:188
↓ 3 callers
Method
ParseContent
()
relaykit/dto/openai_request.go:543
↓ 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
Method
ParseSystem
()
relaykit/dto/claude.go:480
↓ 3 callers
Method
ParseTaskResult
(respBody []byte)
relay/channel/adapter.go:79
↓ 3 callers
Function
PaymentReturnURL
(suffix string)
service/return_path.go:9
↓ 3 callers
Function
PostAudioConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent string)
service/quota.go:282
↓ 3 callers
Method
ProcessEvent
(event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:582
↓ 3 callers
Function
QuotaFromFloatChecked
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 callers
Function
RecordOperationAuditLog
RecordOperationAuditLog 记录管理/高危操作审计日志(type=LogTypeManage)。 logUserId 为日志归属者,管理审计日志应归属实际操作者;目标资源/用户放入 action params。username 内部按 logUserId 查询。content 为
model/log.go:229
↓ 3 callers
Function
RecordTaskBillingLog
(params RecordTaskBillingLogParams)
model/log.go:419
↓ 3 callers
Function
Redeem
(key string, userId int)
model/redemption.go:137
↓ 3 callers
Function
RedisDelKey
(key string)
common/redis.go:99
↓ 3 callers
Function
RedisHGetObj
(key string, obj interface{})
common/redis.go:161
↓ 3 callers
Function
RefreshCodexChannelCredential
(ctx context.Context, channelID int, opts CodexCredentialRefreshOptions)
service/codex_credential_refresh.go:42
↓ 3 callers
Function
RefreshCodexOAuthTokenWithProxy
(ctx context.Context, refreshToken string, proxyURL string)
service/codex_oauth.go:33
↓ 3 callers
Function
RefreshPricing
RefreshPricing 强制立即重新计算与定价相关的缓存。 该方法用于需要最新数据的内部管理 API, 因此会绕过默认的 1 分钟延迟刷新。
model/pricing_refresh.go:6
↓ 3 callers
Function
RequireSecurityProof
RequireSecurityProof validates a proof against the authenticated dashboard session and writes the shared proof error contract on failure.
middleware/secure_verification.go:26
↓ 3 callers
Function
ResponseOpenAI2Claude
(openAIResponse *dto.OpenAITextResponse, info convmeta.Meta)
relaykit/relayconvert/response_compat.go:23
↓ 3 callers
Function
ResponsesFinishReasonFromStatus
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:38
↓ 3 callers
Function
ResponsesStreamEventToChatChunks
(event *dto.ResponsesStreamResponse, state *ResponsesToChatStreamState)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:71
↓ 3 callers
Function
RevokeByRefreshToken
(rawRefreshToken, expectedSID, reason string)
service/auth_session.go:263
↓ 3 callers
Function
RevokeOtherUserSessions
(userID int, currentSID, reason string)
model/user_session.go:704
↓ 3 callers
Function
RevokeUserSessionByRefreshHash
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 callers
Function
RoleSubject
RoleSubject is the casbin subject string for a role.
service/authz/permission.go:25
↓ 3 callers
Function
RootUserExists
()
model/user.go:1413
↓ 3 callers
Function
RotateUserSessionRefresh
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 callers
Function
SaveQuotaDataCache
()
model/usedata.go:100
↓ 3 callers
Function
SearchModels
(keyword string, vendor string, status string, syncOfficial string, offset int, limit int)
model/model_meta.go:194
↓ 3 callers
Method
SetReasoningContent
(s string)
relaykit/dto/openai_response.go:117
↓ 3 callers
Method
SetReasoningEffort
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 callers
Method
SetStringContent
(content string)
relaykit/dto/openai_request.go:525
↓ 3 callers
Function
SetUserAuthVersionFence
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 callers
Function
SetUserPermissionsInTx
(tx *gorm.DB, userID int, permissions PermissionsMap)
service/authz/override.go:42
↓ 3 callers
Method
SetupRequestHeader
(c *gin.Context, header *http.Header, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:241
↓ 3 callers
Function
ShouldRetryByStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:80
↓ 3 callers
Function
StrToMap
(str string)
common/str.go:47
↓ 3 callers
Function
StringsContains
(strs []string, str string)
common/str.go:83
↓ 3 callers
Method
Summary
()
relay/common/stream_status.go:97
↓ 3 callers
Method
SupplementResponseOutput
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:612
↓ 3 callers
Method
SupportsPathForModel
SupportsPathForModel reports whether any route matches requestPath and model.
relaykit/dto/channel_settings.go:203
↓ 3 callers
Function
TaskBulkUpdateByID
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 callers
Method
ToClaudeError
()
relaykit/types/error.go:213
↓ 3 callers
Function
TrimEffortSuffixWithSuffixes
(modelName string, suffixes []string)
relaykit/relayconvert/reasoning/suffix.go:20
↓ 3 callers
Method
TryLock
()
controller/user.go:1332
↓ 3 callers
Function
UpdateModelRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:384
↓ 3 callers
Function
UpdateOption
(c *gin.Context)
controller/option.go:124
↓ 3 callers
Function
UpdatePasskeyAssertionState
UpdatePasskeyAssertionState persists only fields produced by a successful assertion. Registration identity (credential ID, public key, AAGUID, transpo
model/passkey.go:164
↓ 3 callers
Function
UpdatePendingTopUpStatus
(tradeNo string, expectedPaymentProvider string, targetStatus string)
model/topup.go:82
↓ 3 callers
Method
ValidateBackupCodeAndUpdateUsage
ValidateBackupCodeAndUpdateUsage 验证备用码并更新使用记录
model/twofa.go:366
↓ 3 callers
Method
ValidateResolvedIP
ValidateResolvedIP validates a domain's resolved IP immediately before dialing it.
common/ssrf_protection.go:319
↓ 3 callers
Function
ValidateToolPricesJSON
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 callers
Function
ValidateURLWithFetchSetting
ValidateURLWithFetchSetting 使用FetchSetting配置验证URL
common/ssrf_protection.go:380
↓ 3 callers
Function
VerifyCodeWithKey
(key string, code string, purpose string)
common/verification.go:47
↓ 3 callers
Method
WriteHeaders
(originModel string, httpHeader *http.Header)
setting/model_setting/claude.go:53
↓ 3 callers
Function
allFormats
--------------------------------------------------------------------------- Tests --------------------------------------------------------------------
relaykit/relayconvert/golden_test.go:300
↓ 3 callers
Function
apiKeyHeaderAuth
()
web/src/features/channels/lib/advanced-custom.ts:208
↓ 3 callers
Function
applyAuthTemplate
(template string, apiKey string)
relay/channel/advancedcustom/adaptor.go:509
↓ 3 callers
Function
applyExplicitLogTextFilter
(tx *gorm.DB, column string, value string)
model/log.go:19
↓ 3 callers
Function
applyHeaderOverrideToRequest
(req *http.Request, headerOverride map[string]string)
relay/channel/api_request.go:294
↓ 3 callers
Function
applyUpstreamContentLength
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 callers
Function
asGeminiChatResponse
(response any)
relaykit/relayconvert/response_registry.go:1088
↓ 3 callers
Function
asOAIChatResponse
(response any)
relaykit/relayconvert/response_registry.go:1033
↓ 3 callers
Function
asOAIChatStreamResponse
(response any)
relaykit/relayconvert/response_registry.go:1044
↓ 3 callers
Function
assignDisplayLogIds
(logs []*Log, startIdx int)
model/log.go:110
↓ 3 callers
Function
auditOperatorInfo
auditOperatorInfo 从上下文构建操作者身份信息(管理员 id/用户名/角色)。
controller/audit.go:69
↓ 3 callers
Function
authFlowTokenHash
(token string)
model/auth_flow.go:92
↓ 3 callers
Function
authHelper
(c *gin.Context, minRole int)
middleware/auth.go:45
↓ 3 callers
Function
awsStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, a *Adaptor)
relay/channel/aws/relay-aws.go:260
↓ 3 callers
Function
bearerHeaderAuth
()
web/src/features/channels/lib/advanced-custom.ts:202
↓ 3 callers
Function
buildAlphaSearchRequestBody
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 callers
Function
buildChannelAffinityCacheKeySuffix
(rule operation_setting.ChannelAffinityRule, modelName string, usingGroup string, affinityValue string)
service/channel_affinity.go:337
↓ 3 callers
Function
buildChannelAffinityStatsContextForTest
(ruleName, usingGroup, keyFP string)
service/channel_affinity_usage_cache_test.go:15
↓ 3 callers
Function
buildFormDefaults
(defaults: FlatOAuthDefaults)
web/src/features/system-settings/auth/oauth-section.tsx:178
↓ 3 callers
Function
buildLogLikeCondition
(column string, value string)
model/log.go:33
↓ 3 callers
Function
buildMessageDeltaPatchUsage
(claudeResponse *dto.ClaudeResponse, claudeInfo *ClaudeResponseInfo)
relay/channel/claude/relay-claude.go:64
↓ 3 callers
Function
buildOAuthCallbackUrl
( serverAddress: string, callbackPath: string, fallback: string )
web/src/features/system-settings/auth/oauth-callback-url.ts:27
↓ 3 callers
Function
buildOpenAIModel
(modelName string, ownerByModel map[string]string)
controller/model.go:154
↓ 3 callers
Function
buildSelfUserData
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 callers
Function
buildUsageFromGeminiResponse
(c *gin.Context, info *relaycommon.RelayInfo, response *dto.GeminiChatResponse)
relay/channel/gemini/relay-gemini.go:91
↓ 3 callers
Function
cacheGetTokenByKey
CacheGetTokenByKey 从缓存中获取 token,如果缓存中不存在,则从数据库中获取
model/token_cache.go:53
↓ 3 callers
Function
cacheGetUserBase
(userId int)
model/user_cache.go:123
↓ 3 callers
Function
cacheIncrUserQuota
Add atomic quota operations using hash fields
model/user_cache.go:147
↓ 3 callers
Method
cacheKeyPart
()
service/http_transport_policy.go:85
↓ 3 callers
Function
calculateAudioQuota
(info QuotaInfo)
service/quota.go:50
↓ 3 callers
Function
chartRecordValue
(value: unknown)
web/src/features/dashboard/components/flow/flow-charts.tsx:177
↓ 3 callers
Function
checkAndPersistChannelUpstreamModelUpdates
( channel *model.Channel, settings *dto.ChannelOtherSettings, force bool, allowAutoApply bool, )
controller/channel_upstream_update.go:474
↓ 3 callers
Function
checkGolden
(t *testing.T, name string, got []byte)
relaykit/relayconvert/golden_test.go:63
↓ 3 callers
Function
checkIsActive
( href: string, item: NavItem, mainNav = false )
web/src/components/layout/lib/url-utils.ts:57
↓ 3 callers
Function
checkUpdatePassword
(originalPassword string, newPassword string, userId int)
controller/user.go:934
↓ 3 callers
Function
chooseDB
(envName string, isLog bool)
model/main.go:127
↓ 3 callers
Function
chooseStatus
(primary, fallback int)
controller/model_sync.go:488
↓ 3 callers
Function
clamp
(v: number)
web/src/features/channels/components/numeric-spinner-input.tsx:59
↓ 3 callers
Function
clickHouseLogTTLExpression
(ttlDays int)
model/main.go:422
↓ 3 callers
Function
cloneRequestConverterSpec
(spec RequestConverterSpec)
relaykit/relayconvert/request_registry.go:371
↓ 3 callers
Function
cloneStringMap
(src map[string]string)
relay/helper/billing_expr_request.go:79
↓ 3 callers
Function
collectPendingUpstreamModelChangesFromModels
( localModels []string, upstreamModels []string, ignoredModels []string, modelMapping map[string]string, )
controller/channel_upstream_update.go:179
↓ 3 callers
Function
combineBillingExpr
( baseExpr: string, requestRuleExpr: string )
web/src/features/pricing/lib/billing-expr.ts:565
↓ 3 callers
Function
compareAny
(left any, right any)
oauth/generic.go:534
↓ 3 callers
Function
compileFromCacheByHash
(exprStr, hash string)
pkg/billingexpr/compile.go:87
← previous
next →
1,001–1,100 of 9,514, ranked by callers