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
Function
searchVendors
(params: { association?: string keyword?: string p?: number page_size?: number })
web/src/features/models/api.ts:147
↓ 2 callers
Function
seedExportLogs
seedExportLogs stores logs of two users: three in the last hour and one from 400 days ago.
controller/log_export_test.go:55
↓ 2 callers
Function
seedHardcodedToolPrices
seedHardcodedToolPrices injects compile-time built-in fallbacks (tool defaults and model-prefix overrides) into the destination. The source is constan
setting/operation_setting/tools.go:43
↓ 2 callers
Function
seedSubscription
(t *testing.T, id int, userId int, amountTotal int64, amountUsed int64)
service/task_billing_test.go:110
↓ 2 callers
Function
seedreamUsageFacts
(lower, higher, inputImages, layered)
plugins/tasks/doubao/plugin.js:207
↓ 2 callers
Method
segments
segments splits the raw body at its delimiters: first is the offset of the first delimiter and newline the body's line break. Segment i+1 is part i, f
relay/requestplugin/form.go:239
↓ 2 callers
Function
selectLatestRelease
(payload: unknown)
web/src/features/system-update/releases.ts:91
↓ 2 callers
Method
send
()
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:193
↓ 2 callers
Method
send
send relays the body over the matched route. A credential line is no API key, so {api_key} in header overrides is empty while the request is built.
relay/channel/providerplugin/adaptor.go:659
↓ 2 callers
Function
sendChannelRequest
sendChannelRequest sends a channel management request through the channel's proxy and TLS setting. The caller closes the response body.
controller/channel_upstream_update.go:574
↓ 2 callers
Function
sendEmailBindingCodes
(lang string, state model.EmailBindingState, codes emailBindingCodes)
service/email_binding.go:181
↓ 2 callers
Method
sendError
(eventID, streamID string, apiErr *types.NewAPIError)
relay/responses_websocket.go:880
↓ 2 callers
Function
sendGeminiStreamResults
(c *gin.Context, results []relayconvert.ResponseResult)
relay/channel/openai/helper.go:103
↓ 2 callers
Function
sendGeminiStreamResults
(c *gin.Context, results []relayconvert.ResponseResult)
relay/channel/claude/relay-claude.go:206
↓ 2 callers
Method
sendManagement
sendManagement sends one management request built on header: the step's method, headers and body, the credential's headers and query, the channel's he
relay/channel/providerplugin/management.go:237
↓ 2 callers
Function
sendPluginFetch
sendPluginFetch sends one checked utils.fetch request with client. A redirect reaches the plugin as it is; fetching its location is a new request, che
service/provider_plugin.go:96
↓ 2 callers
Function
sendStreamData
(c *gin.Context, info *relaycommon.RelayInfo, data string, forceFormat bool, thinkToContent bool)
relay/channel/openai/relay-openai.go:24
↓ 2 callers
Function
sendWaffoWebhookResponse
sendWaffoWebhookResponse 发送签名响应
controller/topup_waffo.go:425
↓ 2 callers
Function
sentBody
The body a PUT sends over the wire: undefined fields are left out.
web/src/features/profile/__tests__/settings.test.tsx:62
↓ 2 callers
Function
serializeGroupPricingRows
(rows: GroupPricingRow[])
web/src/features/system-settings/models/group-ratio-visual-editor.tsx:183
↓ 2 callers
Function
serializeHeaderNavModules
( config: HeaderNavModulesConfig )
web/src/features/system-settings/maintenance/config.ts:179
↓ 2 callers
Method
serve
()
common/email_test.go:101
↓ 2 callers
Method
session
()
model/user_session.go:108
↓ 2 callers
Function
sessionDevice
( userAgent: string, unknownDevice: string, browserLabel: string, maxTouchPoints = 0 )
web/src/features/security/components/login-session-utils.ts:21
↓ 2 callers
Function
sessionView
(session *model.UserSession, current bool)
service/auth_session.go:423
↓ 2 callers
Function
setAccessTokenAuditParam
setAccessTokenAuditParam adds non-secret context, such as why a token was rejected, to the current request's access audit entry.
middleware/audit.go:295
↓ 2 callers
Function
setAccessTokenContext
setAccessTokenContext exposes the token grant to handlers. Scoped tokens also get a step-up identity bound to the token instead of a browser session.
middleware/auth.go:319
↓ 2 callers
Function
setCollapsible
(newCollapsible: Collapsible)
web/src/context/layout-provider.tsx:64
↓ 2 callers
Function
setFont
(font: Font)
web/src/context/font-provider.tsx:55
↓ 2 callers
Function
setHeaderPassthrough
( headerOverride: string | undefined, enabled: boolean )
web/src/features/channels/lib/header-passthrough.ts:66
↓ 2 callers
Function
setProtocolRequestBackground
(c *gin.Context, background bool)
controller/plugin_protocol_test.go:1552
↓ 2 callers
Method
setTarget
(target *websocket.Conn)
relay/responses_websocket.go:846
↓ 2 callers
Function
setTaskImageCount
setTaskImageCount publishes the billed image quantity of an image task as other.image_count, the same field the HTTP image relay writes, so the log de
service/task_billing.go:194
↓ 2 callers
Function
setTaskMediaResponseSecurityHeaders
(header http.Header)
controller/video_proxy.go:636
↓ 2 callers
Function
setTokenAutoGroups
(c *gin.Context, token *model.Token, groups []string)
controller/token.go:92
↓ 2 callers
Function
setVariant
(newVariant: Variant)
web/src/context/layout-provider.tsx:73
↓ 2 callers
Function
settleTestQuota
(info *relaycommon.RelayInfo, priceData hosttypes.PriceData, usage *dto.Usage)
controller/channel-test.go:583
↓ 2 callers
Function
setupEpayCallbackTest
setupEpayCallbackTest configures an Epay gateway and leaves model.DB nil: rejected callbacks and valid non-success events must never reach settlement,
controller/payment_webhook_availability_test.go:215
↓ 2 callers
Function
setupLoginAtAuthVersion
(user *model.User, expectedAuthVersion int64, c *gin.Context)
controller/user.go:164
↓ 2 callers
Function
shouldAuditParamPath
(path string)
relay/common/override.go:401
↓ 2 callers
Function
shouldLoadTaskArtifacts
( log: TaskLog, dialogOpen: boolean )
web/src/features/usage-logs/lib/task-artifacts.ts:204
↓ 2 callers
Function
shouldMatchStatusCodeRanges
(ranges []StatusCodeRange, code int)
setting/operation_setting/status_code_ranges.go:102
↓ 2 callers
Function
shouldSendUpstreamModelUpdateNotification
(now int64, changedChannels int, failedChannels int)
controller/channel_upstream_update.go:658
↓ 2 callers
Function
shouldShowBillingSource
( input: BillingSourceVisibilityInput )
web/src/features/usage-logs/lib/billing-source.ts:37
↓ 2 callers
Function
shouldSkipClaudeMessageDeltaUsagePatch
(info *relaycommon.RelayInfo)
relay/channel/claude/relay-claude.go:71
↓ 2 callers
Function
shouldUseDiskCache
shouldUseDiskCache 判断是否应该使用磁盘缓存
service/file_service.go:239
↓ 2 callers
Function
sizeDimensions
(size)
plugins/tasks/kling/plugin.js:186
↓ 2 callers
Function
sizeParts
(size)
plugins/tasks/google/plugin.js:118
↓ 2 callers
Function
sizeParts
(size)
plugins/tasks/vertex-ai/plugin.js:296
↓ 2 callers
Function
sizePixels
(size)
plugins/tasks/alibaba/plugin.js:502
↓ 2 callers
Function
sortModels
( models: PricingModel[], sortBy: string )
web/src/features/pricing/lib/filters.ts:195
↓ 2 callers
Function
sortedRankingBuckets
(bucketSet map[int64]struct{})
service/rankings.go:515
↓ 2 callers
Function
sourceMenu
()
web/src/features/task-plugins/__tests__/marketplace-panel.test.tsx:120
↓ 2 callers
Function
splitExpressionAtTopLevel
( source: string, operator: string )
web/src/features/pricing/lib/billing-expression/structure.ts:20
↓ 2 callers
Function
splitHeaderListValue
(raw string)
relay/common/override.go:1367
↓ 2 callers
Function
splitShebang
(text)
web/scripts/add-copyright.mjs:139
↓ 2 callers
Function
splitTopLevelMultiply
(expr: string)
web/src/features/pricing/lib/billing-expr.ts:364
↓ 2 callers
Function
splitWords
(value: string)
web/src/components/ai-elements/response-fade.ts:109
↓ 2 callers
Function
sqliteDSN
sqliteDSN turns a SQLITE_PATH value into a DSN. A bare path gets the default concurrency parameters; a value with its own query string is used as give
common/database.go:74
↓ 2 callers
Function
stale
()
web/src/features/channels/hooks/use-plugin-login.ts:75
↓ 2 callers
Method
start
()
pkg/jsplugin/engine.go:828
↓ 2 callers
Function
startOAuthBindResponseDeadline
( onTimeout: () => void, delay = 30_000, runtime: TimerRuntime = timeoutRuntime )
web/src/features/auth/lib/oauth-bind-window.ts:98
↓ 2 callers
Function
startOAuthBinding
(provider: string)
web/src/features/security/components/account-bindings.tsx:143
↓ 2 callers
Function
startPendingToolBlocks
(state *convmeta.ClaudeConvertInfo)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go:49
↓ 2 callers
Method
startText
()
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:426
↓ 2 callers
Function
stateMember
stateMember reads the state member of a result as JSON text, nil when the result has none.
pkg/jsplugin/provider.go:842
↓ 2 callers
Method
stateValue
stateValue is value with ctx.state, null when the plugin has set none.
pkg/jsplugin/provider.go:277
↓ 2 callers
Function
statusCodeRangesToString
(ranges []StatusCodeRange)
setting/operation_setting/status_code_ranges.go:87
↓ 2 callers
Method
stop
stop ends a response an instance stopped: the client gets an error event and, while the response runs, the upstream a response.cancel. Its other event
relay/requestplugin/socket.go:619
↓ 2 callers
Method
stopBlock
(block *responsesClaudeStreamBlock, estimatedInputTokens int)
relaykit/relayconvert/internal/oai_responses/to_claude_messages_stream_resp.go:364
↓ 2 callers
Function
stopCloseWatcher
()
web/src/features/auth/lib/oauth-popup.ts:64
↓ 2 callers
Method
stopIdle
()
relay/channel/providerplugin/stream.go:221
↓ 2 callers
Function
stopOpenBlocks
(state *convmeta.ClaudeConvertInfo)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go:22
↓ 2 callers
Function
stopReasonCohere2OpenAI
(reason string)
relay/channel/cohere/relay-cohere.go:72
↓ 2 callers
Method
stopStream
stopStream ends a stopped stream: an error event in the client's format, as mid-stream errors are written, and then nothing more. Canceling the reques
relay/requestplugin/reply.go:1469
↓ 2 callers
Function
storageKeyFor
(key: string)
web/src/components/floating-window.tsx:105
↓ 2 callers
Method
store
(fullKey string, client *http.Client)
service/http_client.go:217
↓ 2 callers
Function
storeTaskRequest
(c *gin.Context, info *RelayInfo, action string, requestObj TaskSubmitReq)
relay/common/relay_utils.go:120
↓ 2 callers
Method
stream
stream reads "G obj <<...>> stream" from lexer, past the object number, and returns the dictionary and the file data its /Length, read through resolve
relay/requestplugin/pdf.go:1131
↓ 2 callers
Function
streamLogs
(tx *gorm.DB, order string, fn func(*Log) error)
model/log.go:666
↓ 2 callers
Function
streamResponseGeminiChat2OpenAI
(geminiResponse *dto.GeminiChatResponse)
relay/channel/gemini/relay-gemini.go:179
↓ 2 callers
Function
streamsInterleave
(ctx)
plugins/tasks/alibaba/plugin.js:406
↓ 2 callers
Function
stringInt
(value int)
controller/token_auto_groups_test.go:37
↓ 2 callers
Function
stringMapMember
(object map[string]any, name, subject string)
pkg/jsplugin/provider.go:1824
↓ 2 callers
Function
stringSlice
(value any)
relaykit/relayconvert/internal/toolconv/decode.go:906
↓ 2 callers
Function
stringToColor
(str: string)
web/src/lib/colors.ts:178
↓ 2 callers
Function
submitImageCount
(req)
plugins/tasks/jimeng/plugin.js:203
↓ 2 callers
Function
subscriptionPlanCacheKey
(id int)
model/subscription.go:128
↓ 2 callers
Function
subscriptionPlanCacheTTL
()
model/subscription.go:54
↓ 2 callers
Function
subscriptionPlanInfoCacheTTL
()
model/subscription.go:62
↓ 2 callers
Function
summarize
summarize returns nil when nothing was sampled, so clients can show "no data" instead of a fabricated 0% success rate.
pkg/perf_metrics/metrics.go:528
↓ 2 callers
Function
summarize
summarize computes the request stage summary of a client request body in any chat format: OpenAI messages, Responses input, Claude messages and system
relay/requestplugin/relay.go:509
↓ 2 callers
Function
supportsChannelPluginExtensions
(channelType: number)
web/src/features/channels/lib/channel-plugin-extensions.ts:39
↓ 2 callers
Method
syncRelayInfo
syncRelayInfo 将 BillingSession 的状态同步到 RelayInfo 的兼容字段上。
service/billing_session.go:365
↓ 2 callers
Function
syncToCommon
syncToCommon 将配置同步到 common 包
setting/performance_setting/config.go:50
↓ 2 callers
Function
syncTopicLabel
(topic: string, t: TFunction)
web/src/features/system-info/lib/node-sync.ts:38
↓ 2 callers
Function
systemInstanceSyncStates
systemInstanceSyncStates reads what a node's registry row says it applied. A row written before node sync existed, or unreadable, has none.
service/node_sync.go:247
↓ 2 callers
Function
systemTaskLockUntil
()
service/system_task.go:459
↓ 2 callers
Function
tableHasCompactMeta
(table: Table<TData>)
web/src/components/data-table/layout/card-cell-utils.ts:54
↓ 2 callers
Method
take
take passes the text of one stream event to the instances, and queues the event until they released it. A transcript is read only: its event goes out
relay/requestplugin/reply.go:1063
← previous
next →
4,701–4,800 of 15,409, ranked by callers