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
Function
ApplyClaudeThinkingModel
(claudeRequest *dto.ClaudeRequest, info convmeta.Meta)
relaykit/relayconvert/request_compat.go:49
↓ 1 callers
Function
ApplyPluginParamOverride
ApplyPluginParamOverride runs the param override DSL for a request plugin's utils.paramOverride. The DSL header context starts from baseHeaders, never
relay/common/request_plugin.go:205
↓ 1 callers
Function
AttachThoughtSignatureBypass
(opts *convmeta.Options, part *dto.GeminiPart)
relaykit/relayconvert/internal/shared/gemini/request.go:70
↓ 1 callers
Method
Attachments
Attachments lists the request's attachments in body order.
pkg/jsplugin/media.go:23
↓ 1 callers
Function
AudioHelper
(c *gin.Context, info *relaycommon.RelayInfo)
relay/audio_handler.go:18
↓ 1 callers
Method
AuditMap
AuditMap renders the clamp as the marker stored under a log's admin_info.quota_saturation. Centralized here so every billing path (consume logs, task
common/quota_math.go:62
↓ 1 callers
Function
AuthLogout
(c *gin.Context)
controller/auth_session.go:47
↓ 1 callers
Function
AuthSessionErrorCode
(err error)
service/auth_session.go:484
↓ 1 callers
Method
AuthorizationURL
(state string)
oauth/telegram.go:69
↓ 1 callers
Function
AutoSMTPAuth
(username, password string)
common/email_ntlm_auth.go:17
↓ 1 callers
Function
AutomaticDisableKeywordsFromString
(s string)
setting/operation_setting/operation_setting.go:22
↓ 1 callers
Function
AutomaticDisableStatusCodesFromString
(s string)
setting/operation_setting/status_code_ranges.go:44
↓ 1 callers
Function
AutomaticRetryStatusCodesFromString
(s string)
setting/operation_setting/status_code_ranges.go:61
↓ 1 callers
Function
BatchDeleteModelMeta
(c *gin.Context)
controller/model_meta.go:223
↓ 1 callers
Function
BatchDeleteTokens
BatchDeleteTokens 删除指定用户的一组令牌,返回成功删除数量
model/token.go:450
↓ 1 callers
Function
BatchInsertChannels
(channels []Channel)
model/channel.go:505
↓ 1 callers
Function
BatchSetChannelTag
(ids []int, tag *string)
model/channel.go:1283
↓ 1 callers
Function
BindTelegramForSessionWithTx
BindTelegramForSessionWithTx preserves single ownership and the session that started the binding. The caller consumes its OAuth flow in this transacti
model/external_identity_claim.go:87
↓ 1 callers
Function
BuildAnthropicModelURL
(baseURL, version, projectID, region, modelName, action string)
relay/channel/vertex/url_builder.go:78
↓ 1 callers
Function
BuildMessageDeltaPatchUsage
(claudeResponse *dto.ClaudeResponse, claudeInfo *ClaudeResponseInfo)
relaykit/relayconvert/response_compat.go:112
↓ 1 callers
Function
BuildOpenSourceChatCompletionsURL
(baseURL, projectID, region string)
relay/channel/vertex/url_builder.go:82
↓ 1 callers
Function
CacheGetChannelInfo
(id int)
model/channel_cache.go:239
↓ 1 callers
Method
CallBuildBalanceRequest
CallBuildBalanceRequest runs buildBalanceRequest(ctx): the first request of a balance query, with the state parseBalance starts from.
pkg/jsplugin/provider.go:1974
↓ 1 callers
Method
CallCheckKey
CallCheckKey runs checkKey(ctx, key) on a static key line an administrator saves. It returns nil for a good key, or the plugin's message for the admin
pkg/jsplugin/provider.go:1924
↓ 1 callers
Method
CallExchangeKey
CallExchangeKey runs exchangeKey(ctx) for a static key line: hookCtx has the base URL, the plugin config and the key. It returns the token or the erro
pkg/jsplugin/provider.go:1881
↓ 1 callers
Method
CallJSONInto
CallJSONInto is CallInto with the semantics of JSON.stringify's text of the result instead of the host codec's encoding: objects keep their member ord
pkg/jsplugin/engine.go:357
↓ 1 callers
Method
CallParseBalance
CallParseBalance runs parseBalance(ctx, {status, headers, body}). A returned {error} is an error with the plugin's message.
pkg/jsplugin/provider.go:2000
↓ 1 callers
Method
CallPathInto
CallPathInto is CallInto for a function nested below an exported object.
pkg/jsplugin/engine.go:377
↓ 1 callers
Method
Capacity
()
pkg/cachex/hybrid_cache.go:273
↓ 1 callers
Method
ChannelConfigSchemaJSON
ChannelConfigSchemaJSON returns meta.channelConfig as normalized JSON text, nil when the plugin declares none.
pkg/jsplugin/config_schema.go:208
↓ 1 callers
Function
ChannelConfigURL
ChannelConfigURL returns the url property name of a channel plugin config, empty when it has no value.
pkg/jsplugin/config_schema.go:295
↓ 1 callers
Function
ChannelTypeOf
(m Meta)
relaykit/relayconvert/convmeta/meta.go:307
↓ 1 callers
Function
ChargeViolationFeeIfNeeded
ChargeViolationFeeIfNeeded charges an additional fee after the normal flow finishes (including refund). It uses Grok fee settings as the fee policy.
service/violation_fee.go:103
↓ 1 callers
Function
ChatCompletionsRequestToResponsesRequest
(req *dto.GeneralOpenAIRequest)
relaykit/relayconvert/request_compat.go:60
↓ 1 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
relaykit/relayconvert/response_compat.go:148
↓ 1 callers
Function
ChatCompletionsStreamChunkToResponsesEvents
(chunk *dto.ChatCompletionsStreamResponse, state *ChatToResponsesStreamState)
relaykit/relayconvert/response_compat.go:164
↓ 1 callers
Function
ChatCompletionsStreamChunkToResponsesEvents
(chunk *dto.ChatCompletionsStreamResponse, state *ChatToResponsesStreamState)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:329
↓ 1 callers
Function
Chats2JsonString
()
setting/chat.go:50
↓ 1 callers
Function
CheckGroupRatio
(jsonStr string)
setting/ratio_setting/group_ratio.go:108
↓ 1 callers
Function
CheckModelRequestRateLimitGroup
(jsonStr string)
setting/rate_limit.go:62
↓ 1 callers
Function
CheckSetup
()
model/main.go:93
↓ 1 callers
Function
ClaudeChunkData
(c *gin.Context, resp dto.ClaudeResponse, data string)
relay/helper/common.go:230
↓ 1 callers
Function
ClaudeDefaultEffort
ClaudeDefaultEffort is the effort the model runs at when a request sets none.
relaykit/relayconvert/reasoning/claude.go:422
↓ 1 callers
Function
ClaudeErrorWrapper
OpenAIErrorWrapper wraps an error into an OpenAIErrorWithStatusCode func OpenAIErrorWrapper(err error, code string, statusCode int) *dto.OpenAIErrorWi
service/error.go:62
↓ 1 callers
Function
ClaudeHelper
(c *gin.Context, info *relaycommon.RelayInfo)
relay/claude_handler.go:23
↓ 1 callers
Function
ClaudeStopReasonToOpenAIFinishReason
(stopReason string)
relaykit/reasonmap/reasonmap.go:9
↓ 1 callers
Function
ClaudeUsesManualThinking
ClaudeUsesManualThinking reports whether an exact numeric budget is rendered as legacy extended thinking rather than being reduced to adaptive effort.
relaykit/relayconvert/reasoning/claude.go:411
↓ 1 callers
Function
CleanupFileSources
CleanupFileSources 清理请求中所有注册的 FileSource 应在请求结束时调用(通常由中间件自动调用)
service/file_service.go:144
↓ 1 callers
Function
CleanupOldCacheFiles
CleanupOldCacheFiles 清理旧的缓存文件(用于启动时清理残留)
common/body_storage.go:443
↓ 1 callers
Function
CleanupSubscriptionPreConsumeRecords
CleanupSubscriptionPreConsumeRecords removes old idempotency records to keep table small.
model/subscription.go:1489
↓ 1 callers
Function
ClearChannelAffinityCacheAll
()
service/channel_affinity.go:200
↓ 1 callers
Function
ClearChannelAffinityCacheByRuleName
(ruleName string)
service/channel_affinity.go:215
↓ 1 callers
Method
ClearToolCalls
()
relaykit/dto/openai_response.go:178
↓ 1 callers
Function
ClearUserAuthorization
(userID int)
service/authz/override.go:93
↓ 1 callers
Function
ClearUserPermissions
(userID int)
service/authz/override.go:70
↓ 1 callers
Function
ClearUserPermissionsInTx
(tx *gorm.DB, userID int)
service/authz/override.go:84
↓ 1 callers
Function
ClientRequestHeaders
ClientRequestHeaders is the client's request headers as decoders and driver hooks receive them: the first value of each under its canonical name, with
relay/channel/task/jsplugin/adaptor.go:117
↓ 1 callers
Method
Close
()
relaykit/types/file_source.go:209
↓ 1 callers
Method
Close
()
relay/channel/openai/relay_responses_billing_test.go:55
↓ 1 callers
Function
CloseActiveWebSocketsForChannels
(channelIDs []int, reason string)
service/ws_close.go:11
↓ 1 callers
Function
CloseDB
()
model/main.go:709
↓ 1 callers
Method
CloseIdleConnections
()
service/http_transport_sharded.go:83
↓ 1 callers
Method
Complete
Complete releases the reservation. A successful outcome records the request in the key's sliding window; a failed one only frees the slot.
common/rate-limit.go:194
↓ 1 callers
Function
CompleteEmailBinding
CompleteEmailBinding commits failed attempts even though verification fails. Successful confirmation consumes the flow in the same transaction as the
model/email_binding.go:101
↓ 1 callers
Method
ConvOptions
ConvOptions snapshots host settings for the converters. Rebuilt on each call site's first use; cached so one relay session sees one snapshot.
relay/common/relay_info.go:981
↓ 1 callers
Method
ConversionDiagnosticsTruncated
()
relay/common/conversion_diagnostics.go:69
↓ 1 callers
Method
ConvertChunk
(event *dto.ResponsesStreamResponse, estimatedInputTokens int)
relaykit/relayconvert/internal/oai_responses/to_claude_messages_stream_resp.go:82
↓ 1 callers
Method
ConvertChunk
(claudeResponse *dto.ClaudeResponse)
relaykit/relayconvert/internal/claude_messages/to_oai_chat_resp.go:140
↓ 1 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, req *dto.ClaudeRequest)
relay/channel/ali/adaptor.go:54
↓ 1 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/openai/adaptor.go:62
↓ 1 callers
Method
ConvertClaudeRequest
(*gin.Context, *relaycommon.RelayInfo, *dto.ClaudeRequest)
relay/channel/submodel/adaptor.go:24
↓ 1 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/advancedcustom/adaptor.go:75
↓ 1 callers
Method
ConvertGeminiRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest)
relay/channel/advancedcustom/adaptor.go:93
↓ 1 callers
Method
ConvertImageRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest)
relay/channel/minimax/adaptor.go:80
↓ 1 callers
Method
ConvertImageRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest)
relay/channel/vertex/adaptor.go:115
↓ 1 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/ali/adaptor.go:132
↓ 1 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/zhipu_4v/adaptor.go:98
↓ 1 callers
Method
ConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/codex/adaptor.go:55
↓ 1 callers
Function
ConvertRerankRequest
(request dto.RerankRequest)
relay/channel/ali/rerank.go:16
↓ 1 callers
Method
ConvertRerankRequest
(c *gin.Context, relayMode int, request dto.RerankRequest)
relay/channel/advancedcustom/adaptor.go:169
↓ 1 callers
Function
ConvertResponseByID
(c context.Context, info convmeta.Meta, converter string, response any)
relaykit/relayconvert/response_registry.go:256
↓ 1 callers
Function
CountAllTasks
CountAllTasks returns total midjourney tasks for admin query
model/midjourney.go:215
↓ 1 callers
Function
CountAllUserTask
CountAllUserTask returns total midjourney tasks for user
model/midjourney.go:235
↓ 1 callers
Function
CountAudioTokenInput
(audioBase64 string, audioFormat string)
service/token_counter.go:248
↓ 1 callers
Function
CountAudioTokenOutput
(audioBase64 string, audioFormat string)
service/token_counter.go:260
↓ 1 callers
Function
CountTokenInput
(input any, model string)
service/token_counter.go:228
↓ 1 callers
Function
CountTokenRealtime
(info *relaycommon.RelayInfo, request dto.RealtimeEvent, model string)
service/token_counter.go:174
↓ 1 callers
Function
CountUsersByEmail
(email string)
model/user.go:322
↓ 1 callers
Function
CreateBodyStorageFromReader
CreateBodyStorageFromReader 从 Reader 创建存储(用于大请求的流式处理)
common/body_storage.go:334
↓ 1 callers
Function
CreateEmailBinding
(identity AuthSessionIdentity, state EmailBindingState)
model/email_binding.go:36
↓ 1 callers
Function
CreateUserOAuthBinding
CreateUserOAuthBinding creates a new OAuth binding
model/user_oauth_binding.go:64
↓ 1 callers
Function
CreateUserSessionFromLoginFlow
CreateUserSessionFromLoginFlow commits the one-time login authorization and the resulting session together. The user lock serializes credential change
model/login_verification.go:52
↓ 1 callers
Function
CreateWaffoPancakePrimaryPair
CreateWaffoPancakePrimaryPair mints a Store + OnetimeProduct in one round-trip — the canonical "+ Create" entry point. Nothing is persisted to setting
service/waffo_pancake.go:372
↓ 1 callers
Function
CreateWaffoPancakePrimaryProduct
CreateWaffoPancakePrimaryProduct mints (and publishes) the wallet-top-up OnetimeProduct under storeID. Per-checkout price overrides via PriceSnapshot
service/waffo_pancake.go:328
↓ 1 callers
Function
CreateWaffoPancakePrimaryStore
CreateWaffoPancakePrimaryStore creates a Pancake Store using in-flight (not-yet-persisted) credentials and returns the new store ID.
service/waffo_pancake.go:266
↓ 1 callers
Function
CreateWaffoPancakeProductForPlan
CreateWaffoPancakeProductForPlan mints (and publishes) a Pancake OnetimeProduct priced at `amount` USD, used as a subscription plan's SubscriptionPlan
service/waffo_pancake.go:287
↓ 1 callers
Function
DecodeJsonWithValidation
DecodeJsonWithValidation decodes JSON and applies Gin's configured binding-tag validator, including binding:"required" and any registered custom valid
common/json.go:84
↓ 1 callers
Method
DecodeState
(v any)
model/system_task.go:568
↓ 1 callers
Function
DecrementMemoryBuffers
DecrementMemoryBuffers 减少内存缓存计数
common/disk_cache_config.go:131
↓ 1 callers
Function
DefaultModelRatio2JSONString
()
setting/ratio_setting/model_ratio.go:395
← previous
next →
5,001–5,100 of 15,409, ranked by callers