MCPcopy Create free account

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

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

↓ 3 callersFunctionGetUniqueUserByEmail
(email string)
model/user.go:1033
↓ 3 callersMethodGetWeight
()
model/channel.go:490
↓ 3 callersFunctionHandleClaudeResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, httpResp *http.Response, data []
relay/channel/claude/relay-claude.go:217
↓ 3 callersFunctionHandleGroupRatio
HandleGroupRatio checks for "auto_group" in the context and updates the group ratio and relayInfo.UsingGroup if present
relay/helper/price.go:44
↓ 3 callersFunctionHardDeleteUserById
(id int)
model/user.go:484
↓ 3 callersMethodHasImage
()
relay/common/relay_utils.go:23
↓ 3 callersMethodIncrementFailedAttempts
IncrementFailedAttempts 增加失败尝试次数
model/twofa.go:132
↓ 3 callersMethodInsert
Insert 创建新的供应商记录
model/vendor_meta.go:27
↓ 3 callersFunctionIsAlwaysSkipRetryStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:70
↓ 3 callersFunctionIsDiskCacheAvailable
IsDiskCacheAvailable 检查是否可以创建新的磁盘缓存
common/disk_cache_config.go:170
↓ 3 callersMethodIsLocked
IsLocked 检查账户是否被锁定
model/twofa.go:180
↓ 3 callersFunctionIsOpenAIReasoningOModel
(modelName string)
dto/openai_request.go:216
↓ 3 callersFunctionIsRequestBodyTooLargeError
(err error)
common/gin.go:25
↓ 3 callersFunctionIsSkipRetryError
(err *NewAPIError)
types/error.go:373
↓ 3 callersMethodIsStream
(c *gin.Context)
dto/request_common.go:10
↓ 3 callersMethodItems
Items 返回 Set 中所有元素组成的切片 注意:由于 map 的无序性,返回的切片元素顺序是随机的
types/set.go:36
↓ 3 callersFunctionListActiveUserSessions
(userID int, currentSID string, now int64)
model/user_session.go:395
↓ 3 callersFunctionLoadFromJsonString
(m *RWMap[K, V], jsonStr string)
types/rw_map.go:77
↓ 3 callersFunctionLocalLogPreview
LocalLogPreview limits log-only content unless debug logging is enabled.
common/str.go:27
↓ 3 callersFunctionLogJson
LogJson 仅供测试使用 only for test
logger/logger.go:176
↓ 3 callersFunctionLogQuotaData
(params QuotaDataLogParams)
model/usedata.go:78
↓ 3 callersFunctionLookupRequestConverter
(converter string)
service/relayconvert/request_registry.go:140
↓ 3 callersMethodModelListRoute
ModelListRoute returns the explicitly configured OpenAI Models discovery route. Template routes that merely happen to match /v1/models are not discove
dto/channel_settings.go:152
↓ 3 callersFunctionModelPriceHelperPerCall
ModelPriceHelperPerCall 按次/按量计费的 PriceHelper (MJ、Task)
relay/helper/price.go:186
↓ 3 callersFunctionNewChannelSortOptions
(sortBy string, sortOrder string, idSort bool)
model/channel.go:87
↓ 3 callersFunctionNewRequestId
()
common/utils.go:281
↓ 3 callersFunctionNewSSRFProtectionFromFetchSetting
NewSSRFProtectionFromFetchSetting builds an SSRFProtection from persisted fetch_setting values.
common/ssrf_protection.go:33
↓ 3 callersFunctionNewURLFileSource
--------------------------------------------------------------------------- Constructors -------------------------------------------------------------
types/file_source.go:123
↓ 3 callersMethodNormalizeDefaults
()
model/subscription.go:204
↓ 3 callersFunctionNormalizeOrigin
NormalizeOrigin validates and canonicalizes a browser origin. Only an exact scheme/host/effective-port match is meaningful; paths and wildcards are no
common/session_cookie.go:14
↓ 3 callersFunctionNotifyRootUser
(t string, subject string, content string)
service/user_notify.go:16
↓ 3 callersMethodParseContent
()
dto/openai_request.go:527
↓ 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
()
dto/claude.go:481
↓ 3 callersMethodParseTaskResult
(respBody []byte)
relay/channel/adapter.go:78
↓ 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)
service/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 *relaycommon.RelayInfo)
service/relayconvert/response_compat.go:23
↓ 3 callersFunctionResponsesFinishReasonFromStatus
(resp *dto.OpenAIResponsesResponse)
service/relayconvert/internal/oai_responses/to_oai_chat_resp.go:38
↓ 3 callersFunctionResponsesStreamEventToChatChunks
(event *dto.ResponsesStreamResponse, state *ResponsesToChatStreamState)
service/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)
dto/openai_response.go:117
↓ 3 callersMethodSetStringContent
(content string)
dto/openai_request.go:509
↓ 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:56
↓ 3 callersFunctionString2Int
(str string)
common/str.go:84
↓ 3 callersFunctionStringsContains
(strs []string, str string)
common/str.go:92
↓ 3 callersMethodSummary
()
relay/common/stream_status.go:97
↓ 3 callersMethodSupplementResponseOutput
(resp *dto.OpenAIResponsesResponse)
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:612
↓ 3 callersMethodSupportsPathForModel
SupportsPathForModel reports whether any route matches requestPath and model.
dto/channel_settings.go:171
↓ 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
()
types/error.go:213
↓ 3 callersFunctionTrimEffortSuffixWithSuffixes
(modelName string, suffixes []string)
setting/reasoning/suffix.go:20
↓ 3 callersMethodTryLock
()
controller/user.go:1332
↓ 3 callersFunctionUpdateModelRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:384
↓ 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 callersMethodValidateSettings
()
model/channel.go:946
↓ 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:51
↓ 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 callersFunctionasOAIChatResponse
(response any)
service/relayconvert/response_registry.go:983
↓ 3 callersFunctionasOAIChatStreamResponse
(response any)
service/relayconvert/response_registry.go:994
↓ 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 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:123
↓ 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
← previousnext →901–1,000 of 9,195, ranked by callers