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
TaskPlatformUnavailableError
TaskPlatformUnavailableError explains why no adaptor serves the platform: the task-plugin system is switched off, the resolved plugin is disabled, or
relay/relay_adaptor.go:175
↓ 2 callers
Function
TaskPluginMarketplaceSourceKind
TaskPluginMarketplaceSourceKind returns the kind of the source at indexURL: the built-in official addresses are official, the built-in community addre
setting/task_plugin.go:33
↓ 2 callers
Function
TaskReport
TaskReport is what a task submission keeps for the report at the task's final state: the report instances in scope, the request as the record shows it
relay/requestplugin/task_report.go:59
↓ 2 callers
Method
TimeoutResponse
TimeoutResponse is the documented non-stream polling timeout shape. Unlike a live stream timeout, its top-level state remains queued so clients know t
relay/plugin_protocol.go:645
↓ 2 callers
Method
ToMap
()
relaykit/dto/openai_request.go:304
↓ 2 callers
Method
ToSetting
()
types/price_data.go:119
↓ 2 callers
Method
ToWebAuthnCredential
()
model/passkey.go:75
↓ 2 callers
Function
TokenOperationAudit
TokenOperationAudit runs after UserAuth and before endpoint rate limits. Handlers add only allowlisted metadata; neither bodies nor raw errors are per
middleware/audit.go:210
↓ 2 callers
Function
UnbindAccountOAuth
(identity AuthIdentity, providerID int)
service/account_security.go:15
↓ 2 callers
Function
UnmarshalNoCopy
UnmarshalNoCopy lets supporting codecs borrow strings and raw JSON from data. Keep data and borrowed raw JSON immutable while decoded values are in us
relaykit/relayconvert/kitutil/json.go:65
↓ 2 callers
Function
UnmarshalNoCopy
UnmarshalNoCopy borrows strings and raw JSON from data. Keep data and borrowed raw JSON immutable while decoded values are in use.
common/json.go:53
↓ 2 callers
Method
UnmarshalNoCopy
(data []byte, v any)
common/json.go:31
↓ 2 callers
Method
Unwrap
()
relay/helper/common.go:34
↓ 2 callers
Method
Update
()
model/topup.go:120
↓ 2 callers
Method
Update
Update 更新供应商记录
model/vendor_meta.go:57
↓ 2 callers
Method
Update
Update Make sure your token's fields is completed, because this will update non-zero values
model/token.go:314
↓ 2 callers
Function
UpdateAbilityStatusByTag
(tag string, status bool)
model/ability.go:346
↓ 2 callers
Function
UpdateAudioCompletionRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:680
↓ 2 callers
Function
UpdateAudioRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:672
↓ 2 callers
Method
UpdateBillingState
()
model/midjourney.go:176
↓ 2 callers
Function
UpdateCreateCacheRatioByJSONString
UpdateCreateCacheRatioByJSONString updates the create cache ratio map from a JSON string
setting/ratio_setting/cache_ratio.go:159
↓ 2 callers
Function
UpdateCustomOAuthProvider
UpdateCustomOAuthProvider updates an existing custom OAuth provider, with its sync topic bump in the same transaction.
model/custom_oauth_provider.go:126
↓ 2 callers
Function
UpdateImageRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:654
↓ 2 callers
Function
UpdateModelPricingOptions
UpdateModelPricingOptions keeps legacy single-option callers on the same locking, validation and transaction path as the model-level API.
model/model_pricing_config.go:666
↓ 2 callers
Function
UpdatePluginKeyBalances
UpdatePluginKeyBalances merges results into the channel's per-key balance records and updates the USD balance when the results have one.
service/provider_plugin_balance.go:36
↓ 2 callers
Method
UpdateQuota
()
model/task.go:577
↓ 2 callers
Method
UpdateResponseTime
(responseTime int64)
model/channel.go:667
↓ 2 callers
Function
UpdateTaskPluginMarketplaceSources
(c *gin.Context)
controller/task_plugin.go:877
↓ 2 callers
Function
UpdateUserAccessToken
UpdateUserAccessToken renames one token owned by userID and, when scopes is not nil, replaces its grant.
model/user_access_token.go:147
↓ 2 callers
Function
UpdateUserBindColumnForSessionWithTx
(tx *gorm.DB, identity AuthSessionIdentity, column, value string)
model/account_security.go:115
↓ 2 callers
Function
UpsertPerfMetric
(metric *PerfMetric)
model/perf_metric.go:29
↓ 2 callers
Function
UpstreamAddresses
UpstreamAddresses returns the addresses masked in errors shown to users: the upstream the admin configured for the selected channel and the proxies it
common/gin.go:225
↓ 2 callers
Function
UsageFromClaudeUsage
(usage *dto.Usage)
relaykit/relayconvert/response_compat.go:108
↓ 2 callers
Method
UsageText
()
relaykit/relayconvert/response_registry.go:451
↓ 2 callers
Function
UsesFormRequest
UsesFormRequest reports a request whose body is multipart form data.
relay/channel/advancedcustom/adaptor.go:309
↓ 2 callers
Function
ValidPluginKey
ValidPluginKey checks the canonical identifier accepted by plugin manifests.
pkg/jsplugin/registry.go:46
↓ 2 callers
Function
ValidateAccessTokenIdentity
ValidateAccessTokenIdentity checks a token-bound step-up identity without taking locks, for use before issuing a verification proof.
model/user_access_token.go:253
↓ 2 callers
Function
ValidateBackupCode
ValidateBackupCode 验证并使用备用码
model/twofa.go:197
↓ 2 callers
Function
ValidateBackupCode
ValidateBackupCode 验证备用码格式
common/totp.go:83
↓ 2 callers
Method
ValidateChannelConfig
ValidateChannelConfig checks the plugin config an administrator saves on a channel against meta.channelConfig and returns what the channel stores: the
pkg/jsplugin/config_schema.go:220
↓ 2 callers
Function
ValidateClaudeDefaultMaxTokens
ValidateClaudeDefaultMaxTokens validates the JSON persisted by the option API. Zero stays allowed — the current Messages API accepts max_tokens: 0 as
setting/model_setting/claude.go:97
↓ 2 callers
Function
ValidateGeminiSafetySettings
ValidateGeminiSafetySettings validates the JSON persisted by the option API. Empty values remain valid because read-time fallback returns the default.
setting/model_setting/gemini.go:84
↓ 2 callers
Method
ValidateHTTPTransport
ValidateHTTPTransport validates save-time HTTP transport channel settings.
relaykit/dto/channel_settings.go:76
↓ 2 callers
Function
ValidateIconImage
ValidateIconImage checks raw PNG or SVG bytes for a plugin logo. PNG must carry the PNG signature. SVG must be well-formed XML rooted at svg without s
pkg/jsplugin/icon.go:50
↓ 2 callers
Function
ValidateMaxTokenAutoGroups
(value string)
setting/auto_group.go:51
↓ 2 callers
Function
ValidateModelEndpoints
ValidateModelEndpoints accepts the existing map form (custom paths) and type-array form (declared protocols), but never arbitrary JSON scalars.
model/model_metadata_sync.go:111
↓ 2 callers
Function
ValidateMultipartDirect
(c *gin.Context, info *RelayInfo)
relay/common/relay_utils.go:199
↓ 2 callers
Function
ValidateNewAccountPassword
ValidateNewAccountPassword applies only when a user chooses a new password. Authentication must continue to accept historical passwords without applyi
common/account_password.go:34
↓ 2 callers
Function
ValidateRedirectURL
ValidateRedirectURL validates that a redirect URL is safe to use. It checks that: - The URL is properly formatted - The scheme is either http or https
common/url_validator.go:19
↓ 2 callers
Function
ValidateRequestChatUnsupportedFields
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:142
↓ 2 callers
Function
ValidateResendConfiguration
ValidateResendConfiguration is shared by provider activation and delivery. It checks local configuration only; saving settings never sends an email.
common/email_resend.go:22
↓ 2 callers
Function
ValidateTaskArtifactStoreConfig
ValidateTaskArtifactStoreConfig performs syntax checks only. It never resolves hosts, contacts an endpoint, or verifies credentials.
setting/system_setting/task_artifact_store.go:79
↓ 2 callers
Method
ValidateToolLossPolicy
ValidateToolLossPolicy validates the channel-level request-phase tool-loss policy. Empty keeps the default allow policy.
relaykit/dto/channel_settings.go:161
↓ 2 callers
Function
ValidateTopUpQuotaCapacity
ValidateTopUpQuotaCapacity performs the user-facing pre-payment check. The settlement path repeats the same invariant with an atomic conditional updat
model/topup.go:71
↓ 2 callers
Function
VerifyCodeWithKey
(key string, code string, purpose string)
common/verification.go:47
↓ 2 callers
Function
VertexResolutionRatio
(model, resolution string)
setting/task_pricing_setting/config.go:38
↓ 2 callers
Function
WithCapacity
(c int64)
common/limiter/limiter.go:95
↓ 2 callers
Function
WithRate
(r int64)
common/limiter/limiter.go:99
↓ 2 callers
Function
WithRequested
(n int64)
common/limiter/limiter.go:103
↓ 2 callers
Method
Write
(data []byte)
relay/helper/common.go:38
↓ 2 callers
Function
WriteRefreshCookie
(c *gin.Context, rawToken string)
service/auth_session.go:325
↓ 2 callers
Method
WriteString
(data string)
relay/helper/common.go:43
↓ 2 callers
Function
WssError
(c *gin.Context, ws *websocket.Conn, openaiError types.OpenAIError)
relay/helper/common.go:321
↓ 2 callers
Function
acceptH2TestConnection
(ln net.Listener)
relay/channel/api_request_getbody_test.go:252
↓ 2 callers
Function
accessTokenPermissionGroups
( catalog: AccessTokenCatalog )
web/src/features/security/lib/access-token-catalog.ts:31
↓ 2 callers
Function
accessTokenScopeRule
(scope string)
middleware/access_token_routes.go:35
↓ 2 callers
Method
acquire
(ip, taskID, artifactKey string)
middleware/task_artifact_access.go:79
↓ 2 callers
Function
actionHasRole
(action ActionDefinition, roleKey string)
service/authz/registry.go:71
↓ 2 callers
Function
activeSystemTaskStatuses
()
model/system_task.go:589
↓ 2 callers
Function
add
(value)
plugins/tasks/content-moderation/plugin.js:209
↓ 2 callers
Method
add
add appends upstream text to an output.
relay/requestplugin/reply.go:236
↓ 2 callers
Method
addFinding
addFinding counts a finding by rule and category, at most 64 of them.
relay/requestplugin/reply.go:422
↓ 2 callers
Method
addRange
(low, high, target pdfToken)
relay/requestplugin/pdf.go:459
↓ 2 callers
Method
addReference
(kind, mime, url, filename, pointer string)
relay/requestplugin/attachments.go:472
↓ 2 callers
Function
addSyncTask
addSyncTask inserts a pending sync task. Every write gets its own row, so no write is lost; the master marks the rows done once the nodes applied them
model/system_sync_task.go:68
↓ 2 callers
Function
addTag
(tag: string)
web/src/components/tag-input.tsx:47
↓ 2 callers
Method
addTools
addTools adds the tool calls of one hook result.
relay/channel/providerplugin/adaptor.go:294
↓ 2 callers
Function
adjustSyncPrice
( values: PricingSyncValues, mode: PriceAdjustment, rate: number | null )
web/src/features/system-settings/models/upstream-price-adjustment.ts:37
↓ 2 callers
Function
advanceCurrentSessionToVersion
(identity AuthIdentity, nextUserAuthVersion int64, reason string)
service/auth_session.go:211
↓ 2 callers
Function
allFormats
--------------------------------------------------------------------------- Tests --------------------------------------------------------------------
relaykit/relayconvert/golden_test.go:281
↓ 2 callers
Function
allowedGroupSet
(groups []string)
pkg/perf_metrics/metrics.go:414
↓ 2 callers
Function
analyzeError
(errorLogs)
electron/main.js:64
↓ 2 callers
Method
annotationDelta
(annotation any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:235
↓ 2 callers
Method
announceTool
announceTool also allocates the output index, so a held tool never ends up behind items that were added to the stream before it.
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:583
↓ 2 callers
Function
apiCategoryOf
* Refine the broad PROFILE_BY_NAME bucket into an API-shape category. The * `image` bucket from `PROFILE_BY_NAME` lumps still-image and video models
web/src/features/pricing/lib/mock-stats.ts:774
↓ 2 callers
Function
apiKeyFromWebSocketSubprotocol
(protocols string)
middleware/auth.go:658
↓ 2 callers
Function
apiRoot
(ctx)
plugins/tasks/alibaba/plugin.js:432
↓ 2 callers
Function
apiRoot
(ctx)
plugins/tasks/doubao/plugin.js:341
↓ 2 callers
Function
apiRoot
(ctx)
plugins/tasks/xai/plugin.js:142
↓ 2 callers
Function
apiRoot
(ctx)
plugins/tasks/google/plugin.js:64
↓ 2 callers
Function
apiRoot
(ctx)
plugins/tasks/vidu/plugin.js:173
↓ 2 callers
Function
apiRoot
(ctx)
plugins/tasks/hailuo/plugin.js:195
↓ 2 callers
Method
appendAnnotations
(block *responsesClaudeStreamBlock, annotations []any, estimatedInputTokens int, snapshot bool)
relaykit/relayconvert/internal/oai_responses/to_claude_messages_stream_resp.go:426
↓ 2 callers
Function
appendCapped
(record, entries []relaycommon.RequestPluginRecord)
relay/requestplugin/socket.go:426
↓ 2 callers
Function
appendGroundingAnnotations
( annotations []any, chunks []geminiGroundingChunk, support geminiGroundingSupport, start int, end int,
relaykit/relayconvert/internal/gemini_chat/grounding.go:286
↓ 2 callers
Function
appendRequestPath
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, other *model.LogOther)
service/log_info_generate.go:49
↓ 2 callers
Function
appendTaskLogInfo
(task *model.Task, other *model.LogOther)
service/task_billing.go:219
↓ 2 callers
Function
appendUsageBillingPathForLog
(other *model.LogOther, isLocalCountTokens bool, usage *dto.Usage)
service/billing_usage.go:56
↓ 2 callers
Function
applyAuthRotation
(value: unknown)
web/src/lib/auth-session.ts:162
↓ 2 callers
Function
applyChannelUpstreamModelUpdates
( channel *model.Channel, addModelsInput []string, ignoreModelsInput []string, removeModelsInput []string,
controller/channel_upstream_update.go:1057
← previous
next →
3,501–3,600 of 15,409, ranked by callers