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
↓ 1 callers
Function
LogInfo
(message string)
relaykit/relayconvert/kitutil/log.go:37
↓ 1 callers
Method
LogMode
(logger.LogLevel)
model/user_session_migration_test.go:36
↓ 1 callers
Function
LogQuota
LogQuota formats a quota for a server log line.
logger/logger.go:125
↓ 1 callers
Function
LogStartupSuccess
(startTime time.Time, host, port string)
common/sys_log.go:63
↓ 1 callers
Function
LookupHostProtocolOperation
(method, path string)
pluginkit/routing.go:185
↓ 1 callers
Method
LookupIPAddr
(ctx context.Context, host string)
service/protected_fetch_client.go:18
↓ 1 callers
Function
LookupTextConverter
(converter string)
relaykit/relayconvert/text_converter_registry.go:260
↓ 1 callers
Function
ManageMultiKeys
ManageMultiKeys handles multi-key management operations
controller/channel.go:1914
↓ 1 callers
Function
ManualCompleteTopUp
ManualCompleteTopUp 管理员手动完成订单并给用户充值
model/topup.go:450
↓ 1 callers
Method
MarkCancelled
()
relay/common/stream_status.go:123
↓ 1 callers
Function
MarkChannelAffinityUsed
(c *gin.Context, selectedGroup string, channelID int)
service/channel_affinity.go:683
↓ 1 callers
Method
MarkRequestPluginHeaderOverrides
MarkRequestPluginHeaderOverrides marks the attempt's header changes to the lowercase names the channel's header override replaced.
relay/common/request_plugin.go:279
↓ 1 callers
Method
Marshal
()
relay/channel/volcengine/protocols.go:274
↓ 1 callers
Method
MarshalJSON
()
types/rw_map.go:21
↓ 1 callers
Method
MaskSensitiveError
MaskSensitiveError masks the upstream addresses of the channel that produced the error in the error text; see kitutil.MaskSensitiveInfo.
relaykit/types/error.go:153
↓ 1 callers
Function
MaskTokenKey
(key string)
model/token.go:67
↓ 1 callers
Method
MaxRangeSeconds
()
setting/operation_setting/log_setting.go:35
↓ 1 callers
Method
Media
Media describes the media ref names; false when ref is not one of the call's.
pluginkit/media.go:26
↓ 1 callers
Method
MediaText
MediaText reads the text of the media ref names, at most maxChars UTF-16 code units; false when ref is not one of the call's.
pluginkit/media.go:29
↓ 1 callers
Method
MergeAudit
(values map[string]any)
model/log_other.go:139
↓ 1 callers
Method
MergeRoot
(values map[string]any)
model/log_other.go:122
↓ 1 callers
Method
MigrateColumn
(value any, field *schema.Field, column gorm.ColumnType)
model/migration_dialector.go:24
↓ 1 callers
Function
MjBulkUpdate
(mjIds []string, params map[string]any)
model/midjourney.go:202
↓ 1 callers
Function
MjBulkUpdateByTaskIds
(taskIDs []int, params map[string]any)
model/midjourney.go:208
↓ 1 callers
Function
ModelModifierEffort
ModelModifierEffort is the reasoning effort the modifiers of a model name set, as a relay request reads them; "" when they set none or are invalid.
relay/helper/reasoning_suffix.go:154
↓ 1 callers
Function
ModelRequestRateLimitGroup2JSONString
()
setting/rate_limit.go:28
↓ 1 callers
Method
ModelUser
()
service/passkey/user.go:59
↓ 1 callers
Function
Monitor
Monitor 定时监控cpu使用率,超过阈值输出pprof文件
common/pprof.go:13
↓ 1 callers
Method
Mu
()
relaykit/types/file_source.go:26
↓ 1 callers
Function
MultimodalEmbeddingHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/ali/embedding.go:129
↓ 1 callers
Function
NativeGeminiEmbeddingHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/gemini/relay-gemini-native.go:57
↓ 1 callers
Function
NewAPIReservedKeys
NewAPIReservedKeys returns, sorted, the plugin keys new-api refuses because they collide with its own paths, for another host that warns authors of pl
pluginkit/host.go:50
↓ 1 callers
Function
NewBillingSession
--------------------------------------------------------------------------- NewBillingSession 工厂 — 根据计费偏好创建会话并处理回退 -----------------------------------
service/billing_session.go:389
↓ 1 callers
Function
NewChatToResponsesStreamState
(id string, model string)
relaykit/relayconvert/response_compat.go:160
↓ 1 callers
Function
NewClaudeHostedStreamBridge
()
relaykit/relayconvert/response_compat.go:58
↓ 1 callers
Function
NewClient
NewClient creates a new IO.NET API client targeting the public API base URL.
pkg/ionet/client.go:79
↓ 1 callers
Function
NewDefaultHTTPClient
NewDefaultHTTPClient creates a new default HTTP client
pkg/ionet/client.go:25
↓ 1 callers
Function
NewGeminiHostedStreamBridge
()
relaykit/relayconvert/response_compat.go:62
↓ 1 callers
Function
NewMessageFromBytes
(data []byte)
relay/channel/volcengine/protocols.go:226
↓ 1 callers
Function
NewOpenAIVideo
()
relaykit/dto/openai_video.go:43
↓ 1 callers
Function
NewPasskeyCredentialFromWebAuthn
(userID int, credential *webauthn.Credential)
model/passkey.go:102
↓ 1 callers
Method
NewPayload
()
service/system_task.go:46
↓ 1 callers
Function
NewResponsesBufferedAccumulator
()
relaykit/relayconvert/response_compat.go:208
↓ 1 callers
Function
NewResponsesToChatStreamState
(model string, includeUsage bool)
relaykit/relayconvert/response_compat.go:196
↓ 1 callers
Function
NewResponsesToChatStreamState
(model string, includeUsage bool)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:50
↓ 1 callers
Function
NewResponsesToClaudeStreamState
(id string, model string)
relaykit/relayconvert/internal/oai_responses/to_claude_messages_stream_resp.go:44
↓ 1 callers
Function
NewTelegramOAuthFlow
()
oauth/telegram.go:53
↓ 1 callers
Function
NormalizeCacheCreationSplit
(totalTokens int, tokens5m int, tokens1h int)
service/convert.go:9
↓ 1 callers
Function
NormalizeCacheCreationSplit
(totalTokens int, tokens5m int, tokens1h int)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go:108
↓ 1 callers
Function
NormalizeCacheCreationSplit
(totalTokens int, tokens5m int, tokens1h int)
relaykit/relayconvert/internal/shared/claude/cache.go:3
↓ 1 callers
Method
NormalizeLegacyDalleImageRequest
NormalizeLegacyDalleImageRequest preserves the retired models' request validation and defaults. Other models, including aliases, are unchanged.
relaykit/dto/legacy_dalle_image.go:15
↓ 1 callers
Function
NormalizeProxyURL
NormalizeProxyURL validates a proxy URL using runtime-compatible rules and returns its canonical cache key.
service/http_client.go:196
↓ 1 callers
Function
NormalizeResponsesUsage
(src *dto.Usage)
relaykit/relayconvert/response_compat.go:184
↓ 1 callers
Function
NormalizeResponsesUsage
NormalizeResponsesUsage maps Responses usage into the shared accounting shape without creating a BillingUsage snapshot. Native Responses handlers use
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:191
↓ 1 callers
Method
NormalizedEventType
NormalizedEventType returns the event type or empty string for a nil event.
service/waffo_pancake.go:68
↓ 1 callers
Function
NotifyUpstreamModelUpdateWatchers
NotifyUpstreamModelUpdateWatchers sends the upstream model update notice to every administrator who enabled it. render builds the subject and content
service/user_notify.go:33
↓ 1 callers
Function
OaiChatToResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/responses_via_chat.go:19
↓ 1 callers
Function
OaiResponsesToChatHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/chat_via_responses.go:23
↓ 1 callers
Method
Observe
(response *dto.GeminiChatResponse)
relaykit/relayconvert/response_compat.go:66
↓ 1 callers
Function
ObserveChannelAffinityUsageCacheFromContext
(c *gin.Context, usage *dto.Usage, cachedTokenRateMode string)
service/channel_affinity.go:801
↓ 1 callers
Function
OpenAIChatRequestToGeminiGenerateContent
(c context.Context, textRequest dto.GeneralOpenAIRequest, info convmeta.Meta)
relaykit/relayconvert/request_compat.go:28
↓ 1 callers
Function
OpenAIResponsesRequestFromAny
(request any)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:28
↓ 1 callers
Function
OpenAIResponsesRequestToClaudeMessages
(c context.Context, info convmeta.Meta, req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/request_compat.go:68
↓ 1 callers
Function
OpenAIResponsesRequestToClaudeMessages
(c context.Context, info convmeta.Meta, req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/internal/oai_responses/to_claude_messages_req.go:27
↓ 1 callers
Function
OpenAIResponsesRequestToGeminiChat
(c context.Context, req *dto.OpenAIResponsesRequest, info convmeta.Meta)
relaykit/relayconvert/request_compat.go:72
↓ 1 callers
Function
OpenaiRealtimeHandler
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/openai/relay_realtime.go:21
↓ 1 callers
Function
OpenaiSTTHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo, responseFormat string)
relay/channel/openai/audio.go:117
↓ 1 callers
Function
OpenaiTTSHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/openai/audio.go:20
↓ 1 callers
Method
OutboundImageCount
(body []byte)
relay/image_handler.go:29
↓ 1 callers
Function
ParallelToolCalls
(raw []byte)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:237
↓ 1 callers
Function
ParamOverride
ParamOverride is utils.paramOverride(body, override): the channel param override DSL run on a stage hook's body, with a condition context built from t
relay/requestplugin/param_override.go:28
↓ 1 callers
Method
ParseInput
()
relaykit/dto/openai_request.go:478
↓ 1 callers
Method
ParseInput
ParseInput parses the Responses API `input` field into a normalized slice of MediaInput. Reference implementation mirrors Message.ParseContent: - inpu
relaykit/dto/openai_request.go:1250
↓ 1 callers
Function
ParseKnownProviderModelSuffix
ParseKnownProviderModelSuffix extracts a canonical intent only when the origin identifies a provider family whose suffix vocabulary is defined by rela
relaykit/relayconvert/reasoning/suffix.go:195
↓ 1 callers
Function
ParseOpenAIReasoningEffortFromModelSuffix
ParseOpenAIReasoningEffortFromModelSuffix extracts an effort tail only from GPT and o-series model families. preserveEffortTail is consulted on the co
relaykit/relayconvert/reasoning/suffix.go:128
↓ 1 callers
Method
ParseTaskResult
(task *model.Task, resp *http.Response, body []byte)
service/task_polling.go:32
↓ 1 callers
Function
PasskeyRegisterBegin
(c *gin.Context)
controller/passkey.go:45
↓ 1 callers
Function
PatchClaudeMessageDeltaUsageData
(data string, usage *dto.ClaudeUsage)
relaykit/relayconvert/response_compat.go:116
↓ 1 callers
Function
Path2RelayMode
(path string)
relay/constant/relay_mode.go:57
↓ 1 callers
Function
Path2RelayModeMidjourney
(path string)
relay/constant/relay_mode.go:103
↓ 1 callers
Function
PayMethods2JsonString
()
setting/operation_setting/payment_setting_old.go:44
↓ 1 callers
Function
PendingSyncTaskTypes
PendingSyncTaskTypes returns the types that have sync tasks not every node has applied yet.
model/system_sync_task.go:102
↓ 1 callers
Function
PingDB
()
model/main.go:816
↓ 1 callers
Function
PluginCredentialPreview
PluginCredentialPreview names a credential line for key lists without its secrets: its label, or its account id.
service/provider_plugin.go:727
↓ 1 callers
Function
PluginLoginRedirectURI
PluginLoginRedirectURI is the callback address of a plugin's logins. Each plugin has its own, so a callback cannot reach another plugin's flow.
service/provider_plugin_login.go:105
↓ 1 callers
Function
PreConsumeUserSubscription
PreConsumeUserSubscription pre-consumes from any active subscription total quota.
model/subscription.go:1316
↓ 1 callers
Function
PreWssConsumeQuota
PreWssConsumeQuota charges the usage of one Realtime response and returns the quota it charged.
service/quota.go:90
↓ 1 callers
Method
PrepareWebSocket
(c *gin.Context, info *common.RelayInfo)
relay/channel/api_request.go:444
↓ 1 callers
Method
Printf
(format string, args ...any)
model/gorm_logger.go:55
↓ 1 callers
Function
ProcessTools
ProcessTools 处理工具列表,支持类型断言
relaykit/dto/claude.go:492
↓ 1 callers
Function
PullOllamaModel
拉取 Ollama 模型 (非流式)
relay/channel/ollama/relay-ollama.go:381
↓ 1 callers
Function
PullOllamaModelStream
流式拉取 Ollama 模型 (支持进度回调)
relay/channel/ollama/relay-ollama.go:422
↓ 1 callers
Function
PurchaseSubscriptionWithBalance
PurchaseSubscriptionWithBalance creates a subscription by deducting the user's wallet quota.
model/subscription.go:771
↓ 1 callers
Function
PurgeSubscriptionPlanCache
PurgeSubscriptionPlanCache drops every cached plan, so the next reads load them from the database.
model/subscription.go:150
↓ 1 callers
Function
Query
(params QueryParams)
pkg/perf_metrics/metrics.go:160
↓ 1 callers
Function
QuotaFromDecimal
QuotaFromDecimal converts a computed quota decimal to int with saturation. The decimal is rounded (half away from zero) before conversion.
common/quota_math.go:152
↓ 1 callers
Function
QuotaFromFloatStrict
QuotaFromFloatStrict converts an in-range value and returns a typed *QuotaClamp error instead of allowing a saturated result to reach billing.
common/quota_math.go:125
↓ 1 callers
Function
QuotaRoundStrict
QuotaRoundStrict rounds an in-range value and returns a typed *QuotaClamp error instead of allowing a saturated result to reach billing.
common/quota_math.go:146
↓ 1 callers
Function
RandomSleep
()
common/utils.go:272
↓ 1 callers
Function
ReasoningEffortFromJSON
ReasoningEffortFromJSON reads the reasoning effort a JSON body of format sets, and whether the body holds a reasoning control at all.
relay/common/override.go:264
← previous
next →
5,501–5,600 of 15,592, ranked by callers