Documentation
¶
Index ¶
- Constants
- func AddChannel(c *gin.Context)
- func AddRedemption(c *gin.Context)
- func AddToken(c *gin.Context)
- func Admin2FAStats(c *gin.Context)
- func AdminBindSubscription(c *gin.Context)
- func AdminClearUserBinding(c *gin.Context)
- func AdminCompleteTopUp(c *gin.Context)
- func AdminCreateSubscriptionPlan(c *gin.Context)
- func AdminCreateUserSubscription(c *gin.Context)
- func AdminDeleteUserSubscription(c *gin.Context)
- func AdminDisable2FA(c *gin.Context)
- func AdminInvalidateUserSubscription(c *gin.Context)
- func AdminListSubscriptionPlans(c *gin.Context)
- func AdminListUserSubscriptions(c *gin.Context)
- func AdminResetPasskey(c *gin.Context)
- func AdminResetPlanSubscriptions(c *gin.Context)
- func AdminResetUserSubscriptionsByPlan(c *gin.Context)
- func AdminUpdateSubscriptionPlan(c *gin.Context)
- func AdminUpdateSubscriptionPlanStatus(c *gin.Context)
- func ApplyAllChannelUpstreamModelUpdates(c *gin.Context)
- func ApplyChannelUpstreamModelUpdates(c *gin.Context)
- func ApplyOpenAIPricePublication(c *gin.Context)
- func ApplyQuotaWriterModeTransition(c *gin.Context)
- func AuthLogout(c *gin.Context)
- func AutomaticallyUpdateChannels(frequency int)
- func BatchSetChannelTag(c *gin.Context)
- func BatchUpdateChannelStatus(c *gin.Context)
- func CancelPromptLearningRun(c *gin.Context)
- func ChannelListModels(c *gin.Context)
- func CheckClusterNameAvailability(c *gin.Context)
- func CleanupLogFiles(c *gin.Context)
- func ClearChannelAffinityCache(c *gin.Context)
- func ClearDiskCache(c *gin.Context)
- func CompleteCodexOAuth(c *gin.Context)
- func CompleteCodexOAuthForChannel(c *gin.Context)
- func ConfirmPaymentCompliance(c *gin.Context)
- func CopyChannel(c *gin.Context)
- func CreateCustomOAuthProvider(c *gin.Context)
- func CreateDeployment(c *gin.Context)
- func CreateLogCleanupSystemTask(c *gin.Context)
- func CreateModelMeta(c *gin.Context)
- func CreatePrefillGroup(c *gin.Context)
- func CreatePromptLearningVersion(c *gin.Context)
- func CreateUser(c *gin.Context)
- func CreateVendorMeta(c *gin.Context)
- func CreateWaffoPancakePair(c *gin.Context)
- func CreateWaffoPancakeSubscriptionProduct(c *gin.Context)
- func CreemWebhook(c *gin.Context)
- func DashboardListModels(c *gin.Context)
- func DeleteAllFullContentLogFiles(c *gin.Context)
- func DeleteChannel(c *gin.Context)
- func DeleteChannelBatch(c *gin.Context)
- func DeleteCustomOAuthProvider(c *gin.Context)
- func DeleteDeployment(c *gin.Context)
- func DeleteDisabledChannel(c *gin.Context)
- func DeleteFullContentLogFile(c *gin.Context)
- func DeleteInvalidRedemption(c *gin.Context)
- func DeleteLoginSession(c *gin.Context)
- func DeleteModelMeta(c *gin.Context)
- func DeletePrefillGroup(c *gin.Context)
- func DeleteRedemption(c *gin.Context)
- func DeleteSelf(c *gin.Context)
- func DeleteStaleSystemInstance(c *gin.Context)
- func DeleteStaleSystemInstances(c *gin.Context)
- func DeleteToken(c *gin.Context)
- func DeleteTokenBatch(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func DeleteVendorMeta(c *gin.Context)
- func DetectAllChannelUpstreamModelUpdates(c *gin.Context)
- func DetectChannelUpstreamModelUpdates(c *gin.Context)
- func Disable2FA(c *gin.Context)
- func DisableTagChannels(c *gin.Context)
- func DoCheckin(c *gin.Context)
- func DownloadFullContentLogFile(c *gin.Context)
- func DriveQuotaWriterDrains(c *gin.Context)
- func EditTagChannels(c *gin.Context)
- func EmailBind(c *gin.Context)
- func Enable2FA(c *gin.Context)
- func EnableTagChannels(c *gin.Context)
- func EnabledListModels(c *gin.Context)
- func EpayNotify(c *gin.Context)
- func ExtendDeployment(c *gin.Context)
- func FetchCustomOAuthDiscovery(c *gin.Context)
- func FetchModels(c *gin.Context)
- func FetchUpstreamModels(c *gin.Context)
- func FetchUpstreamRatios(c *gin.Context)
- func FixChannelsAbilities(c *gin.Context)
- func ForceGC(c *gin.Context)
- func GenerateAccessToken(c *gin.Context)
- func GenerateOAuthCode(c *gin.Context)
- func Get2FAStatus(c *gin.Context)
- func GetAbout(c *gin.Context)
- func GetAdminRecentLogOverview(c *gin.Context)
- func GetAffCode(c *gin.Context)
- func GetAllChannels(c *gin.Context)
- func GetAllDeployments(c *gin.Context)
- func GetAllFlowQuotaDates(c *gin.Context)
- func GetAllLogs(c *gin.Context)
- func GetAllMidjourney(c *gin.Context)
- func GetAllModelsMeta(c *gin.Context)
- func GetAllQuotaDates(c *gin.Context)
- func GetAllRedemptions(c *gin.Context)
- func GetAllTask(c *gin.Context)
- func GetAllTokens(c *gin.Context)
- func GetAllTopUps(c *gin.Context)
- func GetAllUsers(c *gin.Context)
- func GetAllVendors(c *gin.Context)
- func GetAuthHeader(token string) http.Header
- func GetAvailableReplicas(c *gin.Context)
- func GetChannel(c *gin.Context)
- func GetChannelAffinityCacheStats(c *gin.Context)
- func GetChannelAffinityUsageCacheStats(c *gin.Context)
- func GetChannelKey(c *gin.Context)
- func GetChannelOps(c *gin.Context)
- func GetChannelQuotaAlertDeliveryEvents(c *gin.Context)
- func GetChannelQuotaAlertDeliveryStatus(c *gin.Context)
- func GetChannelQuotaChanges(c *gin.Context)
- func GetChannelQuotaHistory(c *gin.Context)
- func GetChannelQuotaSamplingStatus(c *gin.Context)
- func GetChannelRoutingPreview(c *gin.Context)
- func GetChargedAmount(count float64, user model.User) float64
- func GetCheckinStatus(c *gin.Context)
- func GetClaudeAuthHeader(token string) http.Header
- func GetCodexChannelRateLimitResetCredits(c *gin.Context)
- func GetCodexChannelUsage(c *gin.Context)
- func GetCodexChannelUsageHistory(c *gin.Context)
- func GetCodexLocalAuthStatus(c *gin.Context)
- func GetContainerDetails(c *gin.Context)
- func GetCurrentSystemTask(c *gin.Context)
- func GetCustomOAuthProvider(c *gin.Context)
- func GetCustomOAuthProviders(c *gin.Context)
- func GetDeployment(c *gin.Context)
- func GetDeploymentLogs(c *gin.Context)
- func GetEpayClient(paymentConfig setting.PaymentConfig) *epay.Client
- func GetFrozenOpenAIOfficialPriceSource(c *gin.Context)
- func GetFullContentLogDetail(c *gin.Context)
- func GetGroups(c *gin.Context)
- func GetHardwareTypes(c *gin.Context)
- func GetHomePageContent(c *gin.Context)
- func GetImage(c *gin.Context)
- func GetLocations(c *gin.Context)
- func GetLogByKey(c *gin.Context)
- func GetLogFiles(c *gin.Context)
- func GetLoginSessions(c *gin.Context)
- func GetLogsSelfStat(c *gin.Context)
- func GetLogsStat(c *gin.Context)
- func GetMidjourney(c *gin.Context)
- func GetMissingModels(c *gin.Context)
- func GetModelDeploymentSettings(c *gin.Context)
- func GetModelMeta(c *gin.Context)
- func GetNotice(c *gin.Context)
- func GetOpenAIOfficialPricing(c *gin.Context)
- func GetOptionDiagnostics(c *gin.Context)
- func GetOptionRemediations(c *gin.Context)
- func GetOptions(c *gin.Context)
- func GetOptionsTypedBulkRevision(c *gin.Context)
- func GetPendingUsageReviews(c *gin.Context)
- func GetPerfMetrics(c *gin.Context)
- func GetPerfMetricsSummary(c *gin.Context)
- func GetPerformanceStats(c *gin.Context)
- func GetPermissionCatalog(c *gin.Context)
- func GetPrefillGroups(c *gin.Context)
- func GetPriceEstimation(c *gin.Context)
- func GetPricePublicationState(c *gin.Context)
- func GetPricing(c *gin.Context)
- func GetPrivacyPolicy(c *gin.Context)
- func GetPromptLearningPolicy(c *gin.Context)
- func GetQuotaDatesByUser(c *gin.Context)
- func GetQuotaWriterStatus(c *gin.Context)
- func GetQuotaWriterTransitionPlan(c *gin.Context)
- func GetQuotaWriterTransitions(c *gin.Context)
- func GetRankings(c *gin.Context)
- func GetRatioConfig(c *gin.Context)
- func GetRedemption(c *gin.Context)
- func GetResponseBody(ctx context.Context, method, url string, channel *model.Channel, ...) ([]byte, error)
- func GetSelf(c *gin.Context)
- func GetSetup(c *gin.Context)
- func GetStatus(c *gin.Context)
- func GetSubscription(c *gin.Context)
- func GetSubscriptionPlans(c *gin.Context)
- func GetSubscriptionSelf(c *gin.Context)
- func GetSyncableChannels(c *gin.Context)
- func GetSystemTask(c *gin.Context)
- func GetTagModels(c *gin.Context)
- func GetTaskOperation(c *gin.Context)
- func GetToken(c *gin.Context)
- func GetTokenAutoGroups(c *gin.Context)
- func GetTokenBudget(c *gin.Context)
- func GetTokenKey(c *gin.Context)
- func GetTokenKeysBatch(c *gin.Context)
- func GetTokenStatus(c *gin.Context)
- func GetTokenUsage(c *gin.Context)
- func GetTopUpInfo(c *gin.Context)
- func GetUptimeKumaStatus(c *gin.Context)
- func GetUsage(c *gin.Context)
- func GetUsageReview(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUserAgreement(c *gin.Context)
- func GetUserFlowQuotaDates(c *gin.Context)
- func GetUserGroups(c *gin.Context)
- func GetUserLogs(c *gin.Context)
- func GetUserMidjourney(c *gin.Context)
- func GetUserModels(c *gin.Context)
- func GetUserOAuthBindings(c *gin.Context)
- func GetUserOAuthBindingsByAdmin(c *gin.Context)
- func GetUserQuotaDates(c *gin.Context)
- func GetUserRecentLogOverview(c *gin.Context)
- func GetUserTask(c *gin.Context)
- func GetUserTopUps(c *gin.Context)
- func GetUserUsagePolicy(c *gin.Context)
- func GetVendorMeta(c *gin.Context)
- func HandleOAuth(c *gin.Context)
- func ImportCodexLocalAuth(c *gin.Context)
- func ImportCodexLocalAuthForChannel(c *gin.Context)
- func ListDeploymentContainers(c *gin.Context)
- func ListFullContentLogFiles(c *gin.Context)
- func ListFullContentLogs(c *gin.Context)
- func ListModels(c *gin.Context, modelType int)
- func ListPromptLearningRuns(c *gin.Context)
- func ListPromptLearningVersions(c *gin.Context)
- func ListSystemInstances(c *gin.Context)
- func ListSystemTasks(c *gin.Context)
- func ListWaffoPancakeCatalog(c *gin.Context)
- func ListWaffoPancakeSubscriptionProductOptions(c *gin.Context)
- func LockOrder(tradeNo string)
- func Login(c *gin.Context)
- func ManageMultiKeys(c *gin.Context)
- func ManageUser(c *gin.Context)
- func OllamaDeleteModel(c *gin.Context)
- func OllamaPullModel(c *gin.Context)
- func OllamaPullModelStream(c *gin.Context)
- func OllamaVersion(c *gin.Context)
- func OptionRemediateApply(c *gin.Context)
- func OptionRemediateDryRun(c *gin.Context)
- func PasskeyDelete(c *gin.Context)
- func PasskeyLoginBegin(c *gin.Context)
- func PasskeyLoginFinish(c *gin.Context)
- func PasskeyRegisterBegin(c *gin.Context)
- func PasskeyRegisterFinish(c *gin.Context)
- func PasskeyStatus(c *gin.Context)
- func PasskeyVerifyBegin(c *gin.Context)
- func PasskeyVerifyFinish(c *gin.Context)
- func Playground(c *gin.Context)
- func PostSetup(c *gin.Context)
- func PreviewOpenAIPricePublication(c *gin.Context)
- func RebuildChannelAffinityCache(c *gin.Context)
- func RebuildDiskCache(c *gin.Context)
- func ReconcileUsageReview(c *gin.Context)
- func RecoverTextDispatchUsage(c *gin.Context)
- func RecoverTokenBudget(c *gin.Context)
- func RefreshAuth(c *gin.Context)
- func RefreshCodexChannelCredential(c *gin.Context)
- func RegenerateBackupCodes(c *gin.Context)
- func Register(c *gin.Context)
- func RegisterScheduledSystemTasks()
- func Relay(c *gin.Context, relayFormat types.RelayFormat)
- func RelayMidjourney(c *gin.Context)
- func RelayNotFound(c *gin.Context)
- func RelayNotImplemented(c *gin.Context)
- func RelayTask(c *gin.Context)
- func RelayTaskFetch(c *gin.Context)
- func RequestAmount(c *gin.Context)
- func RequestCreemPay(c *gin.Context)
- func RequestEpay(c *gin.Context)
- func RequestStripeAmount(c *gin.Context)
- func RequestStripePay(c *gin.Context)
- func RequestWaffoAmount(c *gin.Context)
- func RequestWaffoPancakeAmount(c *gin.Context)
- func RequestWaffoPancakePay(c *gin.Context)
- func RequestWaffoPay(c *gin.Context)
- func ResetCodexChannelUsage(c *gin.Context)
- func ResetModelRatio(c *gin.Context)
- func ResetPassword(c *gin.Context)
- func ResetPerformanceStats(c *gin.Context)
- func RetrieveModel(c *gin.Context, modelType int)
- func RevokeOtherLoginSessions(c *gin.Context)
- func RunChannelQuotaAlertDelivery(c *gin.Context)
- func SaveOpenAIOfficialPriceSource(c *gin.Context)
- func SaveWaffoPancake(c *gin.Context)
- func SearchAllLogs(c *gin.Context)deprecated
- func SearchChannels(c *gin.Context)
- func SearchDeployments(c *gin.Context)
- func SearchModelsMeta(c *gin.Context)
- func SearchRedemptions(c *gin.Context)
- func SearchTokens(c *gin.Context)
- func SearchUserLogs(c *gin.Context)deprecated
- func SearchUsers(c *gin.Context)
- func SearchVendors(c *gin.Context)
- func SendEmailVerification(c *gin.Context)
- func SendPasswordResetEmail(c *gin.Context)
- func Setup2FA(c *gin.Context)
- func StartCodexOAuth(c *gin.Context)
- func StartCodexOAuthForChannel(c *gin.Context)
- func StripeWebhook(c *gin.Context)
- func SubscriptionEpayNotify(c *gin.Context)
- func SubscriptionEpayReturn(c *gin.Context)
- func SubscriptionRequestBalancePay(c *gin.Context)
- func SubscriptionRequestCreemPay(c *gin.Context)
- func SubscriptionRequestEpay(c *gin.Context)
- func SubscriptionRequestStripePay(c *gin.Context)
- func SubscriptionRequestWaffoPancakePay(c *gin.Context)
- func SyncUpstreamModels(c *gin.Context)
- func SyncUpstreamPreview(c *gin.Context)
- func TelegramBind(c *gin.Context)
- func TelegramBindStart(c *gin.Context)
- func TelegramLogin(c *gin.Context)
- func TestAllChannels(c *gin.Context)
- func TestChannel(c *gin.Context)
- func TestIoNetConnection(c *gin.Context)
- func TestStatus(c *gin.Context)
- func TopUp(c *gin.Context)
- func TransferAffQuota(c *gin.Context)
- func UnbindCustomOAuth(c *gin.Context)
- func UnbindCustomOAuthByAdmin(c *gin.Context)
- func UniversalVerify(c *gin.Context)
- func UnlockOrder(tradeNo string)
- func UpdateAllChannelsBalance(c *gin.Context)
- func UpdateChannel(c *gin.Context)
- func UpdateChannelBalance(c *gin.Context)
- func UpdateChannelQuotaAlertDeliverySettings(c *gin.Context)
- func UpdateChannelStatus(c *gin.Context)
- func UpdateCustomOAuthProvider(c *gin.Context)
- func UpdateDeployment(c *gin.Context)
- func UpdateDeploymentName(c *gin.Context)
- func UpdateModelMeta(c *gin.Context)
- func UpdateOption(c *gin.Context)
- func UpdateOptionsTypedBulk(c *gin.Context)
- func UpdatePaymentFundingOptions(c *gin.Context)
- func UpdatePrefillGroup(c *gin.Context)
- func UpdatePromptLearningPolicy(c *gin.Context)
- func UpdateRedemption(c *gin.Context)
- func UpdateSelf(c *gin.Context)
- func UpdateSubscriptionPreference(c *gin.Context)
- func UpdateToken(c *gin.Context)
- func UpdateTokenBudget(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UpdateUserSetting(c *gin.Context)
- func UpdateUserUsagePolicy(c *gin.Context)
- func UpdateVendorMeta(c *gin.Context)
- func UserFundingMutationGate(c *gin.Context)
- func Verify2FALogin(c *gin.Context)
- func VideoProxy(c *gin.Context)
- func WaffoPancakeWebhook(c *gin.Context)
- func WaffoWebhook(c *gin.Context)
- func WeChatAuth(c *gin.Context)
- func WeChatBind(c *gin.Context)
- type AIProxyUserOverviewResponse
- type APGC2DGPTUsageResponse
- type API2GPTUsageResponse
- type AddChannelRequest
- type AdminBindSubscriptionRequest
- type AdminCompleteTopupRequest
- type AdminCreateUserSubscriptionRequest
- type AdminResetSubscriptionRequest
- type AdminUpdateSubscriptionPlanStatusRequest
- type AdminUpsertSubscriptionPlanRequest
- type AmountRequest
- type BillingPreferenceRequest
- type ChannelBatch
- type ChannelStatusBatchRequest
- type ChannelStatusRequest
- type ChannelTag
- type CreateCustomOAuthProviderRequest
- type CreemAdaptor
- type CreemCheckoutRequest
- type CreemCheckoutResponse
- type CreemPayRequest
- type CreemProduct
- type CreemWebhookEvent
- type CustomOAuthProviderResponse
- type DeepSeekUsageResponse
- type DiskCacheInfo
- type EpayRequest
- type FetchCustomOAuthDiscoveryRequest
- type FullContentLogDetail
- type FullContentLogFacets
- type FullContentLogFileInfo
- type FullContentLogFileStats
- type FullContentLogListResponse
- type FullContentLogSummary
- type FullContentLogTokenOption
- type KeyStatus
- type LogFileInfo
- type LogFilesResponse
- type LoginRequest
- type ManageRequest
- type MemoryStats
- type Monitor
- type MultiKeyManageRequest
- type MultiKeyStatusResponse
- type OAuthEmailAlreadyTakenError
- type OAuthRegistrationDisabledError
- type OAuthUserDeletedError
- type OpenAICreditGrants
- type OpenAIModel
- type OpenAIModelsResponse
- type OpenAISBUsageResponse
- type OpenAISubscriptionResponse
- type OpenAIUsageDailyCost
- type OpenAIUsageResponse
- type OpenRouterCreditResponse
- type OptionUpdateRequest
- type PasswordResetRequest
- type PatchChannel
- type PaymentComplianceRequest
- type PaymentFundingOptionsUpdateRequest
- type PerformanceConfig
- type PerformanceStats
- type Setup
- type Setup2FARequest
- type Setup2FAResponse
- type SetupRequest
- type SiliconFlowUsageResponse
- type StripeAdaptor
- type StripePayRequest
- type SubscriptionBalancePayRequest
- type SubscriptionCreemPayRequest
- type SubscriptionEpayPayRequest
- type SubscriptionPlanDTO
- type SubscriptionStripePayRequest
- type SubscriptionWaffoPancakePayRequest
- type TaskBillingOutboxSummary
- type TaskRecoverySummary
- type TokenBatch
- type TransferAffQuotaRequest
- type TypedBulkOptionsUpdateRequest
- type UniversalVerifyRequest
- type UpdateCustomOAuthProviderRequest
- type UpdateUserSettingRequest
- type UptimeGroupResult
- type UserOAuthBindingResponse
- type Verify2FARequest
- type WaffoPancakePayRequest
- type WaffoPayRequest
Constants ¶
const CreemSignatureHeader = "creem-signature"
Variables ¶
This section is empty.
Functions ¶
func AddChannel ¶
func AddRedemption ¶
func AdminBindSubscription ¶
func AdminClearUserBinding ¶
func AdminCreateUserSubscription ¶
AdminCreateUserSubscription creates a new user subscription from a plan (no payment).
func AdminDeleteUserSubscription ¶
AdminDeleteUserSubscription hard-deletes a user subscription.
func AdminInvalidateUserSubscription ¶
AdminInvalidateUserSubscription cancels a user subscription immediately.
func AdminResetPasskey ¶
func ApplyQuotaWriterModeTransition ¶
ApplyQuotaWriterModeTransition applies the gated mode switch. The response always carries the persisted evidence row when one was written; condition failures additionally list the missing audit checks.
func AuthLogout ¶
func AutomaticallyUpdateChannels ¶
func AutomaticallyUpdateChannels(frequency int)
func BatchSetChannelTag ¶
func CancelPromptLearningRun ¶
func ChannelListModels ¶
func CompleteCodexOAuth ¶
func CopyChannel ¶
CopyChannel handles cloning an existing channel with its key. POST /api/channel/copy/:id Optional query params:
suffix - string appended to the original name (default "_复制") reset_balance - bool, when true will reset balance & used_quota to 0 (default true)
func CreateCustomOAuthProvider ¶
CreateCustomOAuthProvider creates a new custom OAuth provider
func CreateDeployment ¶
func CreateUser ¶
func CreateWaffoPancakePair ¶
CreateWaffoPancakePair mints a Store + OnetimeProduct pair in one round- trip. Surfaces an orphan-store flag when the product half fails so the frontend can preselect / retry without losing context.
func CreateWaffoPancakeSubscriptionProduct ¶
CreateWaffoPancakeSubscriptionProduct mints an OnetimeProduct (not SubscriptionProduct — see service.CreateWaffoPancakeProductForPlan) sized to a plan's `name` + `amount`, using persisted Pancake credentials + StoreID. Reads from the form, not the plan row, so newly-typed unsaved plans can mint a product too.
func CreemWebhook ¶
func DashboardListModels ¶
func DeleteChannel ¶
func DeleteChannelBatch ¶
func DeleteCustomOAuthProvider ¶
DeleteCustomOAuthProvider deletes a custom OAuth provider
func DeleteDeployment ¶
func DeleteDisabledChannel ¶
func DeleteInvalidRedemption ¶
func DeleteLoginSession ¶
func DeleteRedemption ¶
func DeleteSelf ¶
func DeleteToken ¶
func DeleteTokenBatch ¶
func DeleteUser ¶
func DetectAllChannelUpstreamModelUpdates ¶
DetectAllChannelUpstreamModelUpdates enqueues a model_update system task (manual variant) instead of scanning inline. Routing the manual trigger through the framework gives it the same cross-instance lease dedup and run history as the scheduled scan. If any model_update task is already active, the manual run is rejected so the caller does not mistake a scheduled run for this manual one.
func DisableTagChannels ¶
func DriveQuotaWriterDrains ¶
DriveQuotaWriterDrains is the admin recovery surface that synchronously drives the batch update queue, balance drain generations and projection obligations towards zero, bounded by the requested budget.
func EditTagChannels ¶
func EnableTagChannels ¶
func EnabledListModels ¶
func EpayNotify ¶
func ExtendDeployment ¶
func FetchCustomOAuthDiscovery ¶
FetchCustomOAuthDiscovery fetches OIDC discovery document via backend (root-only route)
func FetchModels ¶
func FetchUpstreamModels ¶
func FetchUpstreamRatios ¶
func FixChannelsAbilities ¶
func GenerateAccessToken ¶
func GenerateOAuthCode ¶
GenerateOAuthCode generates a state code for OAuth CSRF protection
func GetAffCode ¶
func GetAllChannels ¶
func GetAllDeployments ¶
func GetAllFlowQuotaDates ¶
func GetAllLogs ¶
func GetAllMidjourney ¶
func GetAllQuotaDates ¶
func GetAllRedemptions ¶
func GetAllTask ¶
func GetAllTokens ¶
func GetAllUsers ¶
func GetAvailableReplicas ¶
func GetChannel ¶
func GetChannelKey ¶
GetChannelKey 获取渠道密钥(需要通过安全验证中间件) 此函数依赖 SecureVerificationRequired 中间件,确保用户已通过安全验证
func GetChannelOps ¶
func GetChannelQuotaChanges ¶
GetChannelQuotaChanges returns one redacted trend item per channel/metric/ window/source group. It is intentionally read-only: no provider is queried and no credentials or raw provider responses are returned.
func GetChannelQuotaHistory ¶
GetChannelQuotaHistory returns normalized quota observations for a channel. It deliberately excludes raw upstream responses and credentials. The range is fully read before aggregation; when an explicit safety budget would be exceeded, the response is marked incomplete instead of pretending that the newest observations represent the requested range.
func GetChannelQuotaSamplingStatus ¶
GetChannelQuotaSamplingStatus exposes only the effective sampler settings so administrators can understand an empty trend panel without inspecting the deployment environment. It never starts a task or returns credentials.
func GetClaudeAuthHeader ¶
GetClaudeAuthHeader get claude auth header
func GetCodexChannelUsage ¶
func GetCodexChannelUsageHistory ¶
GetCodexChannelUsageHistory serves normalized snapshots collected by the usage endpoint. It reuses the bounded history response contract while enforcing the Codex metric scope for callers that do not pass a filter.
func GetCodexLocalAuthStatus ¶
func GetContainerDetails ¶
func GetCurrentSystemTask ¶
func GetCustomOAuthProvider ¶
GetCustomOAuthProvider returns a single custom OAuth provider by ID
func GetCustomOAuthProviders ¶
GetCustomOAuthProviders returns all custom OAuth providers
func GetDeployment ¶
func GetDeploymentLogs ¶
func GetEpayClient ¶
func GetEpayClient(paymentConfig setting.PaymentConfig) *epay.Client
func GetFullContentLogDetail ¶
func GetHardwareTypes ¶
func GetHomePageContent ¶
func GetLocations ¶
func GetLogByKey ¶
func GetLoginSessions ¶
func GetLogsSelfStat ¶
func GetLogsStat ¶
func GetMidjourney ¶
func GetMissingModels ¶
GetMissingModels returns the list of model names that are referenced by channels but do not have corresponding records in the models meta table. This helps administrators quickly discover models that need configuration.
func GetOpenAIOfficialPricing ¶
This endpoint returns source evidence only. Fetching is not publication and cannot overwrite any effective price, model ratio, or administrator override.
func GetOptionDiagnostics ¶
GetOptionDiagnostics serves the root-only, no-store diagnostics route. Its business path never reads a runtime generation or cache; platform-level authentication and rate limiting remain responsible for their own controls.
func GetOptionRemediations ¶
GetOptionRemediations serves the paginated remediation registry. Registry rows contain keys, hashes, statuses, and backup references only; backup values never leave the database through this or any other API.
func GetOptions ¶
func GetOptionsTypedBulkRevision ¶
GetOptionsTypedBulkRevision handles GET /api/option/typed-bulk/revision and exposes the current persistent typed bulk revision so admin forms can load it before issuing a CAS-guarded bulk save.
func GetPendingUsageReviews ¶
func GetPerfMetrics ¶
func GetPerfMetricsSummary ¶
func GetPermissionCatalog ¶
GetPermissionCatalog returns the permission schema used by the client to render the permission editor: the registry of resources with their actions and display label keys, plus the roles with their baseline grant matrices. Defining it in the authz package keeps the schema in a single place.
func GetPrefillGroups ¶
GetPrefillGroups 获取预填组列表,可通过 ?type=xxx 过滤
func GetPriceEstimation ¶
func GetPricing ¶
func GetPrivacyPolicy ¶
func GetPromptLearningPolicy ¶
func GetQuotaDatesByUser ¶
func GetQuotaWriterStatus ¶
GetQuotaWriterStatus serves the admin quota-writer overview: persisted epoch/mode, the fail-closed durable-write audit and this process's in-flight billing session count.
func GetQuotaWriterTransitionPlan ¶
GetQuotaWriterTransitionPlan serves the read-only transition plan for the requested target mode.
func GetQuotaWriterTransitions ¶
GetQuotaWriterTransitions serves the paginated transition evidence history.
func GetRankings ¶
func GetRatioConfig ¶
func GetRedemption ¶
func GetResponseBody ¶
func GetSubscription ¶
func GetSubscriptionPlans ¶
func GetSubscriptionSelf ¶
func GetSyncableChannels ¶
func GetSystemTask ¶
func GetTagModels ¶
func GetTaskOperation ¶
GetTaskOperation returns one sanitized durable operation to its owner.
func GetTokenAutoGroups ¶
func GetTokenBudget ¶
func GetTokenKey ¶
func GetTokenKeysBatch ¶
func GetTokenStatus ¶
func GetTokenUsage ¶
func GetTopUpInfo ¶
func GetUptimeKumaStatus ¶
func GetUsageReview ¶
func GetUserAgreement ¶
func GetUserFlowQuotaDates ¶
func GetUserGroups ¶
func GetUserLogs ¶
func GetUserMidjourney ¶
func GetUserModels ¶
func GetUserOAuthBindings ¶
GetUserOAuthBindings returns all OAuth bindings for the current user
func GetUserQuotaDates ¶
func GetUserTask ¶
func GetUserTopUps ¶
func GetUserUsagePolicy ¶
func HandleOAuth ¶
HandleOAuth handles OAuth callback for all standard OAuth providers
func ImportCodexLocalAuth ¶
func ListFullContentLogFiles ¶
func ListFullContentLogs ¶
func ListModels ¶
func ListPromptLearningRuns ¶
func ListSystemInstances ¶
func ListSystemTasks ¶
func ListWaffoPancakeCatalog ¶
ListWaffoPancakeCatalog returns the merchant's Stores + OnetimeProducts. Doubles as a credential probe (a successful 200 proves the resolved creds authenticate). See resolveWaffoPancakeAdminCreds for credential resolution.
func ListWaffoPancakeSubscriptionProductOptions ¶
ListWaffoPancakeSubscriptionProductOptions returns the OnetimeProducts in the saved Pancake store, for the subscription-plan dropdown. The name reflects MyAPI's plan concept; under the hood it's still OnetimeProducts.
func ManageMultiKeys ¶
ManageMultiKeys handles multi-key management operations
func OllamaPullModelStream ¶
OllamaPullModelStream 流式拉取 Ollama 模型
func OptionRemediateApply ¶
OptionRemediateApply applies action instances previously produced by the dry-run. The service/model chain rebuilds every judgment, enforces the per-row value-hash CAS, writes the backup and registry rows in the same transaction as each repair, and publishes through the existing runtime chain. Rows are independent: skipped and failed rows are registered, never rolled into a fake batch atomicity.
func OptionRemediateDryRun ¶
OptionRemediateDryRun previews whitelisted option normalizations. The preview is strictly zero-write: no option row, OptionMap entry, runtime generation, or remediation registry row is created; the only side effect is the management audit entry (keys and hashes, never values).
func PasskeyDelete ¶
func PasskeyLoginBegin ¶
func PasskeyLoginFinish ¶
func PasskeyRegisterBegin ¶
func PasskeyRegisterFinish ¶
func PasskeyStatus ¶
func PasskeyVerifyBegin ¶
func PasskeyVerifyFinish ¶
func Playground ¶
func RebuildChannelAffinityCache ¶
RebuildChannelAffinityCache 按当前配置代重建亲和缓存(维护操作)。
保存 channel_affinity_setting 只更新配置代;max_entries / default_ttl_seconds 须经本端点(或重启)才进入生效缓存实例。重建原子换入新实例: 进行中的请求继续使用旧实例直到结束,新请求使用新代参数构造的实例。
func RebuildDiskCache ¶
RebuildDiskCache 按已保存的配置代重建磁盘缓存放置(维护操作)。
保存性能设置只更新配置代:热字段(启用/阈值)立即生效,磁盘目录与容量 (disk_cache_path / disk_cache_max_size_mb)不迁移正在使用的缓存。 本端点是放置字段的显式生效路径(带排空语义):先校验新目录可创建可写, 成功后一次性换入新生效代;失败保留旧生效代并返回错误。 已打开的磁盘缓存实例按绝对路径管理自己的文件,不受换代影响。
func ReconcileUsageReview ¶
func RecoverTokenBudget ¶
func RefreshAuth ¶
func RegenerateBackupCodes ¶
RegenerateBackupCodes 重新生成备用码
func RegisterScheduledSystemTasks ¶
func RegisterScheduledSystemTasks()
RegisterScheduledSystemTasks wires the periodic channel test, upstream model update, and async task polling (Midjourney / Suno / video) jobs into the system task framework so a DB lease dedups execution across multiple master instances and each run is recorded as one task row. Call this before service.StartSystemTaskRunner.
func RelayMidjourney ¶
func RelayNotFound ¶
func RelayNotImplemented ¶
func RelayTaskFetch ¶
func RequestAmount ¶
func RequestCreemPay ¶
func RequestEpay ¶
func RequestStripeAmount ¶
func RequestStripePay ¶
func RequestWaffoAmount ¶
func RequestWaffoPancakePay ¶
func ResetCodexChannelUsage ¶
func ResetModelRatio ¶
func ResetPassword ¶
func ResetPerformanceStats ¶
ResetPerformanceStats 重置性能统计
func RetrieveModel ¶
func SaveOpenAIOfficialPriceSource ¶
Save fetches the fixed server source. No client URL, rates, model list or publication instruction is accepted by this endpoint.
func SaveWaffoPancake ¶
SaveWaffoPancake atomically persists all five operator-controlled fields. Catalog / pair endpoints are transient — only this one writes the OptionMap.
func SearchAllLogs
deprecated
func SearchChannels ¶
func SearchDeployments ¶
func SearchRedemptions ¶
func SearchTokens ¶
func SearchUserLogs
deprecated
func SearchUsers ¶
func SendEmailVerification ¶
func SendPasswordResetEmail ¶
func StartCodexOAuth ¶
func StripeWebhook ¶
func SubscriptionEpayNotify ¶
func SubscriptionEpayReturn ¶
SubscriptionEpayReturn handles browser return after payment. It verifies the payload and completes the order, then redirects to console.
func SubscriptionRequestEpay ¶
func SyncUpstreamModels ¶
SyncUpstreamModels 同步上游模型与供应商: - 默认仅创建「未配置模型」 - 可通过 overwrite 选择性覆盖更新本地已有模型的字段(前提:sync_official <> 0)
func SyncUpstreamPreview ¶
SyncUpstreamPreview 预览上游与本地的差异(仅用于弹窗选择)
func TelegramBind ¶
func TelegramBindStart ¶
func TelegramLogin ¶
func TestAllChannels ¶
TestAllChannels enqueues a channel_test system task instead of running the test loop inline. If any channel_test task is already active, the manual run is rejected so the caller does not mistake a scheduled run for this manual one.
func TestChannel ¶
func TestIoNetConnection ¶
func TestStatus ¶
func TransferAffQuota ¶
func UnbindCustomOAuth ¶
UnbindCustomOAuth unbinds a custom OAuth provider from the current user
func UniversalVerify ¶
func UpdateChannel ¶
func UpdateChannelBalance ¶
func UpdateChannelStatus ¶
func UpdateCustomOAuthProvider ¶
UpdateCustomOAuthProvider updates an existing custom OAuth provider
func UpdateDeployment ¶
func UpdateDeploymentName ¶
func UpdateOption ¶
func UpdateOptionsTypedBulk ¶
UpdateOptionsTypedBulk handles PUT /api/option/typed-bulk.
Status contract: 400 for malformed bodies and rejected items (unknown or duplicate keys, out-of-range bounds, invalid values), 409 for an expected-revision mismatch (zero writes, current revision echoed for reload), 500 for database failures and post-commit publication aborts. On success the new revision and the sorted applied key list are returned.
func UpdateRedemption ¶
func UpdateSelf ¶
func UpdateToken ¶
func UpdateTokenBudget ¶
func UpdateUser ¶
func UpdateUserSetting ¶
func UpdateUserUsagePolicy ¶
func UserFundingMutationGate ¶
func VideoProxy ¶
func WaffoPancakeWebhook ¶
func WeChatAuth ¶
func WeChatBind ¶
Types ¶
type APGC2DGPTUsageResponse ¶
type API2GPTUsageResponse ¶
type AddChannelRequest ¶
type AdminCompleteTopupRequest ¶
type AdminCompleteTopupRequest struct {
TradeNo string `json:"trade_no"`
}
type AdminCreateUserSubscriptionRequest ¶
type AdminCreateUserSubscriptionRequest struct {
PlanId int `json:"plan_id"`
}
type AdminUpdateSubscriptionPlanStatusRequest ¶
type AdminUpdateSubscriptionPlanStatusRequest struct {
Enabled *bool `json:"enabled"`
}
type AdminUpsertSubscriptionPlanRequest ¶
type AdminUpsertSubscriptionPlanRequest struct {
Plan model.SubscriptionPlan `json:"plan"`
}
type AmountRequest ¶
type AmountRequest struct {
Amount int64 `json:"amount"`
}
type BillingPreferenceRequest ¶
type BillingPreferenceRequest struct {
BillingPreference string `json:"billing_preference"`
}
type ChannelBatch ¶
type ChannelStatusRequest ¶
type ChannelStatusRequest struct {
Status int `json:"status"`
}
type ChannelTag ¶
type ChannelTag struct {
Tag string `json:"tag"`
NewTag *string `json:"new_tag"`
Priority *int64 `json:"priority"`
Weight *uint `json:"weight"`
ModelMapping *string `json:"model_mapping"`
Models *string `json:"models"`
Groups *string `json:"groups"`
ParamOverride *string `json:"param_override"`
HeaderOverride *string `json:"header_override"`
}
type CreateCustomOAuthProviderRequest ¶
type CreateCustomOAuthProviderRequest struct {
Name string `json:"name" binding:"required"`
Slug string `json:"slug" binding:"required"`
Icon string `json:"icon"`
Enabled bool `json:"enabled"`
ClientId string `json:"client_id" binding:"required"`
ClientSecret string `json:"client_secret" binding:"required"`
AuthorizationEndpoint string `json:"authorization_endpoint" binding:"required"`
TokenEndpoint string `json:"token_endpoint" binding:"required"`
UserInfoEndpoint string `json:"user_info_endpoint" binding:"required"`
Scopes string `json:"scopes"`
UserIdField string `json:"user_id_field"`
UsernameField string `json:"username_field"`
DisplayNameField string `json:"display_name_field"`
EmailField string `json:"email_field"`
WellKnown string `json:"well_known"`
AuthStyle int `json:"auth_style"`
AccessPolicy string `json:"access_policy"`
AccessDeniedMessage string `json:"access_denied_message"`
}
CreateCustomOAuthProviderRequest is the request structure for creating a custom OAuth provider
type CreemAdaptor ¶
type CreemAdaptor struct {
}
func (*CreemAdaptor) RequestPay ¶
func (*CreemAdaptor) RequestPay(c *gin.Context, req *CreemPayRequest)
type CreemCheckoutRequest ¶
type CreemCheckoutResponse ¶
type CreemPayRequest ¶
type CreemProduct ¶
type CreemWebhookEvent ¶
type CreemWebhookEvent struct {
Id string `json:"id"`
EventType string `json:"eventType"`
CreatedAt int64 `json:"created_at"`
Object struct {
Id string `json:"id"`
Object string `json:"object"`
RequestId string `json:"request_id"`
Order struct {
Object string `json:"object"`
Id string `json:"id"`
Customer string `json:"customer"`
Product string `json:"product"`
Amount int `json:"amount"`
Currency string `json:"currency"`
SubTotal int `json:"sub_total"`
TaxAmount int `json:"tax_amount"`
AmountDue int `json:"amount_due"`
AmountPaid int `json:"amount_paid"`
Status string `json:"status"`
Type string `json:"type"`
Transaction string `json:"transaction"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Mode string `json:"mode"`
} `json:"order"`
Product struct {
Id string `json:"id"`
Object string `json:"object"`
Name string `json:"name"`
Description string `json:"description"`
Price int `json:"price"`
Currency string `json:"currency"`
BillingType string `json:"billing_type"`
BillingPeriod string `json:"billing_period"`
Status string `json:"status"`
TaxMode string `json:"tax_mode"`
TaxCategory string `json:"tax_category"`
DefaultSuccessUrl *string `json:"default_success_url"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Mode string `json:"mode"`
} `json:"product"`
Units int `json:"units"`
Customer struct {
Id string `json:"id"`
Object string `json:"object"`
Email string `json:"email"`
Name string `json:"name"`
Country string `json:"country"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Mode string `json:"mode"`
} `json:"customer"`
Status string `json:"status"`
Metadata map[string]string `json:"metadata"`
Mode string `json:"mode"`
} `json:"object"`
}
新的Creem Webhook结构体,匹配实际的webhook数据格式
type CustomOAuthProviderResponse ¶
type CustomOAuthProviderResponse struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Icon string `json:"icon"`
Enabled bool `json:"enabled"`
ClientId string `json:"client_id"`
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
UserInfoEndpoint string `json:"user_info_endpoint"`
Scopes string `json:"scopes"`
UserIdField string `json:"user_id_field"`
UsernameField string `json:"username_field"`
DisplayNameField string `json:"display_name_field"`
EmailField string `json:"email_field"`
WellKnown string `json:"well_known"`
AuthStyle int `json:"auth_style"`
AccessPolicy string `json:"access_policy"`
AccessDeniedMessage string `json:"access_denied_message"`
}
CustomOAuthProviderResponse is the response structure for custom OAuth providers It excludes sensitive fields like client_secret
type DeepSeekUsageResponse ¶
type DiskCacheInfo ¶
type DiskCacheInfo struct {
// 缓存目录路径
Path string `json:"path"`
// 目录是否存在
Exists bool `json:"exists"`
// 文件数量
FileCount int `json:"file_count"`
// 总大小(字节)
TotalSize int64 `json:"total_size"`
}
DiskCacheInfo 磁盘缓存目录信息
type EpayRequest ¶
type FullContentLogDetail ¶
type FullContentLogDetail struct {
FullContentLogSummary
RequestContentType string `json:"request_content_type,omitempty"`
RequestEncoding string `json:"request_encoding,omitempty"`
RequestBody string `json:"request_body"`
ResponseContentType string `json:"response_content_type,omitempty"`
ResponseEncoding string `json:"response_encoding,omitempty"`
ResponseBody string `json:"response_body"`
ResponseBodyTotalBytes int64 `json:"response_body_total_bytes,omitempty"`
ResponseBodyTruncated bool `json:"response_body_truncated,omitempty"`
RequestHeaders map[string][]string `json:"request_headers"`
ResponseHeaders map[string][]string `json:"response_headers"`
Query map[string][]string `json:"query"`
}
type FullContentLogFacets ¶
type FullContentLogFacets struct {
Models []string `json:"models"`
Tokens []FullContentLogTokenOption `json:"tokens"`
}
type FullContentLogFileInfo ¶
type FullContentLogFileStats ¶
type FullContentLogFileStats struct {
Count int `json:"count"`
TotalSize int64 `json:"total_size"`
Files []FullContentLogFileInfo `json:"files"`
}
type FullContentLogListResponse ¶
type FullContentLogListResponse struct {
Enabled bool `json:"enabled"`
Page int `json:"page"`
PageSize int `json:"page_size"`
Total int `json:"total"`
Items []FullContentLogSummary `json:"items"`
Files FullContentLogFileStats `json:"files"`
Facets FullContentLogFacets `json:"facets"`
}
type FullContentLogSummary ¶
type FullContentLogSummary struct {
Timestamp string `json:"timestamp"`
RequestID string `json:"request_id"`
Method string `json:"method"`
Path string `json:"path"`
Model string `json:"model,omitempty"`
Status int `json:"status"`
DurationMS int64 `json:"duration_ms"`
RequestBytes int64 `json:"request_bytes"`
ResponseBytes int64 `json:"response_bytes"`
ChunkCount int64 `json:"chunk_count"`
UserID int `json:"user_id,omitempty"`
TokenID int `json:"token_id,omitempty"`
TokenName string `json:"token_name,omitempty"`
ClientIP string `json:"client_ip,omitempty"`
Error string `json:"error,omitempty"`
}
type LogFileInfo ¶
type LogFileInfo struct {
Name string `json:"name"`
Size int64 `json:"size"`
ModTime time.Time `json:"mod_time"`
}
LogFileInfo 日志文件信息
type LogFilesResponse ¶
type LogFilesResponse struct {
LogDir string `json:"log_dir"`
Enabled bool `json:"enabled"`
FileCount int `json:"file_count"`
TotalSize int64 `json:"total_size"`
OldestTime *time.Time `json:"oldest_time,omitempty"`
NewestTime *time.Time `json:"newest_time,omitempty"`
Files []LogFileInfo `json:"files"`
}
LogFilesResponse 日志文件列表响应
type LoginRequest ¶
type ManageRequest ¶
type MemoryStats ¶
type MemoryStats struct {
// 已分配内存(字节)
Alloc uint64 `json:"alloc"`
// 总分配内存(字节)
TotalAlloc uint64 `json:"total_alloc"`
// 系统内存(字节)
Sys uint64 `json:"sys"`
// GC 次数
NumGC uint32 `json:"num_gc"`
// Goroutine 数量
NumGoroutine int `json:"num_goroutine"`
}
MemoryStats 内存统计
type MultiKeyManageRequest ¶
type MultiKeyManageRequest struct {
ChannelId int `json:"channel_id"`
Action string `json:"action"` // "disable_key", "enable_key", "delete_key", "delete_disabled_keys", "get_key_status"
KeyIndex *int `json:"key_index,omitempty"` // for disable_key, enable_key, and delete_key actions
Page int `json:"page,omitempty"` // for get_key_status pagination
PageSize int `json:"page_size,omitempty"` // for get_key_status pagination
Status *int `json:"status,omitempty"` // for get_key_status filtering: 1=enabled, 2=manual_disabled, 3=auto_disabled, nil=all
}
MultiKeyManageRequest represents the request for multi-key management operations
type MultiKeyStatusResponse ¶
type MultiKeyStatusResponse struct {
Keys []KeyStatus `json:"keys"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
// Statistics
EnabledCount int `json:"enabled_count"`
ManualDisabledCount int `json:"manual_disabled_count"`
AutoDisabledCount int `json:"auto_disabled_count"`
}
MultiKeyStatusResponse represents the response for key status query
type OAuthEmailAlreadyTakenError ¶
type OAuthEmailAlreadyTakenError struct{}
func (*OAuthEmailAlreadyTakenError) Error ¶
func (e *OAuthEmailAlreadyTakenError) Error() string
type OAuthRegistrationDisabledError ¶
type OAuthRegistrationDisabledError struct{}
func (*OAuthRegistrationDisabledError) Error ¶
func (e *OAuthRegistrationDisabledError) Error() string
type OAuthUserDeletedError ¶
type OAuthUserDeletedError struct{}
Error types for OAuth
func (*OAuthUserDeletedError) Error ¶
func (e *OAuthUserDeletedError) Error() string
type OpenAICreditGrants ¶
type OpenAIModel ¶
type OpenAIModel struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
Metadata map[string]any `json:"metadata,omitempty"`
Permission []struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
AllowCreateEngine bool `json:"allow_create_engine"`
AllowSampling bool `json:"allow_sampling"`
AllowLogprobs bool `json:"allow_logprobs"`
AllowSearchIndices bool `json:"allow_search_indices"`
AllowView bool `json:"allow_view"`
AllowFineTuning bool `json:"allow_fine_tuning"`
Organization string `json:"organization"`
Group string `json:"group"`
IsBlocking bool `json:"is_blocking"`
} `json:"permission"`
Root string `json:"root"`
Parent string `json:"parent"`
}
type OpenAIModelsResponse ¶
type OpenAIModelsResponse struct {
Data []OpenAIModel `json:"data"`
Success bool `json:"success"`
}
type OpenAISBUsageResponse ¶
type OpenAISubscriptionResponse ¶
type OpenAISubscriptionResponse struct {
Object string `json:"object"`
HasPaymentMethod bool `json:"has_payment_method"`
SoftLimitUSD float64 `json:"soft_limit_usd"`
HardLimitUSD float64 `json:"hard_limit_usd"`
SystemHardLimitUSD float64 `json:"system_hard_limit_usd"`
AccessUntil int64 `json:"access_until"`
}
type OpenAIUsageDailyCost ¶
type OpenAIUsageResponse ¶
type OptionUpdateRequest ¶
type PasswordResetRequest ¶
type PatchChannel ¶
type PaymentComplianceRequest ¶
type PaymentComplianceRequest struct {
Confirmed bool `json:"confirmed"`
}
type PerformanceConfig ¶
type PerformanceConfig struct {
// 是否启用磁盘缓存
DiskCacheEnabled bool `json:"disk_cache_enabled"`
// 磁盘缓存阈值(MB)
DiskCacheThresholdMB int `json:"disk_cache_threshold_mb"`
// 磁盘缓存最大大小(MB,配置代/已保存值)
DiskCacheMaxSizeMB int `json:"disk_cache_max_size_mb"`
// 磁盘缓存路径(配置代/已保存值)
DiskCachePath string `json:"disk_cache_path"`
// ActiveDiskCacheMaxSizeMB 生效代磁盘缓存最大大小(MB)
ActiveDiskCacheMaxSizeMB int `json:"active_disk_cache_max_size_mb"`
// ActiveDiskCachePath 生效代磁盘缓存路径
ActiveDiskCachePath string `json:"active_disk_cache_path"`
// DiskCacheRebuildRequired 为 true 表示路径/容量已保存但未生效,
// 需要 POST /api/option/disk_cache/rebuild 维护重建或重启
DiskCacheRebuildRequired bool `json:"disk_cache_rebuild_required"`
// 是否在容器中运行
IsRunningInContainer bool `json:"is_running_in_container"`
// MonitorEnabled 是否启用性能监控
MonitorEnabled bool `json:"monitor_enabled"`
// MonitorCPUThreshold CPU 使用率阈值(%)
MonitorCPUThreshold int `json:"monitor_cpu_threshold"`
// MonitorMemoryThreshold 内存使用率阈值(%)
MonitorMemoryThreshold int `json:"monitor_memory_threshold"`
// MonitorDiskThreshold 磁盘使用率阈值(%)
MonitorDiskThreshold int `json:"monitor_disk_threshold"`
}
PerformanceConfig 性能配置
type PerformanceStats ¶
type PerformanceStats struct {
// 缓存统计
CacheStats common.DiskCacheStats `json:"cache_stats"`
// 系统内存统计
MemoryStats MemoryStats `json:"memory_stats"`
// 磁盘缓存目录信息
DiskCacheInfo DiskCacheInfo `json:"disk_cache_info"`
// 磁盘空间信息
DiskSpaceInfo common.DiskSpaceInfo `json:"disk_space_info"`
// 配置信息
Config PerformanceConfig `json:"config"`
}
PerformanceStats 性能统计信息
type Setup2FARequest ¶
type Setup2FARequest struct {
Code string `json:"code" binding:"required"`
}
Setup2FARequest 设置2FA请求结构
type Setup2FAResponse ¶
type Setup2FAResponse struct {
Secret string `json:"secret"`
QRCodeData string `json:"qr_code_data"`
BackupCodes []string `json:"backup_codes"`
}
Setup2FAResponse 设置2FA响应结构
type SetupRequest ¶
type SiliconFlowUsageResponse ¶
type SiliconFlowUsageResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Status bool `json:"status"`
Data struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Email string `json:"email"`
IsAdmin bool `json:"isAdmin"`
Balance string `json:"balance"`
Status string `json:"status"`
Introduction string `json:"introduction"`
Role string `json:"role"`
ChargeBalance string `json:"chargeBalance"`
TotalBalance string `json:"totalBalance"`
Category string `json:"category"`
} `json:"data"`
}
type StripeAdaptor ¶
type StripeAdaptor struct {
}
func (*StripeAdaptor) RequestAmount ¶
func (*StripeAdaptor) RequestAmount(c *gin.Context, req *StripePayRequest)
func (*StripeAdaptor) RequestPay ¶
func (*StripeAdaptor) RequestPay(c *gin.Context, req *StripePayRequest)
type StripePayRequest ¶
type StripePayRequest struct {
// Amount is the quantity of units to purchase.
Amount int64 `json:"amount"`
// PaymentMethod specifies the payment method (e.g., "stripe").
PaymentMethod string `json:"payment_method"`
// SuccessURL is the optional custom URL to redirect after successful payment.
// If empty, defaults to the server's console log page.
SuccessURL string `json:"success_url,omitempty"`
// CancelURL is the optional custom URL to redirect when payment is canceled.
// If empty, defaults to the server's console topup page.
CancelURL string `json:"cancel_url,omitempty"`
}
StripePayRequest represents a payment request for Stripe checkout.
type SubscriptionBalancePayRequest ¶
type SubscriptionBalancePayRequest struct {
PlanId int `json:"plan_id"`
}
type SubscriptionCreemPayRequest ¶
type SubscriptionCreemPayRequest struct {
PlanId int `json:"plan_id"`
}
type SubscriptionPlanDTO ¶
type SubscriptionPlanDTO struct {
Plan model.SubscriptionPlan `json:"plan"`
}
type SubscriptionStripePayRequest ¶
type SubscriptionStripePayRequest struct {
PlanId int `json:"plan_id"`
}
type SubscriptionWaffoPancakePayRequest ¶
type SubscriptionWaffoPancakePayRequest struct {
PlanId int `json:"plan_id"`
}
type TaskBillingOutboxSummary ¶
type TaskBillingOutboxSummary struct {
DeliveredCount int `json:"delivered_count"`
}
TaskBillingOutboxSummary records the delivery count of one outbox pass.
type TaskRecoverySummary ¶
type TaskRecoverySummary struct {
RecoveredDispatching int `json:"recovered_dispatching"`
RecoveredUnfinished int `json:"recovered_unfinished"`
RecoveredBillingEvents int `json:"recovered_billing_events"`
}
TaskRecoverySummary records the result of one task recovery pass.
type TokenBatch ¶
type TokenBatch struct {
Ids []int `json:"ids"`
}
type TransferAffQuotaRequest ¶
type TypedBulkOptionsUpdateRequest ¶
type TypedBulkOptionsUpdateRequest struct {
ExpectedRevision *int64 `json:"expected_revision"`
Items []model.TypedBulkOption `json:"items"`
}
TypedBulkOptionsUpdateRequest is the frozen typed bulk request contract (C09-N3a): a bounded item set with a closed value-type union, plus an optional expected-revision CAS guard.
type UniversalVerifyRequest ¶
type UpdateCustomOAuthProviderRequest ¶
type UpdateCustomOAuthProviderRequest struct {
Name string `json:"name"`
Slug string `json:"slug"`
Icon *string `json:"icon"` // Optional: if nil, keep existing
Enabled *bool `json:"enabled"` // Optional: if nil, keep existing
ClientId string `json:"client_id"`
ClientSecret string `json:"client_secret"` // Optional: if empty, keep existing
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
UserInfoEndpoint string `json:"user_info_endpoint"`
Scopes string `json:"scopes"`
UserIdField string `json:"user_id_field"`
UsernameField string `json:"username_field"`
DisplayNameField string `json:"display_name_field"`
EmailField string `json:"email_field"`
WellKnown *string `json:"well_known"` // Optional: if nil, keep existing
AuthStyle *int `json:"auth_style"` // Optional: if nil, keep existing
AccessPolicy *string `json:"access_policy"` // Optional: if nil, keep existing
AccessDeniedMessage *string `json:"access_denied_message"` // Optional: if nil, keep existing
}
UpdateCustomOAuthProviderRequest is the request structure for updating a custom OAuth provider
type UpdateUserSettingRequest ¶
type UpdateUserSettingRequest struct {
QuotaWarningType string `json:"notify_type"`
QuotaWarningThreshold float64 `json:"quota_warning_threshold"`
WebhookUrl string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
NotificationEmail string `json:"notification_email,omitempty"`
BarkUrl string `json:"bark_url,omitempty"`
GotifyUrl string `json:"gotify_url,omitempty"`
GotifyToken string `json:"gotify_token,omitempty"`
GotifyPriority int `json:"gotify_priority,omitempty"`
UpstreamModelUpdateNotifyEnabled *bool `json:"upstream_model_update_notify_enabled,omitempty"`
AcceptUnsetModelRatioModel bool `json:"accept_unset_model_ratio_model"`
RecordIpLog bool `json:"record_ip_log"`
}
type UptimeGroupResult ¶
type Verify2FARequest ¶
type Verify2FARequest struct {
Code string `json:"code" binding:"required"`
FlowToken string `json:"flow_token,omitempty"`
}
Verify2FARequest 验证2FA请求结构
type WaffoPancakePayRequest ¶
type WaffoPancakePayRequest struct {
Amount int64 `json:"amount"`
}
type WaffoPayRequest ¶
type WaffoPayRequest struct {
Amount int64 `json:"amount"`
PayMethodIndex *int `json:"pay_method_index"` // 服务端支付方式列表的索引,nil 表示由 Waffo 自动选择
PayMethodType string `json:"pay_method_type"` // Deprecated: 兼容旧前端,优先使用 pay_method_index
PayMethodName string `json:"pay_method_name"` // Deprecated: 兼容旧前端,优先使用 pay_method_index
}
Source Files
¶
- audit.go
- auth_session.go
- authz.go
- billing.go
- channel-billing.go
- channel-test.go
- channel.go
- channel_affinity_cache.go
- channel_authz.go
- channel_quota_alert_delivery.go
- channel_quota_changes.go
- channel_upstream_update.go
- checkin.go
- codex_local_auth.go
- codex_oauth.go
- codex_threshold_sample.go
- codex_usage.go
- custom_oauth.go
- deployment.go
- full_content_log.go
- group.go
- image.go
- log.go
- midjourney.go
- misc.go
- missing_models.go
- model.go
- model_meta.go
- model_sync.go
- oauth.go
- openai_official_pricing.go
- option.go
- option_diagnostics.go
- option_remediation.go
- option_typed_bulk.go
- passkey.go
- payment_compliance.go
- payment_webhook_availability.go
- perf_metrics.go
- performance.go
- playground.go
- prefill_group.go
- price_publication.go
- pricing.go
- prompt_learning.go
- quota_writer.go
- rankings.go
- ratio_config.go
- ratio_sync.go
- redemption.go
- relay.go
- relay_task_durable.go
- return_path.go
- secure_verification.go
- setup.go
- subscription.go
- subscription_payment_creem.go
- subscription_payment_epay.go
- subscription_payment_stripe.go
- subscription_payment_waffo_pancake.go
- system_info.go
- system_task.go
- system_task_handlers.go
- task.go
- task_operation.go
- telegram.go
- token.go
- token_budget.go
- topup.go
- topup_creem.go
- topup_quote.go
- topup_stripe.go
- topup_waffo.go
- topup_waffo_pancake.go
- twofa.go
- uptime_kuma.go
- usage_review.go
- usedata.go
- user.go
- user_usage_policy.go
- vendor_meta.go
- video_proxy.go
- video_proxy_gemini.go
- wechat.go