Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,592 in github.com/QuantumNous/new-api
⨍
Functions
15,592
◇
Types & classes
2,267
↓ 5 callers
Method
Apply
(query *gorm.DB)
model/channel.go:114
↓ 5 callers
Function
ApplyHeaderOverride
ApplyHeaderOverride applies the request plugins' header changes, then the channel overrides, after the adaptor's headers. Without a client request, on
relay/channel/api_request.go:303
↓ 5 callers
Method
ApplyOtherRatiosToFloat
(value float64)
types/price_data.go:93
↓ 5 callers
Method
ArgumentsString
ArgumentsString returns function call arguments in the string form expected by Chat Completions.
relaykit/dto/openai_response.go:564
↓ 5 callers
Method
BindsTaskPlugin
BindsTaskPlugin reports whether the channel is bound to the task plugin, either through the single binding or the New API extension list.
relaykit/dto/channel_settings.go:46
↓ 5 callers
Function
CacheGetRandomSatisfiedChannel
CacheGetRandomSatisfiedChannel tries to get a random channel that satisfies the requirements. 尝试获取一个满足要求的随机渠道。 For "auto" tokenGroup with cross-group
service/channel_select.go:119
↓ 5 callers
Method
CallConvertResponse
CallConvertResponse runs convertResponse(ctx, {status, headers, body}) on an upstream response of the route at hookCtx.Path, with bodyBase64 in place
pluginkit/provider.go:1076
↓ 5 callers
Method
CallLogin
CallLogin runs login(ctx, input). credential is the wrapper data when the administrator logs in again on an existing credential.
pluginkit/provider.go:297
↓ 5 callers
Method
CallMember
CallMember invokes a function stored on an exported object, such as a renderer in the renderers export.
pluginkit/engine.go:355
↓ 5 callers
Method
CanonicalModel
CanonicalModel returns the declared spelling for model. An exact byModel hit wins and returns the input unchanged; otherwise the ASCII-folded index is
pkg/jsplugin/routing.go:178
↓ 5 callers
Function
Capabilities
Capabilities returns the full resource/action matrix the subject is allowed.
service/authz/resolver.go:38
↓ 5 callers
Method
ChannelRelayRoute
ChannelRelayRoute is RelayRoute among the routes that serve a channel whose plugin_routes are toggles. Another route of the same path still matches wh
pluginkit/meta.go:308
↓ 5 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:42
↓ 5 callers
Function
ClearCurrentChannelAffinityCache
(c *gin.Context)
service/channel_affinity.go:651
↓ 5 callers
Method
Convert
(response *dto.ClaudeResponse, state *ResponseStreamState)
relaykit/relayconvert/response_compat.go:85
↓ 5 callers
Method
ConvertChunk
ConvertChunk accumulates OpenAI tool-call deltas until their choice ends. Gemini functionCall parts are atomic, so emitting each OpenAI arguments frag
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_resp.go:234
↓ 5 callers
Method
ConvertEmbeddingRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.EmbeddingRequest)
relay/channel/adapter.go:25
↓ 5 callers
Function
ConvertRequestByID
(c *gin.Context, info *relaycommon.RelayInfo, converter string, request any)
service/request_converter.go:34
↓ 5 callers
Function
CurrentRequestPolicy
()
model/request_policy.go:72
↓ 5 callers
Method
DatabaseTypeName
()
model/migration_dialector.go:112
↓ 5 callers
Function
DecodeEffects
DecodeEffects reads the effects array of prepareRequest from its JSON text: json.patch and header.patch. Unknown members are rejected.
pkg/requestpatch/patch.go:78
↓ 5 callers
Method
DecodePayload
(v any)
model/system_task.go:564
↓ 5 callers
Method
DefinedModes
DefinedModes returns each distinct mode on the protocol in host-table order.
pluginkit/routing.go:134
↓ 5 callers
Function
DeleteUserAccessToken
DeleteUserAccessToken hard-deletes one token owned by userID and returns the deleted row for auditing.
model/user_access_token.go:169
↓ 5 callers
Method
Diagnostics
Diagnostics returns every conversion-loss diagnostic observed so far. This remains available even when a source event produces no target stream chunk.
relaykit/relayconvert/response_registry.go:468
↓ 5 callers
Function
DispatchPlatformUpdate
DispatchPlatformUpdate 按平台分发轮询更新
service/task_polling.go:238
↓ 5 callers
Function
DoRequest
(c *gin.Context, req *http.Request, info *common.RelayInfo)
relay/channel/api_request.go:528
↓ 5 callers
Method
DoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:325
↓ 5 callers
Function
EnableWorker
()
setting/system_setting/system_setting_old.go:9
↓ 5 callers
Function
ErrOptionWithNoRecordErrorLog
()
relaykit/types/error.go:395
↓ 5 callers
Function
FinalizeChatCompletionsStreamToResponses
(state *ChatToResponsesStreamState)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:387
↓ 5 callers
Function
FormatRootLogs
FormatRootLogs normalizes legacy metadata into the current scoped shape without removing root-only diagnostics.
model/log.go:133
↓ 5 callers
Function
FreshPluginCredentialLine
FreshPluginCredentialLine returns the line a request about to use the credential line at keyIndex sends: the line, or its refresh when it expires with
service/provider_plugin.go:383
↓ 5 callers
Function
FromOpenAIResponses
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/reasoning/intent.go:513
↓ 5 callers
Function
GeminiTextGenerationHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini-native.go:21
↓ 5 callers
Function
GenRelayInfo
(c *gin.Context, relayFormat types.RelayFormat, request dto.Request, ws *websocket.Conn)
relay/common/relay_info.go:712
↓ 5 callers
Function
GetAudioCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:619
↓ 5 callers
Function
GetAudioRatio
(name string)
setting/ratio_setting/model_ratio.go:611
↓ 5 callers
Function
GetBuiltinBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:81
↓ 5 callers
Function
GetChannel
( group string, model string, retry int, filters []dto.ChannelFilter, )
model/ability.go:120
↓ 5 callers
Function
GetChannelPollingLock
GetChannelPollingLock returns or creates a mutex for the given channel ID
model/channel.go:704
↓ 5 callers
Function
GetConsoleSetting
GetConsoleSetting 获取 ConsoleSetting 配置实例
setting/console_setting/config.go:37
↓ 5 callers
Function
GetDiskCacheDir
GetDiskCacheDir 获取统一的磁盘缓存目录 注意:每次调用都会重新计算,以响应配置变化
common/disk_cache.go:25
↓ 5 callers
Function
GetEmailBinding
(identity AuthSessionIdentity, token string)
model/email_binding.go:59
↓ 5 callers
Function
GetEndpointTypesByChannelType
GetEndpointTypesByChannelType 获取渠道最优先端点类型(所有的渠道都支持 OpenAI 端点)
common/endpoint_type.go:6
↓ 5 callers
Method
GetErrorType
()
relaykit/types/error.go:119
↓ 5 callers
Function
GetGroupGroupRatio
(userGroup, usingGroup string)
setting/ratio_setting/group_ratio.go:88
↓ 5 callers
Function
GetJsonType
(data RawMessage)
common/json.go:106
↓ 5 callers
Function
GetLatestSystemTasks
(taskTypes []string)
model/system_task.go:308
↓ 5 callers
Method
GetMaskedKey
()
model/token.go:84
↓ 5 callers
Function
GetModelPricingIssues
GetModelPricingIssues reads the provider variants of the pricing snapshot for every model a live plugin declares and an enabled channel serves, and ev
model/model_pricing_config.go:382
↓ 5 callers
Method
GetName
GetName returns the display name of the provider (e.g., "GitHub", "Discord")
oauth/provider.go:13
↓ 5 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:22
↓ 5 callers
Function
GetSelfUserById
GetSelfUserById reads dashboard profile data and password existence in one query. The password hash and management access token are never selected.
model/user.go:523
↓ 5 callers
Method
GetStringSystem
()
relaykit/dto/claude.go:593
↓ 5 callers
Function
GetTokenById
(id int)
model/token.go:274
↓ 5 callers
Function
GetTokenByIds
(id int, userId int)
model/token.go:264
↓ 5 callers
Function
GetUserOAuthBindingsByUserId
GetUserOAuthBindingsByUserId returns all OAuth bindings for a user
model/user_oauth_binding.go:24
↓ 5 callers
Function
GetUserVerificationState
(userID int)
model/login_verification.go:23
↓ 5 callers
Function
HandleGroupRatio
HandleGroupRatio checks for "auto_group" in the context and updates the group ratio and relayInfo.UsingGroup if present
relay/helper/price.go:37
↓ 5 callers
Function
HandleStreamFinalResponse
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo)
relay/channel/claude/relay-claude.go:275
↓ 5 callers
Method
HasCallablePath
HasCallablePath reports whether an exported value, or a nested member below it, exists and is callable.
pluginkit/engine.go:281
↓ 5 callers
Function
HashBackupCode
HashBackupCode 对备用码进行哈希
common/totp.go:110
↓ 5 callers
Function
HostProtocol
(name string)
pluginkit/routing.go:107
↓ 5 callers
Function
Icon
Icon returns the embedded sidecar logo for a factory plugin, if the plugin directory ships an icon.svg or icon.png next to plugin.js.
plugins/embed.go:51
↓ 5 callers
Method
IncreaseRetry
()
service/channel_select.go:69
↓ 5 callers
Method
IncrementFailedAttempts
IncrementFailedAttempts 增加失败尝试次数
model/twofa.go:84
↓ 5 callers
Method
Info
(context.Context, string, ...any)
model/user_session_migration_test.go:37
↓ 5 callers
Method
Init
Init initializes the limiter once. Repeated calls leave the first configuration unchanged.
common/rate-limit.go:82
↓ 5 callers
Function
InitializeExternalIdentityClaims
InitializeExternalIdentityClaims imports legacy Telegram bindings after the claim table is migrated. Existing duplicate ownership fails migration rath
model/external_identity_claim.go:121
↓ 5 callers
Method
Insert
()
model/subscription.go:242
↓ 5 callers
Function
IntentFromState
IntentFromState reconstructs a portable intent from host- or pivot-carried conversion state. A nil state is an empty intent.
relaykit/relayconvert/reasoning/intent.go:96
↓ 5 callers
Method
IsLocked
IsLocked 检查账户是否被锁定
model/twofa.go:137
↓ 5 callers
Function
IsPasskeyDomainOption
ServerAddress and origins participate because either can change an implicit RP ID.
model/passkey_option.go:46
↓ 5 callers
Function
IsRequestPolicyOption
(key string)
model/request_policy.go:61
↓ 5 callers
Function
JsonRawMessageToString
JsonRawMessageToString returns JSON strings as their decoded value and other JSON values as raw text.
relaykit/relayconvert/kitutil/json.go:112
↓ 5 callers
Method
KeywordFields
KeywordFields returns the names of the keywords format properties.
pluginkit/config_schema.go:455
↓ 5 callers
Function
ListModels
(c *gin.Context, modelType int)
controller/model.go:233
↓ 5 callers
Function
ListUserAccessTokens
(userID int)
model/user_access_token.go:112
↓ 5 callers
Function
LoadFileSource
LoadFileSource 加载文件源数据 这是统一的入口,会自动处理缓存和不同的来源类型
service/file_service.go:47
↓ 5 callers
Function
LoadOptionsFromDatabase
LoadOptionsFromDatabase applies every stored option. A failed read keeps the options in memory as they are.
model/option.go:200
↓ 5 callers
Function
MaskSensitiveInfo
MaskSensitiveInfo masks the upstream addresses in str and leaves every other URL and domain readable. upstreamURLs are the channel base URL and the UR
relaykit/relayconvert/kitutil/mask.go:102
↓ 5 callers
Function
MergeClaudeUsageNonZero
(current *ClaudeUsage, incoming *ClaudeUsage)
relaykit/dto/usage_merge.go:151
↓ 5 callers
Function
MergeExplicitAndSuffix
MergeExplicitAndSuffix combines structured request fields with a model-name alias or @ modifier. The model name wins wherever the two disagree: it is
relaykit/relayconvert/reasoning/intent.go:217
↓ 5 callers
Function
MergeGeminiUsageMetadataNonZero
MergeGeminiUsageMetadataNonZero overlays Gemini's cumulative usage snapshots: a later non-zero field overwrites the current value without dropping fie
relaykit/dto/usage_merge.go:224
↓ 5 callers
Function
MessageWithRequestId
(message string, id string)
common/utils.go:268
↓ 5 callers
Function
MigrateAuditLogs
MigrateAuditLogs also supports independently configured ClickHouse log stores. No TTL clause or usage-log cleanup integration is intentional.
model/audit_log.go:251
↓ 5 callers
Function
ModelFamily
ModelFamily classifies a model name, case-insensitively. Vendor prefixes and date suffixes are allowed (for example us.anthropic.claude-opus-4-7-v1:0)
tokenkit/tokenkit.go:31
↓ 5 callers
Function
NamespacedToolName
NamespacedToolName is the upstream function name of a tool declared in a Responses tool namespace: "<namespace>__<name>", or the bare name for the def
relaykit/relayconvert/convmeta/meta.go:118
↓ 5 callers
Function
NewChatToResponsesStreamState
(id string, model string)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:112
↓ 5 callers
Function
NewEstimatedGeminiChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:124
↓ 5 callers
Function
NewFileSourceFromData
(data string, mimeType string)
relaykit/types/file_source.go:134
↓ 5 callers
Function
NewGenericOAuthProvider
NewGenericOAuthProvider creates a new generic OAuth provider from config
oauth/generic.go:73
↓ 5 callers
Function
NewRWMap
()
types/rw_map.go:27
↓ 5 callers
Function
NewRequestId
()
common/utils.go:256
↓ 5 callers
Function
NewSystemTaskProgressReporter
NewSystemTaskProgressReporter returns a throttled progress callback bound to a running task. Handlers call it with (processed, total) as they iterate
service/system_task.go:479
↓ 5 callers
Function
NewUserSortOptions
(sortBy string, sortOrder string)
model/user.go:36
↓ 5 callers
Function
NormalizeResponsesWebSearchAction
NormalizeResponsesWebSearchAction validates and canonicalizes the current Responses web_search_call action union. Claude emits {"query": ...}; the Res
relaykit/dto/openai_response.go:495
↓ 5 callers
Function
NotifyChannelWatchers
NotifyChannelWatchers sends a channel notice (a channel disabled or enabled automatically, or a test of all channels finished) to every administrator
service/user_notify.go:21
↓ 5 callers
Function
OaiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:105
← previous
next →
1,301–1,400 of 15,592, ranked by callers