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
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
pluginkit/engine.go:348
↓ 1 callers
Method
CallListArtifacts
CallListArtifacts runs listArtifacts with the artifact context of a task and validates the list. An invalid list is a *ResultError; other errors are t
pluginkit/task.go:338
↓ 1 callers
Method
CallParseBalance
CallParseBalance runs parseBalance(ctx, {status, headers, body}). A returned {error} is an error with the plugin's message.
pluginkit/provider.go:1984
↓ 1 callers
Method
CallParseBatchResult
CallParseBatchResult runs parseBatchResult with the batch query context, the upstream body and HookHTTPResponse. A result of the wrong shape is a *Res
pluginkit/task.go:239
↓ 1 callers
Method
CallParseSubmitResponse
CallParseSubmitResponse runs parseSubmitResponse with the driver context. A result of the wrong shape, without a taskId or with clientResponse (ErrSub
pluginkit/task.go:163
↓ 1 callers
Method
CallParseTaskResult
CallParseTaskResult runs parseTaskResult with the task query context, the upstream body (parsed JSON, else text) and HookHTTPResponse. A result of the
pluginkit/task.go:207
↓ 1 callers
Method
CallPathInto
CallPathInto is CallInto for a function nested below an exported object.
pluginkit/engine.go:368
↓ 1 callers
Method
CallPathJSONInto
CallPathJSONInto is CallJSONInto for a function nested below an exported object, such as native.render: objects keep their member order.
pluginkit/engine.go:375
↓ 1 callers
Method
CallSubmitEvent
CallSubmitEvent runs hook, parseSubmitEvent or parseSubmitEventDelta (see UsesSubmitEventDelta), on one event with the previous state, and checks the
pluginkit/task.go:292
↓ 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.
pluginkit/config_schema.go:207
↓ 1 callers
Function
ChannelConfigURL
ChannelConfigURL returns the url property name of a channel plugin config, empty when it has no value.
pluginkit/config_schema.go:294
↓ 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
pluginkit/task.go:411
↓ 1 callers
Function
ClientRequestHeaders
ClientRequestHeaders is the client's request headers as decoders and driver hooks receive them.
relay/channel/task/jsplugin/adaptor.go:43
↓ 1 callers
Function
CloneUsageExamples
CloneUsageExamples copies example facts for independent readers.
pluginkit/meta.go:906
↓ 1 callers
Function
CloneUsageSchema
CloneUsageSchema copies schema fields and localized metadata for independent readers.
pluginkit/meta.go:880
↓ 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:179
↓ 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
Method
Covers
Covers reports whether the scope holds a request for model, whose name without its @ modifiers is base, sent through a channel of channelType; 0 befor
setting/request_plugin_setting/config.go:93
↓ 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
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
pluginkit/icon.go:28
↓ 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
↓ 1 callers
Method
DefaultValue
()
model/migration_dialector.go:51
↓ 1 callers
Method
Delete
Delete rejects referenced vendors rather than leaving orphaned model records.
model/vendor_meta.go:80
↓ 1 callers
Method
DeleteAbilities
()
model/ability.go:278
↓ 1 callers
Method
DeleteByPrefix
(prefix string)
pkg/cachex/hybrid_cache.go:176
↓ 1 callers
Function
DeleteChannel
(c *gin.Context)
controller/channel.go:976
↓ 1 callers
Function
DeleteChannelBatch
(c *gin.Context)
controller/channel.go:1169
↓ 1 callers
Method
DeleteDeployment
DeleteDeployment deletes an active deployment
pkg/ionet/deployment.go:164
↓ 1 callers
Function
DeleteDisabledChannel
()
model/channel.go:1092
↓ 1 callers
Function
DeleteExpiredAuthFlows
(now time.Time)
model/auth_flow.go:306
↓ 1 callers
Function
DeleteExpiredUserAccessTokens
DeleteExpiredUserAccessTokens removes tokens that expired before the cutoff. Tokens that never expire are kept.
model/user_access_token.go:203
↓ 1 callers
Function
DeleteInvalidRedemptions
()
model/redemption.go:236
↓ 1 callers
Function
DeleteKey
(key string, purpose string)
common/verification.go:80
↓ 1 callers
Function
DeleteModelMeta
DeleteModelMeta 删除模型
controller/model_meta.go:193
↓ 1 callers
Function
DeleteOllamaModel
删除 Ollama 模型
relay/channel/ollama/relay-ollama.go:499
← previous
next →
5,101–5,200 of 15,592, ranked by callers