Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
↓ 1 callers
Method
SetResponsesToolState
(state *convmeta.ResponsesToolState)
relay/common/relay_info.go:959
↓ 1 callers
Method
SetRetry
(retry int)
service/channel_select.go:65
↓ 1 callers
Function
SetRouter
(router *gin.Engine, assets WebAssets)
router/main.go:15
↓ 1 callers
Method
SetStreamUsage
(*dto.Usage)
relaykit/relayconvert/response_registry.go:113
↓ 1 callers
Method
SetStringSystem
(system string)
relaykit/dto/claude.go:600
↓ 1 callers
Method
SetSystemFingerprint
(s string)
relaykit/dto/openai_response.go:212
↓ 1 callers
Method
SetTransports
(list []protocol.AuthenticatorTransport)
model/passkey.go:59
↓ 1 callers
Method
SetUsage
(usage *dto.Usage)
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_resp.go:386
↓ 1 callers
Method
SetUsage
(usage *dto.Usage)
relaykit/relayconvert/internal/oai_responses/to_claude_messages_stream_resp.go:65
↓ 1 callers
Method
Settle
Settle 根据实际消耗额度进行结算。 资金来源和令牌额度分两步提交:若资金来源已提交但令牌调整失败, 会标记 fundingSettled 防止 Refund 对已提交的资金来源执行退款。
service/billing_session.go:47
↓ 1 callers
Function
Sha1Raw
(data []byte)
common/hash.go:16
↓ 1 callers
Function
ShouldChatCompletionsUseResponsesPolicy
(policy model_setting.ChatCompletionsToResponsesPolicy, channelID int, channelType int, model string)
service/openai_chat_responses_mode.go:40
↓ 1 callers
Function
ShouldEnableChannel
(newAPIError *types.NewAPIError, status int)
service/channel.go:87
↓ 1 callers
Function
ShouldKeepChannelAffinityOnChannelDisabled
()
service/channel_affinity.go:675
↓ 1 callers
Function
ShouldUseDiskCache
ShouldUseDiskCache 判断是否应该使用磁盘缓存
common/disk_cache.go:167
↓ 1 callers
Function
Sign
(c *gin.Context, req *http.Request, apiKey string)
relay/channel/jimeng/sign.go:59
↓ 1 callers
Method
SignUpstreamRequest
(c *gin.Context, info *common.RelayInfo, method string, target *url.URL, header http.Header)
relay/channel/api_request.go:363
↓ 1 callers
Function
SoraSizeRatio
(size string)
setting/task_pricing_setting/config.go:31
↓ 1 callers
Function
StartAuthArtifactCleanup
StartAuthArtifactCleanup removes expired dashboard Sessions, old one-time authentication flows and access tokens that expired beyond the revoked sessi
service/auth_cleanup.go:15
↓ 1 callers
Function
StartCodexCredentialAutoRefreshTask
()
service/codex_credential_refresh_task.go:34
↓ 1 callers
Function
StartEmailBinding
(identity AuthIdentity, authorization *model.AuthFlowAuthorization, email string, lang string)
service/email_binding.go:57
↓ 1 callers
Function
StartLogCleanupTask
(targetTimestamp int64)
service/system_task.go:169
↓ 1 callers
Function
StartNodeSync
StartNodeSync records the revisions read at startup as applied, then every 3 seconds reloads each registered topic that has a newer sync task and writ
service/node_sync.go:123
↓ 1 callers
Function
StartPluginCredentialRefreshTask
StartPluginCredentialRefreshTask makes the master node refresh, every minute, the plugin credentials that expire within max(10 minutes, three channel
service/provider_plugin.go:467
↓ 1 callers
Function
StartPluginLogin
StartPluginLogin opens a plugin login flow on a channel.
controller/provider_plugin.go:70
↓ 1 callers
Function
StartPolicySync
StartPolicySync periodically reloads the authorization policy from the database. The enforcer keeps an in-memory snapshot, and permission changes are
service/authz/enforcer.go:84
↓ 1 callers
Function
StartPyroScope
()
common/pyro.go:9
↓ 1 callers
Function
StartSubscriber
(ctx context.Context)
pkg/wsmanager/wsmanager.go:113
↓ 1 callers
Function
StartSubscriptionQuotaResetTask
()
service/subscription_reset_task.go:28
↓ 1 callers
Function
StartSystemInstanceReporter
()
service/system_instance.go:71
↓ 1 callers
Function
StartSystemMonitor
StartSystemMonitor 启动系统监控
common/system_monitor.go:64
↓ 1 callers
Function
StartSystemTaskRunner
()
service/system_task.go:123
↓ 1 callers
Function
StatsMiddleware
StatsMiddleware 统计中间件
middleware/stats.go:17
↓ 1 callers
Function
StopReasonClaudeToOpenAI
(reason string)
relaykit/relayconvert/response_compat.go:46
↓ 1 callers
Function
StreamAllLogs
StreamAllLogs calls fn with each log matching filter, newest first, as an administrator with role sees it. Rows are read one at a time, so an export n
model/log.go:623
↓ 1 callers
Function
StreamResponseClaude2OpenAI
(claudeResponse *dto.ClaudeResponse)
relaykit/relayconvert/internal/claude_messages/to_oai_chat_resp.go:35
↓ 1 callers
Function
StreamResponseGeminiChat2OpenAI
(geminiResponse *dto.GeminiChatResponse)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go:188
↓ 1 callers
Function
StreamResponseOpenAI2Gemini
StreamResponseOpenAI2Gemini 将 OpenAI 流式响应转换为 Gemini 格式
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_resp.go:127
↓ 1 callers
Method
StreamUsage
()
relaykit/relayconvert/response_registry.go:112
↓ 1 callers
Function
StreamUserLogs
StreamUserLogs is StreamAllLogs for one user's own logs, shaped like the user log list.
model/log.go:651
↓ 1 callers
Method
Stricter
(other PinRetryMode)
dto/channel_constraints.go:22
↓ 1 callers
Function
String2Int
(str string)
relaykit/relayconvert/kitutil/value.go:36
↓ 1 callers
Function
StringToByteSlice
(s string)
relaykit/relayconvert/kitutil/json.go:143
↓ 1 callers
Method
Summary
Summary returns the credential without its data, headers and query.
pkg/jsplugin/provider.go:128
↓ 1 callers
Function
SundaySearch
(text string, pattern string)
service/str.go:14
↓ 1 callers
Function
SupportsHostProtocol
SupportsHostProtocol reports whether the current host release has a concrete wire/state machine for an otherwise valid manifest endpoint.
pkg/jsplugin/routing.go:417
↓ 1 callers
Method
SupportsPath
SupportsPath reports whether any route matches requestPath.
relaykit/dto/channel_settings.go:322
↓ 1 callers
Method
SupportsPathForModel
SupportsPathForModel reports whether any route matches requestPath and model.
relaykit/dto/channel_settings.go:328
↓ 1 callers
Function
SyncChannelCache
(frequency int)
model/channel_cache.go:115
↓ 1 callers
Function
SyncOptions
(frequency int)
model/option.go:229
↓ 1 callers
Function
SyncTaskPlugins
SyncTaskPlugins reloads the plugins every 30 seconds after the startup sync, for changes that did not bump the plugins sync topic.
controller/task_plugin.go:1196
↓ 1 callers
Function
TaskCountAllTasks
TaskCountAllTasks returns total tasks that match the given query params (admin usage)
model/task.go:618
↓ 1 callers
Function
TaskCountAllUserTask
TaskCountAllUserTask returns total tasks for given user
model/task.go:653
↓ 1 callers
Function
TaskErrorFromAPIError
TaskErrorFromAPIError 将 PreConsumeBilling 返回的 NewAPIError 转换为 TaskError。
service/error.go:222
↓ 1 callers
Function
TaskPluginMarketplaceSources2JsonString
()
setting/task_plugin.go:78
↓ 1 callers
Function
TestAllChannels
TestAllChannels enqueues a channel_test system task instead of running the test loop inline. If any channel_test task is already active, the manual ru
controller/channel-test.go:1183
↓ 1 callers
Function
TextHelper
(c *gin.Context, info *relaycommon.RelayInfo)
relay/compatible_handler.go:26
↓ 1 callers
Method
TimeoutEvent
(taskStatus ...string)
relay/plugin_protocol.go:547
↓ 1 callers
Method
ToFileSource
()
relaykit/dto/claude.go:115
↓ 1 callers
Method
ToFileSource
()
relaykit/dto/openai_request.go:589
↓ 1 callers
Function
ToJSONString
(v interface{})
relaykit/relayconvert/internal/jsonutil/stringify.go:9
↓ 1 callers
Method
ToMessage
()
relaykit/dto/error.go:52
↓ 1 callers
Method
ToVideoStatus
()
model/task.go:20
↓ 1 callers
Function
TouchUserAccessToken
TouchUserAccessToken records the last use at most once per interval per token.
model/user_access_token.go:192
↓ 1 callers
Method
TransferAffQuotaToQuota
(quota int)
model/user.go:587
↓ 1 callers
Method
TransportList
()
model/passkey.go:44
↓ 1 callers
Method
TryToOpenAIError
()
relaykit/dto/error.go:41
↓ 1 callers
Function
TurnstileCheck
()
middleware/turnstile-check.go:15
↓ 1 callers
Function
UnbindTaskPlugin
UnbindTaskPlugin removes one plugin from a channel's bindings and reports whether the channel changed. A New API gateway channel keeps serving its oth
model/task_plugin.go:45
↓ 1 callers
Function
UnbindUserOAuthForSession
(identity AuthSessionIdentity, providerID int, enabled AccountLoginMethods)
model/account_security.go:70
↓ 1 callers
Method
Unmarshal
(data []byte)
relay/channel/volcengine/protocols.go:306
↓ 1 callers
Method
Unwrap
()
pkg/jsplugin/engine.go:63
↓ 1 callers
Method
Update
Update 更新组
model/prefill_group.go:108
↓ 1 callers
Method
Update
()
model/midjourney.go:170
↓ 1 callers
Function
UpdateAbilityByTag
(tag string, newTag *string, priority *int64, weight *uint)
model/ability.go:350
↓ 1 callers
Function
UpdateAndSync
UpdateAndSync 更新配置并同步到 common 包 当配置从数据库加载后,需要调用此函数同步
setting/performance_setting/config.go:73
↓ 1 callers
Function
UpdateCacheRatioByJSONString
UpdateCacheRatioByJSONString updates the cache ratio map from a JSON string
setting/ratio_setting/cache_ratio.go:154
↓ 1 callers
Function
UpdateChatsByJsonString
(jsonString string)
setting/chat.go:45
↓ 1 callers
Method
UpdateClusterName
UpdateClusterName updates the name of an existing cluster/deployment
pkg/ionet/deployment.go:352
↓ 1 callers
Method
UpdateDeployment
UpdateDeployment updates the configuration of an existing deployment
pkg/ionet/deployment.go:111
↓ 1 callers
Function
UpdateGroupGroupRatioByJSONString
(jsonStr string)
setting/ratio_setting/group_ratio.go:104
↓ 1 callers
Function
UpdateModelRequestRateLimitGroupByJSONString
(jsonStr string)
setting/rate_limit.go:39
↓ 1 callers
Function
UpdatePayMethodsByJsonString
(jsonString string)
setting/operation_setting/payment_setting_old.go:39
↓ 1 callers
Function
UpdateQuotaData
()
model/usedata.go:45
↓ 1 callers
Function
UpdateRequestPluginInstances
UpdateRequestPluginInstances replaces the instance list whole, in the order given. Each config is saved as the plugin validated it, with its defaults.
controller/request_plugin.go:61
↓ 1 callers
Function
UpdateSyncTaskProgress
UpdateSyncTaskProgress records on a pending sync task how many nodes have applied it and why the others have not. It writes nothing when both are unch
model/system_sync_task.go:133
↓ 1 callers
Function
UpdateTaskPluginChannelLocked
UpdateTaskPluginChannelLocked runs update on a task plugin channel while every other task plugin channel is locked too, so a check across channels, su
model/channel_plugin_credential.go:143
↓ 1 callers
Function
UpdateUserLastLoginAt
func GetRootUserEmail() (email string) { DB.Model(&User{}).Where("role = ?", common.RoleRootUser).Select("email").Find(&email) return email }
model/user.go:1428
↓ 1 callers
Function
UpdateUserOAuthBindingForSessionWithTx
(tx *gorm.DB, identity AuthSessionIdentity, providerID int, subject string)
model/account_security.go:134
↓ 1 callers
Function
UpdateUserSetting
(c *gin.Context)
controller/user.go:1338
↓ 1 callers
Function
UpsertPasskeyCredentialWithAuthVersion
UpsertPasskeyCredentialWithAuthVersion is reserved for enrollment changes; assertion sign-count updates must use UpdatePasskeyAssertionState.
model/passkey.go:224
↓ 1 callers
Method
Usage
()
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_resp.go:379
↓ 1 callers
Function
UsageFromClaudeAPIUsage
(usage *dto.ClaudeUsage)
relaykit/relayconvert/response_compat.go:104
↓ 1 callers
Function
UsageFromClaudeUsage
(usage *dto.Usage)
relaykit/relayconvert/internal/claude_messages/to_oai_chat_resp.go:313
↓ 1 callers
Function
UsageFromGeminiMetadata
(metadata *dto.GeminiUsageMetadata, fallbackPromptTokens int)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go:14
↓ 1 callers
Method
UseUpstreamPath
UseUpstreamPath sends the request to path, a path a provider plugin chose, in place of the route's upstream_path. The caller has checked that it start
relay/channel/advancedcustom/adaptor.go:184
↓ 1 callers
Method
UseUpstreamURL
UseUpstreamURL sends the request to target, an absolute http(s) address a provider plugin chose, in place of the route's; the route auth query still a
relay/channel/advancedcustom/adaptor.go:191
↓ 1 callers
Function
UserActiveSubscriptionsAllowWalletOverflow
UserActiveSubscriptionsAllowWalletOverflow returns whether wallet balance may be used after the user's subscription quota is exhausted. A single activ
model/subscription.go:900
↓ 1 callers
Function
UserCheckin
UserCheckin 执行用户签到 MySQL 和 PostgreSQL 使用事务保证原子性 SQLite 不支持嵌套事务,使用顺序操作 + 手动回滚
model/checkin.go:54
↓ 1 callers
Function
UserCriticalRateLimit
(scope string)
middleware/rate-limit.go:197
← previous
next →
5,601–5,700 of 15,409, ranked by callers