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
↓ 2 callers
Function
multipartMemoryLimit
multipartMemoryLimit returns the configured multipart memory limit in bytes
common/gin.go:487
↓ 2 callers
Function
nativeBody
(ctx)
plugins/tasks/jimeng/plugin.js:120
↓ 2 callers
Function
nativeRequest
(ctx)
plugins/tasks/alibaba/plugin.js:399
↓ 2 callers
Method
needsRefundLocked
()
service/billing_session.go:138
↓ 2 callers
Function
newAPIGateway
newAPIGateway emulates the upstream New API instance a type-60 channel points at: it answers only on the plugin's prefixed native routes, requires the
relay/channel/task/jsplugin/adaptor_test.go:2770
↓ 2 callers
Function
newAwsStreamResponse
(request *http.Request, body io.ReadCloser)
relay/channel/aws/relay_aws_test.go:140
↓ 2 callers
Function
newCallMedia
(request *requestMedia, view []byte, media []inlineMedia, form *formBody)
relay/requestplugin/attachments.go:290
↓ 2 callers
Function
newEpayRSAKeyPairForTest
newEpayRSAKeyPairForTest returns a throwaway key pair as single-line Base64 text, the format Epay merchant consoles show.
controller/payment_webhook_availability_test.go:312
↓ 2 callers
Function
newFakeUpstream
(t *testing.T)
router/provider_plugin_relay_test.go:72
↓ 2 callers
Method
newFallbackID
()
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_req.go:345
↓ 2 callers
Function
newGeminiChatBillingUsage
(metadata *GeminiUsageMetadata, estimated bool)
relaykit/dto/billing_usage.go:210
↓ 2 callers
Function
newGeminiStreamResponse
(candidates []dto.GeminiChatCandidate, usage *dto.Usage, info convmeta.Meta)
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_resp.go:478
↓ 2 callers
Function
newGormAdapter
(db *gorm.DB)
service/authz/adapter.go:18
↓ 2 callers
Function
newJSONStateNode
(value any, depth int, budget *jsonStateBudget)
pluginkit/json_state.go:99
↓ 2 callers
Function
newKeywordList
(text string, hash [sha256.Size]byte)
pluginkit/keywords.go:52
↓ 2 callers
Function
newLoginSession
(userID int, authVersion int64, loginMethod, ip, userAgent string)
service/auth_session.go:104
↓ 2 callers
Function
newMemoryStorage
(data []byte)
common/body_storage.go:76
↓ 2 callers
Function
newMultipartFileContext
(t *testing.T, field, filename, contentType string, content []byte)
relay/channel/task/jsplugin/adaptor_test.go:324
↓ 2 callers
Function
newNodeSyncRegistry
()
service/node_sync.go:52
↓ 2 callers
Function
newOpenAIBillingUsage
(source string, usage *Usage)
relaykit/dto/billing_usage.go:66
↓ 2 callers
Function
newPassThroughBody
(t *testing.T, payload []byte)
relay/channel/api_request_getbody_test.go:442
↓ 2 callers
Function
newPlanOf
newPlanOf is the plan of instances, in their order.
relay/requestplugin/plan.go:140
↓ 2 callers
Function
newPluginRouterTestWithProxies
( t *testing.T, plugins []*jsplugin.LoadedPlugin, handlers pluginRouteHandlers, trustedProxies []string, )
router/plugin_router_test.go:1025
↓ 2 callers
Function
newProtectedFetchHTTPClientWithDialer
(resolver ssrfResolver, dialContext func(ctx context.Context, network, address string) (net.Conn, error), getP
service/protected_fetch_client.go:62
↓ 2 callers
Function
newRelayHTTPClient
(transport http.RoundTripper)
service/http_client.go:132
↓ 2 callers
Function
newRelayHTTPTransport
()
service/http_client.go:79
↓ 2 callers
Function
newReportError
newReportError is the error a client received, as the record shows it.
relay/requestplugin/report.go:325
↓ 2 callers
Function
newReportQueue
(records int, maxBytes int64, workers int)
relay/requestplugin/report.go:461
↓ 2 callers
Function
newResponseStreamStateFromSpec
(from types.RelayFormat, target types.RelayFormat, options ResponseStreamOptions, spec ResponseConverterSpec)
relaykit/relayconvert/response_registry.go:579
↓ 2 callers
Function
newResponsesWSRequestRunner
(c *gin.Context)
controller/responses_websocket.go:76
↓ 2 callers
Function
newRevokeServer
(t *testing.T)
controller/provider_plugin_test.go:55
↓ 2 callers
Method
newRuntime
(ctx context.Context)
pluginkit/engine.go:871
↓ 2 callers
Method
newStreamConverter
newStreamConverter converts the stream of an upstream request whose convertResponse would read state as ctx.state.
relay/channel/providerplugin/stream.go:69
↓ 2 callers
Function
newTaskAPIRequest
(c *gin.Context, fullRequestURL string, requestBody io.Reader)
relay/channel/api_request.go:642
↓ 2 callers
Function
newTaskArtifactAccessLimiter
(limits system_setting.TaskArtifactAccessLimits)
middleware/task_artifact_access.go:45
↓ 2 callers
Function
newTestTLSCertificate
()
common/email_test.go:215
↓ 2 callers
Method
newline
newline ends the current line unless the text is empty or ends one.
relay/requestplugin/extract.go:59
↓ 2 callers
Method
next
()
web/src/features/pricing/lib/billing-expression/parser.ts:81
↓ 2 callers
Method
next
next reads one message as convertStreamEvent gets it: event is the :event-type header, or :exception-type or :error-code for an exception or an error,
relay/channel/providerplugin/eventstream.go:35
↓ 2 callers
Function
nextRequestBody
nextRequestBody is the body and content type of a chained request: its body with $file markers filled in, its form, its client file, or none.
relay/channel/providerplugin/chain.go:92
↓ 2 callers
Function
nextTaskPluginBaseUrl
( currentValue: string | undefined, previousDefault: string | undefined, nextDefault: string | undefined
web/src/features/channels/lib/task-plugin-base-url.ts:85
↓ 2 callers
Function
noAvailableChannelMessage
noAvailableChannelMessage logs candidate plugin keys under the request ID. A 503 also tells the caller when a task plugin claims the model.
middleware/distributor.go:144
↓ 2 callers
Function
nodeSyncState
( node: NodeSyncNode, topics: string[] )
web/src/features/system-info/lib/node-sync.ts:55
↓ 2 callers
Function
nonnegativePriceLiteral
(node: ExpressionNode)
web/src/features/pricing/lib/billing-expression/display.ts:83
↓ 2 callers
Function
normalizeAccessTokenName
normalizeAccessTokenName returns the trimmed name, or false when it is empty or longer than the 64-character column.
controller/access_token.go:53
↓ 2 callers
Function
normalizeAdvancedCustomRouteModels
( models: string[] | undefined )
web/src/features/channels/lib/advanced-custom.ts:848
↓ 2 callers
Function
normalizeBaseUrl
(value: string | undefined)
web/src/features/channels/lib/channel-form.ts:924
↓ 2 callers
Function
normalizeChannelModelMapping
(channel *model.Channel)
controller/channel_upstream_update.go:155
↓ 2 callers
Function
normalizeChannelTestMode
(value?: string)
web/src/features/system-settings/request-policies/channel-health-section.tsx:145
↓ 2 callers
Function
normalizeClaudeEffort
(effort Effort, capabilities claudeCapabilities)
relaykit/relayconvert/reasoning/claude.go:456
↓ 2 callers
Function
normalizeClickHouseDSN
(dsn string)
model/main.go:127
↓ 2 callers
Function
normalizeCondition
( condition: Record<string, unknown> = {} )
web/src/features/channels/components/dialogs/param-override-editor-dialog.tsx:495
↓ 2 callers
Function
normalizeCondition
( cond: Partial<RequestCondition> | null | undefined )
web/src/features/pricing/lib/billing-expr.ts:728
↓ 2 callers
Function
normalizeGeminiSchemaTypeAndNullable
(schema map[string]interface{})
relaykit/relayconvert/internal/shared/gemini/schema.go:172
↓ 2 callers
Function
normalizeHttp2ConnectionShards
( value: number | undefined | null )
web/src/features/channels/lib/channel-form.ts:98
↓ 2 callers
Function
normalizeLookupValues
(values []string)
model/model_meta.go:430
↓ 2 callers
Function
normalizeMetaBaseURL
normalizeMetaBaseURL admits an absolute http(s) URL that a channel can adopt verbatim as its base URL: no credentials, query, or fragment, an ASCII lo
pluginkit/meta.go:2032
↓ 2 callers
Function
normalizeModelList
(models: unknown[] = [])
web/src/features/channels/lib/upstream-update-utils.ts:19
↓ 2 callers
Function
normalizeOperation
( operation: Record<string, unknown> = {} )
web/src/features/channels/components/dialogs/param-override-editor-dialog.tsx:511
↓ 2 callers
Function
normalizePlanType
(value: unknown)
web/src/features/channels/components/dialogs/codex-usage-dialog.tsx:239
↓ 2 callers
Function
normalizePluginConfig
normalizePluginConfig validates the plugin config in the channel's settings and stores it as the schema reads it: declared properties only, defaults l
controller/channel.go:565
↓ 2 callers
Function
normalizePluginSourceUrl
(input: string)
web/src/features/task-plugins/lib/plugin-url.ts:38
↓ 2 callers
Function
normalizeReason
(reason string)
pkg/wsmanager/wsmanager.go:234
↓ 2 callers
Function
normalizeRequestPluginInstances
normalizeRequestPluginInstances checks an instance list and returns it as it is saved: ids filled in, names trimmed and configs validated. An enabled
controller/request_plugin.go:92
↓ 2 callers
Function
normalizeResolution
(value)
plugins/tasks/doubao/plugin.js:408
↓ 2 callers
Function
normalizeResponsesReasoningReplay
DeepSeek's stateless Responses API requires plaintext reasoning before an assistant tool step, including a step resumed after a tool result. Reproduce
relay/channel/deepseek/responses_reasoning.go:46
↓ 2 callers
Function
normalizeResponsesWSCreateEvent
normalizeResponsesWSCreateEvent builds the HTTP-shaped request body from a response.create whose envelope the read loop already parsed and validated.
relay/responses_websocket.go:973
↓ 2 callers
Function
normalizeSyncValue
(field string, value any)
controller/ratio_sync.go:125
↓ 2 callers
Function
normalizeTaskMediaHost
(scheme, host string)
controller/video_proxy.go:574
↓ 2 callers
Function
normalizeTaskVisualConfig
( config: TaskVisualConfig | null | undefined, schema: BillingUsageSchema )
web/src/features/pricing/lib/task-expr.ts:307
↓ 2 callers
Function
normalizeUserSettings
( setting?: string )
web/src/features/profile/lib/user-settings.ts:36
↓ 2 callers
Function
normalizeV1Meta
(meta *Meta)
pluginkit/meta.go:1151
↓ 2 callers
Function
noteTaskQuotaClamp
noteTaskQuotaClamp records the first quota saturation event onto the task's RelayInfo so LogTaskConsumption can surface it on the submit log's admin_i
relay/relay_task.go:466
↓ 2 callers
Function
notifyAdmins
notifyAdmins sends a notice to each enabled administrator for whom receives returns true, and returns how many notices it sent.
service/user_notify.go:42
↓ 2 callers
Function
notifySystemTaskRunner
notifySystemTaskRunner wakes the runner without blocking. If a wakeup is already pending it is a no-op, which is fine since one pass drains all work.
service/system_task.go:116
↓ 2 callers
Method
numeric
(node: ExpressionNode)
web/src/features/pricing/lib/billing-expression/runtime.ts:313
↓ 2 callers
Function
objectMembers
(data json.RawMessage, subject string)
pkg/requestpatch/patch.go:246
↓ 2 callers
Function
objectStreamData
objectStreamData is the data of an object stream holding objects under numbers, and the offset of the first object in it.
relay/requestplugin/pdf_test.go:107
↓ 2 callers
Function
observeStreamChoices
observeStreamChoices collects billable function call names and records the finish reason facts used by health sampling from one parsed chunk.
relay/channel/openai/relay-openai.go:203
↓ 2 callers
Method
offSlot
offSlot runs work, which waits or computes in Go, with the call's JavaScript clock stopped and its execution slot lent to other calls. It returns the
pluginkit/media.go:217
↓ 2 callers
Function
ollamaChatHandler
non-stream handler for chat/generate
relay/channel/ollama/stream.go:224
↓ 2 callers
Function
ollamaStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/ollama/stream.go:143
↓ 2 callers
Function
ollamaToolCallsToOpenAI
(toolCalls []OllamaToolCall, startIndex int, includeIndex bool)
relay/channel/ollama/stream.go:45
↓ 2 callers
Function
omitTrailingAssistantText
omitTrailingAssistantText drops the assistant turns without tool calls that end the converted conversation after a user turn or tool result. In Respon
relaykit/relayconvert/internal/oai_responses/req_helpers.go:70
↓ 2 callers
Function
omniDuration
(req)
plugins/tasks/vertex-ai/plugin.js:155
↓ 2 callers
Function
omniResolution
(req)
plugins/tasks/vertex-ai/plugin.js:147
↓ 2 callers
Function
omniUsageFacts
(seconds, resolution)
plugins/tasks/vertex-ai/plugin.js:27
↓ 2 callers
Function
onPaginationChange
(updater)
web/src/hooks/use-table-url-state.ts:169
↓ 2 callers
Function
onlyMembers
(members map[string]json.RawMessage, subject string, allowed ...string)
pkg/requestpatch/patch.go:254
↓ 2 callers
Function
openAIImageRuleFor
(model, detail string)
tokenkit/image.go:96
↓ 2 callers
Function
openTokenControllerExternalDB
(t *testing.T, dialect string, dsn string)
controller/token_test.go:123
↓ 2 callers
Function
openTokenControllerTestDB
(t *testing.T)
controller/token_test.go:82
↓ 2 callers
Function
openaiImageDataHasField
openaiImageDataHasField reports whether an image data entry carries a non-empty string value for field.
relay/channel/openai/relay_image.go:87
↓ 2 callers
Function
openaiImageResponseCount
openaiImageResponseCount counts billable images in an OpenAI-format image response body. An object-shaped data is one image when it carries url or b64
relay/channel/openai/relay_image.go:61
↓ 2 callers
Function
optionsKeyIsUnique
(db *gorm.DB)
model/option_primary_key_migration.go:46
↓ 2 callers
Function
optionsRevision
(t *testing.T)
model/sensitive_word_migration_test.go:14
↓ 2 callers
Function
orderCardCells
( cells: Cell<TData, unknown>[] )
web/src/components/data-table/layout/card-row-content.tsx:26
↓ 2 callers
Function
orderProtocolSupports
(protocol string, supports []string)
pluginkit/routing.go:149
↓ 2 callers
Function
originKey
(req *http.Request)
service/http_transport_sharded.go:40
↓ 2 callers
Function
originTaskTestContext
(userID int)
middleware/task_plugin_origin_task_test.go:73
← previous
next →
4,401–4,500 of 15,592, ranked by callers