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
↓ 4 callers
Method
AddPolicy
(_ string, ptype string, rule []string)
service/authz/adapter.go:79
↓ 4 callers
Function
AddToken
(c *gin.Context)
controller/token.go:299
↓ 4 callers
Function
AdminResetUserSubscriptionsByPlan
(userId int, planId int, advanceResetTime bool)
model/subscription.go:1109
↓ 4 callers
Method
AppendRequestConversion
AppendRequestConversion records a hop in the request format chain.
relaykit/relayconvert/convmeta/meta.go:60
↓ 4 callers
Function
AppendUsedChannel
AppendUsedChannel records an attempted channel in the request's channel trail, which the retry log and the consume log's admin_info both read.
service/channel_select.go:415
↓ 4 callers
Method
Apply
Apply accepts a bounded batch of set, append and appendText operations. Failure invalidates the stream: callers must discard the state rather than con
pkg/jsplugin/json_state.go:259
↓ 4 callers
Function
ApplyToOpenAIResponses
ApplyToOpenAIResponses writes the portable portion of an intent directly to a Responses request. The JSON-excluded state retains exact provider-native
relaykit/relayconvert/reasoning/intent.go:480
↓ 4 callers
Function
BodyStorageCleanup
BodyStorageCleanup 请求体存储清理中间件 在请求处理完成后自动清理磁盘/内存缓存
middleware/body_cleanup.go:11
↓ 4 callers
Function
BuildTaskArtifactContentURL
BuildTaskArtifactContentURL returns an absolute, long-lived capability URL. TaskPublicAddress wins when configured; ServerAddress is the only fallback
service/task_artifact_access.go:98
↓ 4 callers
Function
CacheUpdateChannelKey
CacheUpdateChannelKey publishes a new key for a cached channel. The cached channel is replaced by a copy, so a request holding the previous one keeps
model/channel_plugin_credential.go:201
↓ 4 callers
Method
CacheWrite12hTokens
CacheWrite12hTokens returns the 12-hour subset of the cache writes, bounded by CacheCreationTokensTotal so it never bills more writes than reported.
relaykit/dto/openai_response.go:348
↓ 4 callers
Method
CallConvertRequest
CallConvertRequest runs convertRequest(ctx, {body, model, stream}), or convertRequest(ctx, {form, model, stream}) for a multipart client request.
pkg/jsplugin/provider.go:666
↓ 4 callers
Method
CallConvertStreamEvent
CallConvertStreamEvent runs convertStreamEvent(ctx, {event?, data}) on the stream of the route at hookCtx.Path, {dataBase64} for a binary frame, or wi
pkg/jsplugin/provider.go:1274
↓ 4 callers
Function
CallID
(item map[string]any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:589
↓ 4 callers
Method
CallPrepareRequest
CallPrepareRequest runs prepareRequest(ctx, req).
pkg/jsplugin/provider.go:497
↓ 4 callers
Method
CallReply
CallReply runs the reply hook with tctx.Stage "reply" on outputs and checks the result: each mask names an output of the call and lies within its text
pkg/jsplugin/transform.go:470
↓ 4 callers
Method
CallScheduled
CallScheduled runs scheduled(ctx). The caller checks the stored credential line's size and applies the result while holding the channel lock.
pkg/jsplugin/provider.go:370
↓ 4 callers
Function
Catalog
Catalog returns a copy of the registered resource definitions.
service/authz/registry.go:29
↓ 4 callers
Function
ClassifyRelayOutcome
ClassifyRelayOutcome decides whether one finished relay counts as a health sample. Business rejections and cancellations during generation are not sam
pkg/perf_metrics/outcome.go:26
↓ 4 callers
Function
ClaudeData
(c *gin.Context, resp dto.ClaudeResponse)
relay/helper/common.go:214
↓ 4 callers
Function
CleanupBodyStorage
CleanupBodyStorage 清理请求体存储(应在请求结束时调用)
common/gin.go:110
↓ 4 callers
Function
ClearRefreshCookie
(c *gin.Context)
service/auth_session.go:346
↓ 4 callers
Function
CloseActiveWebSocketsForChannel
(channelID int, reason string)
service/ws_close.go:7
↓ 4 callers
Function
CloseChannel
(channelID int, reason string)
pkg/wsmanager/wsmanager.go:89
↓ 4 callers
Function
ContentPartToFileSource
(part map[string]any)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:241
↓ 4 callers
Function
CountUserSubscriptionsByPlan
(userId int, planId int)
model/subscription.go:425
↓ 4 callers
Function
CovertMjpActionToModelName
(mjAction string)
service/midjourney.go:25
↓ 4 callers
Function
CreateUserSubscriptionFromPlanTx
(tx *gorm.DB, userId int, plan *SubscriptionPlan, source string)
model/subscription.go:496
↓ 4 callers
Function
DecodeIconDataURI
DecodeIconDataURI parses a plugin logo shipped as a sidecar icon.svg or icon.png file and re-encoded by the uploader as data:image/png;base64,... or d
pkg/jsplugin/icon.go:28
↓ 4 callers
Function
DecreaseTokenQuota
(id int, key string, quota int)
model/token.go:413
↓ 4 callers
Function
DecrementDiskFiles
DecrementDiskFiles 减少磁盘文件计数
common/disk_cache_config.go:115
↓ 4 callers
Function
DeleteJSONMember
DeleteJSONMember removes every copy of the member at path. A client body may repeat a key, and most upstream parsers read the last copy, so a survivin
relay/common/relay_info.go:1165
↓ 4 callers
Function
DeleteModelMetadata
DeleteModelMetadata optionally removes exact model names from every channel. Channel removal requires exact-match metadata records. Pricing removal cl
model/model_meta.go:285
↓ 4 callers
Function
DoDownloadRequest
(originUrl string, reason ...string)
service/download.go:52
↓ 4 callers
Method
DoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/aws/adaptor.go:139
↓ 4 callers
Method
DoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:315
↓ 4 callers
Function
DoWorkerRequest
DoWorkerRequest 通过Worker发送请求
service/download.go:24
↓ 4 callers
Method
EffectiveRPID
EffectiveRPID preserves the existing default and port handling for settings created before explicit Passkey domains were introduced.
setting/system_setting/passkey.go:41
↓ 4 callers
Method
Enabled
()
service/task_artifact_store.go:27
↓ 4 callers
Function
EnqueueSystemTask
EnqueueSystemTask creates an on-demand task of the given type. The returned bool is true only when a new pending row was created; false means an activ
service/system_task.go:202
↓ 4 callers
Function
ExprVersion
ExprVersion returns the version of a cached expression. Returns DefaultExprVersion if the expression hasn't been compiled yet or is empty.
pkg/billingexpr/compile.go:242
↓ 4 callers
Method
Finalize
(state *ResponseStreamState)
relaykit/relayconvert/response_compat.go:73
↓ 4 callers
Function
FindUserAccessTokenByHash
(hash string)
model/user_access_token.go:85
↓ 4 callers
Function
FinishEmailBinding
(identity AuthIdentity, token, newCode, oldCode string)
service/email_binding.go:129
↓ 4 callers
Function
FinishTwoFASetup
(identity AuthIdentity, flowToken, code string)
service/twofa.go:43
↓ 4 callers
Method
Flush
()
router/plugin-router.go:560
↓ 4 callers
Method
FullKey
(key string)
pkg/cachex/hybrid_cache.go:55
↓ 4 callers
Function
GenerateSystemTaskID
()
model/system_task.go:94
↓ 4 callers
Function
GetAdvancedCustomPreset
GetAdvancedCustomPreset returns fresh defaults.
common/advanced_custom_presets.go:9
↓ 4 callers
Function
GetChannel
( group string, model string, retry int, filters []dto.ChannelFilter, )
model/ability.go:108
↓ 4 callers
Function
GetChannelAffinityUsageCacheStats
(ruleName, usingGroup, keyFp string)
service/channel_affinity.go:809
↓ 4 callers
Method
GetChannelType
()
relaykit/relayconvert/convmeta/meta.go:27
↓ 4 callers
Function
GetCheckinSetting
GetCheckinSetting 获取签到配置
setting/operation_setting/checkin_setting.go:25
↓ 4 callers
Function
GetCustomOAuthProviderById
GetCustomOAuthProviderById returns a custom OAuth provider by ID
model/custom_oauth_provider.go:90
↓ 4 callers
Function
GetDiscordSettings
()
setting/system_setting/discord.go:19
↓ 4 callers
Function
GetDiskCacheThresholdBytes
GetDiskCacheThresholdBytes 获取磁盘缓存阈值(字节)
common/disk_cache_config.go:51
↓ 4 callers
Method
GetEffectiveDisplayName
GetEffectiveDisplayName returns the admin-configured display name, or the literal "OIDC" when none has been set. Centralizing this fallback keeps the
setting/system_setting/oidc.go:36
↓ 4 callers
Function
GetEnabledModels
()
model/ability.go:50
↓ 4 callers
Function
GetEnvOrDefaultBool
(env string, defaultValue bool)
common/env.go:27
↓ 4 callers
Method
GetFullKey
()
model/token.go:80
↓ 4 callers
Function
GetGroupRatio
(name string)
setting/ratio_setting/group_ratio.go:79
↓ 4 callers
Function
GetLatestSyncRevisions
GetLatestSyncRevisions returns the id of the newest sync task of every topic that has one. A node reads it before its startup loads, before it knows w
model/system_sync_task.go:83
↓ 4 callers
Function
GetLogSetting
()
setting/operation_setting/log_setting.go:31
↓ 4 callers
Function
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:636
↓ 4 callers
Function
GetOptions
(c *gin.Context)
controller/option.go:84
↓ 4 callers
Method
GetPage
()
common/page_info.go:29
↓ 4 callers
Method
GetPreConsumedQuota
GetPreConsumedQuota 返回实际预扣的额度值(信任用户可能为 0)。
relay/common/billing.go:20
↓ 4 callers
Function
GetProvider
GetProvider returns the OAuth provider for the given name
oauth/registry.go:63
↓ 4 callers
Method
GetProviderId
GetProviderId returns the provider ID for binding purposes
oauth/generic.go:316
↓ 4 callers
Method
GetSetting
()
model/user_cache.go:50
↓ 4 callers
Function
GetTimestamp
()
relaykit/relayconvert/kitutil/value.go:50
↓ 4 callers
Function
GetToolPrice
GetToolPrice is a convenience wrapper when no model name is needed.
setting/operation_setting/tools.go:279
↓ 4 callers
Function
GetUnusedBackupCodeCount
GetUnusedBackupCodeCount 获取未使用的备用码数量
model/twofa.go:231
↓ 4 callers
Function
GetUserAutoGroup
GetUserAutoGroup 根据用户分组获取自动分组设置
service/group.go:57
↓ 4 callers
Function
GetUserSetting
GetUserSetting gets setting from Redis first, falls back to DB if needed
model/user.go:1303
↓ 4 callers
Function
HandleStreamResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, data string)
relay/channel/claude/relay-claude.go:89
↓ 4 callers
Method
HasIcon
HasIcon reports whether this version ships a logo.
model/task_plugin.go:103
↓ 4 callers
Method
HasOtherRatio
(key string)
types/price_data.go:62
↓ 4 callers
Method
ImageCount
ImageCount resolves the validated request quantity. Top-level zero retains its legacy default of one; an explicit provider count must be positive.
relaykit/dto/openai_image.go:60
↓ 4 callers
Method
IncrSendResponseCount
()
relaykit/relayconvert/convmeta/meta.go:57
↓ 4 callers
Function
IncrementDiskFiles
IncrementDiskFiles 增加磁盘文件计数
common/disk_cache_config.go:109
↓ 4 callers
Method
Init
(info *relaycommon.RelayInfo)
relay/channel/aws/adaptor.go:83
↓ 4 callers
Function
InitTask
(platform constant.TaskPlatform, relayInfo *commonRelay.RelayInfo)
model/task.go:269
↓ 4 callers
Function
InjectTieredBillingInfo
InjectTieredBillingInfo overlays tiered billing fields onto an existing module-specific other map. Call this after GenerateTextOtherInfo / GenerateCla
service/log_info_generate.go:350
↓ 4 callers
Method
Insert
()
model/model_meta.go:236
↓ 4 callers
Method
Insert
(inviterId int)
model/user.go:675
↓ 4 callers
Method
Insert
()
model/token.go:307
↓ 4 callers
Function
InvalidateSubscriptionPlanCache
InvalidateSubscriptionPlanCache drops a plan written on this node from the cache and tells the other nodes to drop their copies.
model/subscription.go:137
↓ 4 callers
Function
IsAlwaysSkipRetryStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:70
↓ 4 callers
Method
IsCustomTool
IsCustomTool reports whether name was encoded from a Responses custom tool.
relaykit/relayconvert/convmeta/meta.go:126
↓ 4 callers
Function
IsDiskCacheEnabled
IsDiskCacheEnabled 是否启用磁盘缓存
common/disk_cache_config.go:44
↓ 4 callers
Method
IsEnabled
IsEnabled returns whether this OAuth provider is enabled
oauth/provider.go:16
↓ 4 callers
Function
IsQwenThinkingBudgetModel
(modelName string)
relaykit/dto/openai_request.go:395
↓ 4 callers
Function
IsRequestBodyTooLargeError
(err error)
common/gin.go:29
↓ 4 callers
Method
IsStream
(c *http.Request)
relaykit/dto/request_common.go:10
↓ 4 callers
Method
IsToolCall
()
relaykit/dto/openai_response.go:164
↓ 4 callers
Method
JSValueFor
JSValueFor is JSValue for the decode hooks of the plugin meta describes. A plugin that preserves JSON order receives a JSON body as its text, which th
pkg/jsplugin/routing.go:375
↓ 4 callers
Function
LegacyAccessTokenRetireAt
()
model/user_access_token.go:322
↓ 4 callers
Function
ListSystemInstances
()
model/system_instance.go:72
↓ 4 callers
Function
LocalLogPreview
LocalLogPreview limits log-only content unless debug logging is enabled.
common/str.go:20
← previous
next →
1,601–1,700 of 15,409, ranked by callers