Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,195 in github.com/QuantumNous/new-api
⨍
Functions
9,195
◇
Types & classes
1,481
↓ 2 callers
Function
IsChannelEnabledForGroupModel
(group string, modelName string, channelID int)
model/channel_satisfy.go:8
↓ 2 callers
Function
IsChannelError
(err *NewAPIError)
types/error.go:366
↓ 2 callers
Function
IsCustomProvider
IsCustomProvider checks if a provider is a custom provider
oauth/registry.go:83
↓ 2 callers
Method
IsDisk
IsDisk 是否是磁盘存储
common/body_storage.go:22
↓ 2 callers
Method
IsEnabled
IsEnabled returns whether this OAuth provider is enabled
oauth/provider.go:16
↓ 2 callers
Function
IsExposeRatioEnabled
()
setting/ratio_setting/expose_ratio.go:15
↓ 2 callers
Function
IsGeminiModelSupportImagine
(model string)
setting/model_setting/gemini.go:71
↓ 2 callers
Method
IsIPAccessAllowed
IsIPAccessAllowed 检查IP是否允许访问
common/ssrf_protection.go:255
↓ 2 callers
Function
IsIpInCIDRList
(ip net.IP, cidrList []string)
common/ip.go:33
↓ 2 callers
Function
IsModelNameDuplicated
(id int, name string)
model/model_meta.go:68
↓ 2 callers
Function
IsOpenAIGPT5Model
(modelName string)
dto/openai_request.go:222
↓ 2 callers
Function
IsPrefillGroupNameDuplicated
IsPrefillGroupNameDuplicated 检查组名称是否重复(排除自身 ID)
model/prefill_group.go:96
↓ 2 callers
Function
IsProviderRegistered
IsProviderRegistered checks if a provider is registered
oauth/registry.go:75
↓ 2 callers
Function
IsProviderUserIdTaken
IsProviderUserIdTaken checks if a provider user ID is already bound to any user
model/user_oauth_binding.go:57
↓ 2 callers
Function
IsRunningInContainer
IsRunningInContainer detects if the application is running inside a container
common/utils.go:97
↓ 2 callers
Function
IsSlugTaken
IsSlugTaken checks if a slug is already taken by another provider Returns true on DB errors (fail-closed) to prevent slug conflicts
model/custom_oauth_provider.go:134
↓ 2 callers
Function
IsSupported
IsSupported checks if a language code is supported
i18n/i18n.go:223
↓ 2 callers
Method
IsURL
()
types/file_source.go:14
↓ 2 callers
Method
IsUserIDTaken
IsUserIDTaken checks if the provider user ID is already associated with an account
oauth/provider.go:26
↓ 2 callers
Function
IsVendorNameDuplicated
IsVendorNameDuplicated 检查供应商名称是否重复(排除自身 ID)
model/vendor_meta.go:35
↓ 2 callers
Function
IsWeChatIdAlreadyTaken
(wechatId string)
model/user.go:1052
↓ 2 callers
Function
JSONString
(raw json.RawMessage)
service/relayconvert/internal/oai_responses/to_oai_chat_req.go:547
↓ 2 callers
Function
JsonRawMessageToString
JsonRawMessageToString returns JSON strings as their decoded value and other JSON values as raw text.
common/json.go:48
↓ 2 callers
Method
ListDeployments
ListDeployments retrieves a list of deployments with optional filtering
pkg/ionet/deployment.go:56
↓ 2 callers
Function
ListWaffoPancakeCatalog
ListWaffoPancakeCatalog queries Pancake's GraphQL `stores` for the merchant's stores + onetime products. A successful call also proves the supplied cr
service/waffo_pancake.go:436
↓ 2 callers
Function
LoadCustomProviders
LoadCustomProviders loads all custom OAuth providers from the database
oauth/registry.go:90
↓ 2 callers
Function
LoadToolPricesFromJSONString
LoadToolPricesFromJSONString replaces the complete operator price map. Invalid legacy entries are ignored individually so valid sibling overrides surv
setting/operation_setting/tools.go:137
↓ 2 callers
Function
MarkSystemTaskLeaseExpired
(taskID string)
model/system_task.go:348
↓ 2 callers
Method
MatchPattern
()
pkg/cachex/namespace.go:32
↓ 2 callers
Function
ModelPrice2JSONString
()
setting/ratio_setting/model_ratio.go:351
↓ 2 callers
Function
ModelRatio2JSONString
()
setting/ratio_setting/model_ratio.go:651
↓ 2 callers
Function
NewClientWithConfig
NewClientWithConfig creates a new IO.NET API client with custom configuration
pkg/ionet/client.go:84
↓ 2 callers
Function
NewDiskCachedData
(diskPath string, mimeType string, size int64)
types/file_source.go:171
↓ 2 callers
Function
NewEnterpriseClient
NewEnterpriseClient creates a new IO.NET API client targeting the enterprise API base URL.
pkg/ionet/client.go:74
↓ 2 callers
Function
NewGenericOAuthProvider
NewGenericOAuthProvider creates a new generic OAuth provider from config
oauth/generic.go:74
↓ 2 callers
Function
NewMemoryCachedData
(base64Data string, mimeType string, size int64)
types/file_source.go:162
↓ 2 callers
Function
NewMessage
(msgType MsgType, flag MsgTypeFlagBits)
relay/channel/volcengine/protocols.go:245
↓ 2 callers
Function
NewProxyHttpClient
NewProxyHttpClient is kept for compatibility. Deprecated: use GetHttpClientWithProxy.
service/http_client.go:308
↓ 2 callers
Function
NewResponsesBufferedAccumulator
()
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:573
↓ 2 callers
Function
NormalizeBackupCode
NormalizeBackupCode 标准化备用码格式
common/totp.go:100
↓ 2 callers
Function
NormalizeBillingPreference
NormalizeBillingPreference clamps the billing preference to valid values.
common/str.go:121
↓ 2 callers
Function
NormalizeCacheCreationSplit
(totalTokens int, tokens5m int, tokens1h int)
service/relayconvert/internal/oai_chat/to_claude_messages_resp.go:70
↓ 2 callers
Function
NormalizeChannelGroupFilter
(group string)
model/channel.go:132
↓ 2 callers
Function
OaiChatToResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/responses_via_chat.go:65
↓ 2 callers
Function
OaiResponsesCompactionHandler
(c *gin.Context, resp *http.Response)
relay/channel/openai/relay_responses_compact.go:15
↓ 2 callers
Function
OaiResponsesToChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:188
↓ 2 callers
Function
ObjectValue
(value any, fallbackKey string)
service/relayconvert/internal/oai_responses/req_helpers.go:165
↓ 2 callers
Function
OpenAIChatRequestToClaudeMessages
(c *gin.Context, textRequest dto.GeneralOpenAIRequest)
service/relayconvert/request_compat.go:19
↓ 2 callers
Function
OpenAIResponsesRequestFromAny
(request any)
service/relayconvert/internal/oai_responses/req_helpers.go:25
↓ 2 callers
Function
PROFILE_BY_NAME
(name: string)
web/src/features/pricing/lib/mock-stats.ts:229
↓ 2 callers
Function
ParseAcceptLanguage
ParseAcceptLanguage parses the Accept-Language header and returns the preferred language
i18n/i18n.go:180
↓ 2 callers
Function
ParseDeepSeekV4ThinkingSuffix
(modelName string)
setting/reasoning/suffix.go:38
↓ 2 callers
Function
ParseExprVersion
ParseExprVersion extracts the version tag and body from an expression string. Format: "v1:tier(...)" → version=1, body="tier(...)". No prefix defaults
pkg/billingexpr/compile.go:22
↓ 2 callers
Function
ParseMultipartFormReusable
(c *gin.Context)
common/gin.go:255
↓ 2 callers
Function
ParseOAuthKey
(raw string)
relay/channel/codex/oauth_key.go:21
↓ 2 callers
Function
ParseProxyURLStrict
ParseProxyURLStrict validates and normalizes a proxy URL for persistence.
common/proxy_url.go:12
↓ 2 callers
Function
PermissionsForRole
PermissionsForRole returns the permissions whose DefaultRoles include roleKey.
service/authz/registry.go:54
↓ 2 callers
Function
PingData
(c *gin.Context)
relay/helper/common.go:110
↓ 2 callers
Function
PreConsumeTokenQuota
(relayInfo *relaycommon.RelayInfo, quota int)
service/quota.go:387
↓ 2 callers
Function
ProcessStreamResponse
(streamResponse dto.ChatCompletionsStreamResponse, responseTextBuilder *strings.Builder, toolCount *int)
relay/channel/openai/helper.go:93
↓ 2 callers
Function
QuotaFromDecimalChecked
QuotaFromDecimalChecked is QuotaFromDecimal but also returns a non-nil *QuotaClamp when the value was clamped, so billing callers can audit it.
common/quota_math.go:145
↓ 2 callers
Function
QuotaRound
QuotaRound converts a float64 quota value to int using half-away-from-zero rounding, with saturation. Every tiered billing path (pre-consume, settleme
common/quota_math.go:119
↓ 2 callers
Function
RawJSONPresent
(raw json.RawMessage)
service/relayconvert/internal/oai_responses/to_oai_chat_req.go:551
↓ 2 callers
Function
ReasoningEffort
(req *dto.OpenAIResponsesRequest)
service/relayconvert/internal/oai_responses/req_helpers.go:138
↓ 2 callers
Function
RechargeWaffoPancake
(tradeNo string)
model/topup.go:530
↓ 2 callers
Function
RedisHIncrBy
(key, field string, delta int64)
common/redis.go:275
↓ 2 callers
Function
RedisHSetField
(key, field string, value interface{})
common/redis.go:302
↓ 2 callers
Function
RedisKeyCacheSeconds
()
common/redis.go:19
↓ 2 callers
Function
RefreshLoginSession
(rawRefreshToken, expectedSID, ip, userAgent string)
service/auth_session.go:201
↓ 2 callers
Function
RefreshTokenSID
(rawRefreshToken string)
service/auth_session.go:275
↓ 2 callers
Method
Refund
Refund 退还所有预扣费额度(资金来源 + 令牌),幂等安全。 通过 gopool 异步执行。如果已经结算或退款则不做任何操作。
relay/common/billing.go:14
↓ 2 callers
Function
RegisterOrUpdateCustomProvider
RegisterOrUpdateCustomProvider registers or updates a single custom provider
oauth/registry.go:123
↓ 2 callers
Function
RegisterSystemTaskHandler
RegisterSystemTaskHandler registers a handler keyed by its Type(). It must be called before StartSystemTaskRunner (or any time, since the runner snaps
service/system_task.go:57
↓ 2 callers
Function
RegisterVerificationCodeWithKey
(key string, code string, purpose string)
common/verification.go:35
↓ 2 callers
Function
Relay
(c *gin.Context, relayFormat types.RelayFormat)
controller/relay.go:70
↓ 2 callers
Function
ReleaseExternalIdentityWithTx
(tx *gorm.DB, provider string, userId int)
model/external_identity_claim.go:70
↓ 2 callers
Function
ReleaseSystemTaskLock
(taskID string, lockedBy string)
model/system_task.go:378
↓ 2 callers
Method
RemoveFilteredPolicy
(_ string, ptype string, fieldIndex int, fieldValues ...string)
service/authz/adapter.go:73
↓ 2 callers
Method
RemoveOtherRatiosFromFloat
(value float64)
types/price_data.go:97
↓ 2 callers
Function
RenewSystemTaskLock
(taskID string, lockedBy string, lockUntil int64)
model/system_task.go:331
↓ 2 callers
Function
ReplaceBackupCodesWithAuthVersion
ReplaceBackupCodesWithAuthVersion atomically replaces the factor's recovery credentials and advances the user's authentication version.
model/twofa.go:217
↓ 2 callers
Function
RequestFunctionDeclarations
(raw []byte)
service/relayconvert/internal/oai_responses/req_helpers.go:127
↓ 2 callers
Function
RequestToolChoiceToChat
(raw json.RawMessage)
service/relayconvert/internal/oai_responses/to_oai_chat_req.go:388
↓ 2 callers
Function
RerankHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/common_handler/rerank.go:19
↓ 2 callers
Function
ResetDiskCacheStats
ResetDiskCacheStats 重置命中统计信息(不重置当前使用量)
common/disk_cache_config.go:147
↓ 2 callers
Function
ResolveIncomingBillingExprRequestInput
(c *gin.Context, info *relaycommon.RelayInfo)
relay/helper/billing_expr_request.go:13
↓ 2 callers
Function
ResponseClaude2OpenAI
(claudeResponse *dto.ClaudeResponse)
service/relayconvert/response_compat.go:39
↓ 2 callers
Function
ResponseGeminiChat2OpenAI
(id string, created int64, response *dto.GeminiChatResponse)
service/relayconvert/response_compat.go:75
↓ 2 callers
Function
ResponseOpenAI2Claude
(openAIResponse *dto.OpenAITextResponse, info *relaycommon.RelayInfo)
service/relayconvert/internal/oai_chat/to_claude_messages_resp.go:435
↓ 2 callers
Function
ResponseOpenAI2Gemini
(openAIResponse *dto.OpenAITextResponse, info *relaycommon.RelayInfo)
service/relayconvert/response_compat.go:63
↓ 2 callers
Function
ResponsesResponseToChatCompletionsResponse
(resp *dto.OpenAIResponsesResponse, id string)
service/relayconvert/response_compat.go:111
↓ 2 callers
Function
ResponsesStatusFromChatFinishReason
(finishReason string)
service/relayconvert/internal/oai_chat/to_oai_responses_resp.go:100
↓ 2 callers
Function
RootAuth
()
middleware/auth.go:104
↓ 2 callers
Function
RunExprByHashWithRequest
(exprStr, hash string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:43
↓ 2 callers
Function
RunTaskPollingOnce
RunTaskPollingOnce performs one async-task (Suno/video) polling pass synchronously. It honors ctx cancellation (the system-task runner cancels it when
service/task_polling.go:107
↓ 2 callers
Function
SearchRedemptions
(keyword string, status string, startIdx int, num int)
model/redemption.go:63
↓ 2 callers
Function
SearchUsers
(keyword string, group string, role *int, status *int, startIdx int, num int, sortOptions ...UserSortOptions)
model/user.go:384
↓ 2 callers
Function
SensitiveWordContains
SensitiveWordContains 是否包含敏感词,返回是否包含敏感词和敏感词列表
service/sensitive.go:40
↓ 2 callers
Method
SetAccessToken
(token string)
model/user.go:138
↓ 2 callers
Function
SetApiRouter
(router *gin.Engine)
router/api-router.go:14
← previous
next →
1,401–1,500 of 9,195, ranked by callers