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
↓ 2 callers
Method
Close
()
relay/channel/gemini/relay_responses_test.go:192
↓ 2 callers
Method
Close
()
relay/channel/minimax/adaptor_test.go:127
↓ 2 callers
Function
CloseChannelsAndBroadcast
(channelIDs []int, reason string)
pkg/wsmanager/wsmanager.go:105
↓ 2 callers
Method
CompleteHostedTool
(result HostedToolStreamResult)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:230
↓ 2 callers
Function
CompleteLoginVerification
CompleteLoginVerification must only run after a concrete factor ceremony. Recheck the bound version and method while consuming the flow and creating t
service/login_verification.go:150
↓ 2 callers
Method
ConfigSchemaJSON
ConfigSchemaJSON returns meta.configSchema as normalized JSON text, nil when the plugin declares none.
pkg/jsplugin/config_schema.go:101
↓ 2 callers
Function
ConfigToMap
ConfigToMap 将配置对象转换为map(导出函数)
setting/config/config.go:276
↓ 2 callers
Method
ConfigURLHosts
ConfigURLHosts returns the host, with its port when it has one, of every non-empty url format value of an instance config: the hosts utils.fetch may a
pkg/jsplugin/config_schema.go:111
↓ 2 callers
Function
ConfigureTrustedProxies
(engine *gin.Engine, trustedProxies []string)
common/trusted_proxies.go:49
↓ 2 callers
Function
ConsumeResponsesQuota
ConsumeResponsesQuota applies the same settlement dispatch to HTTP and WebSocket Responses usage. Compact requests keep their separate repricing.
relay/responses_handler.go:105
↓ 2 callers
Function
ContainsAudioCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:633
↓ 2 callers
Function
ContainsAudioRatio
(name string)
setting/ratio_setting/model_ratio.go:627
↓ 2 callers
Function
ContainsGroupRatio
(name string)
setting/ratio_setting/group_ratio.go:66
↓ 2 callers
Function
ContainsPayMethod
(method string)
setting/operation_setting/payment_setting_old.go:52
↓ 2 callers
Function
ContentParts
(content any)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:121
↓ 2 callers
Method
ConvertAudioRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.AudioRequest)
relay/channel/adapter.go:26
↓ 2 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/aws/adaptor.go:32
↓ 2 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/openai/adaptor.go:253
↓ 2 callers
Function
ConvertSimpleChangeParams
(content string)
service/midjourney.go:245
↓ 2 callers
Function
ConvertStreamResponse
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, response any)
service/response_converter.go:18
↓ 2 callers
Function
CopyChannel
CopyChannel handles cloning an existing channel with its key. POST /api/channel/copy/:id Optional query params: suffix - string appended to
controller/channel.go:1815
↓ 2 callers
Function
CountChannelTags
(query *gorm.DB)
model/channel.go:1332
↓ 2 callers
Function
CountClaudeTokens
CountClaudeTokens implements Anthropic's token-counting utility endpoint. It deliberately skips upstream generation and billing; callers use this endp
controller/relay.go:292
↓ 2 callers
Function
CountOldLog
(ctx context.Context, targetTimestamp int64)
model/log.go:776
↓ 2 callers
Function
CountRequestToken
CountRequestToken counts request tokens regardless of the billing estimation switch. Utility endpoints such as Claude's messages/count_tokens must rem
service/token_counter.go:59
↓ 2 callers
Function
CoverPlusActionToNormalAction
(midjRequest *dto.MidjourneyRequest)
service/midjourney.go:186
↓ 2 callers
Function
CoverTaskActionToModelName
(platform constant.TaskPlatform, action string)
service/task.go:9
↓ 2 callers
Function
CreateCacheRatio2JSONString
CreateCacheRatio2JSONString converts the create cache ratio map to a JSON string
setting/ratio_setting/cache_ratio.go:149
↓ 2 callers
Function
CreateCustomOAuthProvider
CreateCustomOAuthProvider creates a new custom OAuth provider. No periodic reload covers the providers, so the sync topic bumps in the same transactio
model/custom_oauth_provider.go:112
↓ 2 callers
Function
CreateLoginSessionAtAuthVersion
(userID int, expectedAuthVersion int64, loginMethod, ip, userAgent string)
service/auth_session.go:56
↓ 2 callers
Function
CreateUserOAuthBindingWithTx
CreateUserOAuthBindingWithTx creates a new OAuth binding within a transaction
model/user_oauth_binding.go:85
↓ 2 callers
Function
CreateWaffoPancakeCheckoutSession
CreateWaffoPancakeCheckoutSession creates an Authenticated-mode checkout session: the order is bound to BuyerIdentity (stable per user) so it stays at
service/waffo_pancake.go:99
↓ 2 callers
Function
CriticalRateLimit
()
middleware/rate-limit.go:190
↓ 2 callers
Function
DeclareAccessTokenPermissionRoute
DeclareAccessTokenPermissionRoute records that the Casbin permission guarding a route is also the token scope it requires. It runs while routes are re
middleware/access_token_routes.go:324
↓ 2 callers
Function
DecodeBase64ImageData
return image.Config, format, clean base64 string, error
service/image.go:20
↓ 2 callers
Function
DecodeJson
(reader io.Reader, v any)
relaykit/relayconvert/kitutil/json.go:76
↓ 2 callers
Function
DecodeJsonBody
DecodeJsonBody reads one JSON value and requires EOF after trailing whitespace. Seekable readers let the decoder process large values through a bounde
common/json.go:67
↓ 2 callers
Function
DeepSeekToolsHelper
DeepSeekToolsHelper relays the DeepSeek Search and Fetch APIs like v1/alpha/search: the raw body is forwarded, the response is returned unchanged, and
relay/deepseek_tools_handler.go:27
↓ 2 callers
Method
Delete
()
model/model_meta.go:272
↓ 2 callers
Method
Delete
()
model/token.go:332
↓ 2 callers
Function
DeleteCustomOAuthProvider
DeleteCustomOAuthProvider deletes a custom OAuth provider by ID, with its sync topic bump in the same transaction.
model/custom_oauth_provider.go:140
↓ 2 callers
Function
DeleteExpiredUserSessions
(now int64)
model/user_session.go:798
↓ 2 callers
Function
DeleteFinishedSystemTasks
DeleteFinishedSystemTasks deletes, in batches, the succeeded and failed rows last updated before cutoff. The newest row of every type stays: the sched
model/system_task.go:332
↓ 2 callers
Function
DeleteOldRevokedUserSessions
(now int64)
model/user_session.go:810
↓ 2 callers
Function
DeletePasskeyByUserIDWithAuthVersion
(userID int)
model/passkey.go:265
↓ 2 callers
Function
DeleteSystemTaskHistory
DeleteSystemTaskHistory preserves the latest row of every type because the scheduler uses it to determine when the next run is due. Active rows and ro
model/system_task.go:236
↓ 2 callers
Function
DeleteUserAccessTokensWithTx
(tx *gorm.DB, userID int)
model/user_access_token.go:186
↓ 2 callers
Function
DeleteUserForSession
(identity AuthSessionIdentity)
model/user.go:950
↓ 2 callers
Function
DisableCache
()
middleware/disable-cache.go:5
↓ 2 callers
Function
DisableChannelByTag
(tag string)
model/channel.go:992
↓ 2 callers
Function
DisableTwoFAWithAuthVersion
DisableTwoFAWithAuthVersion atomically removes the factor and invalidates every access token issued against the previous security configuration.
model/twofa.go:239
↓ 2 callers
Function
DoFormRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:408
↓ 2 callers
Method
DoRequestWith
DoRequestWith is DoRequest with the request URL and headers built by transport, which may add to the route's own: a provider plugin channel passes its
relay/channel/advancedcustom/adaptor.go:291
↓ 2 callers
Function
DoTaskApiRequest
(a TaskAdaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:606
↓ 2 callers
Function
DoWssRequest
DoWssRequest dials the adaptor's upstream over WebSocket for the realtime and Responses WebSocket relays. It honors the channel proxy, is bound to the
relay/channel/api_request.go:451
↓ 2 callers
Method
Done
()
relaykit/relayconvert/internal/oai_responses/to_claude_messages_stream_resp.go:61
↓ 2 callers
Function
DropPluginCredentials
DropPluginCredentials removes the credential lines from the key of a channel copy, since a credential belongs to the channel its login stored it on. A
service/provider_plugin.go:660
↓ 2 callers
Method
EditWithTx
(tx *gorm.DB, updatePassword bool)
model/user.go:870
↓ 2 callers
Method
EffectiveToolLossPolicy
()
relaykit/relayconvert/convmeta/options.go:127
↓ 2 callers
Function
EnableChannel
(channelId int, usingKey string, channelName string)
service/channel.go:55
↓ 2 callers
Function
EnableTwoFAEnrollment
EnableTwoFAEnrollment validates and consumes one setup in the same transaction as factor activation and auth_version advancement. A bad code can be re
model/twofa_enrollment.go:70
↓ 2 callers
Method
Error
()
controller/video_proxy.go:43
↓ 2 callers
Method
Error
()
oauth/linuxdo.go:195
↓ 2 callers
Method
EstimateBilling
── Billing ────────────────────────────────────────────────────── EstimateBilling returns OtherRatios for pre-charge based on user request. Called aft
relay/channel/adapter.go:55
↓ 2 callers
Function
EstimateFamily
EstimateFamily returns the estimated token count of text for a tokenizer family. Unrecognized families use the FamilyUnknown weights.
tokenkit/tokenkit.go:149
↓ 2 callers
Function
ExpireStaleSystemTaskLocks
(now int64)
model/system_task.go:516
↓ 2 callers
Method
Expired
Expired reports whether the token has an absolute expiry at or before now.
model/user_access_token.go:81
↓ 2 callers
Function
ExplicitUserOverrides
ExplicitUserOverrides returns only the per-user override entries.
service/authz/override.go:108
↓ 2 callers
Function
ExtractHostedResponse
ExtractHostedResponse removes server-executed tool artifacts before a message converter sees them. The artifacts travel beside multi-step routes, just
relaykit/relayconvert/internal/toolconv/response_artifacts.go:63
↓ 2 callers
Function
ExtractOutputTextFromResponses
(resp *dto.OpenAIResponsesResponse)
service/openai_chat_responses_compat.go:28
↓ 2 callers
Function
ExtractOutputTextFromResponses
(resp *dto.OpenAIResponsesResponse)
relaykit/relayconvert/response_compat.go:188
↓ 2 callers
Method
FailureEvent
FailureEvent terminates an already-started stream after a host observation, hook, or validation failure. It never accepts a detail string, preventing
relay/plugin_protocol.go:536
↓ 2 callers
Method
FetchMode
()
service/task_polling.go:40
↓ 2 callers
Method
FetchTask
(baseURL string, key string, task *model.Task, proxy string)
service/task_polling.go:31
↓ 2 callers
Method
FillUserByGitHubId
()
model/user.go:1101
↓ 2 callers
Method
FillUserById
()
model/user.go:1085
↓ 2 callers
Method
FinalFromEvents
FinalFromEvents synthesizes the retrieval Response for stream-only plugins from one renderEvents call at terminal task status. Synthesis runs on a scr
relay/plugin_protocol.go:607
↓ 2 callers
Method
FinalizeResponsesRequest
(info *relaycommon.RelayInfo, body []byte)
relay/channel/adapter.go:40
↓ 2 callers
Function
FindEarliestPendingSystemTasks
(taskTypes []string)
model/system_task.go:168
↓ 2 callers
Function
FindMetadataVendor
(vendors map[string]*Vendor, name string)
model/vendor_management.go:26
↓ 2 callers
Function
FixAbility
()
model/ability.go:366
↓ 2 callers
Method
Flush
()
relay/channel/aws/relay_aws_test.go:64
↓ 2 callers
Function
FormatClaudeResponseInfo
(claudeResponse *dto.ClaudeResponse, oaiResponse *dto.ChatCompletionsStreamResponse, claudeInfo *ClaudeRespons
relaykit/relayconvert/internal/claude_messages/to_oai_chat_resp.go:496
↓ 2 callers
Function
GeminiImageHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:547
↓ 2 callers
Function
GeminiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:83
↓ 2 callers
Function
GeminiTextGenerationStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini-native.go:97
↓ 2 callers
Method
GeminiUsageMetadata
()
relaykit/dto/gemini.go:723
↓ 2 callers
Function
GenerateBackupCodes
GenerateBackupCodes 生成备用恢复码
common/totp.go:50
↓ 2 callers
Function
GenerateKey
()
common/utils.go:229
↓ 2 callers
Function
GenerateMjOtherInfo
(relayInfo *relaycommon.RelayInfo, priceData hosttypes.PriceData)
service/log_info_generate.go:335
↓ 2 callers
Function
GenerateStartEmptyResponse
(id string, createAt int64, model string, systemFingerprint *string)
relay/helper/common.go:343
↓ 2 callers
Method
Get
(key string)
pkg/jsplugin/routing.go:499
↓ 2 callers
Function
Get2FAIssuer
Get2FAIssuer 获取2FA发行者名称
common/totp.go:116
↓ 2 callers
Function
GetAllCustomOAuthProviders
GetAllCustomOAuthProviders returns all custom OAuth providers
model/custom_oauth_provider.go:76
↓ 2 callers
Function
GetAllFlowQuotaDates
(c *gin.Context)
controller/usedata.go:85
↓ 2 callers
Function
GetAllLogs
(filter LogFilter, startIdx int, num int)
model/log.go:530
↓ 2 callers
Function
GetAllProviders
GetAllProviders returns all registered OAuth providers
oauth/registry.go:70
↓ 2 callers
Function
GetAllUserSubscriptions
GetAllUserSubscriptions returns all subscriptions (active and expired) for a user.
model/subscription.go:916
↓ 2 callers
Function
GetAllUsers
(pageInfo *common.PageInfo, sortOptions ...UserSortOptions)
model/user.go:403
↓ 2 callers
Function
GetAndValidateGeminiRequest
(c *gin.Context)
relay/helper/valid_request.go:399
← previous
next →
3,101–3,200 of 15,409, ranked by callers