Documentation
¶
Index ¶
- Constants
- func AddChannel(c *gin.Context)
- func AddRedemption(c *gin.Context)
- func AddToken(c *gin.Context)
- func Admin2FAStats(c *gin.Context)
- func AdminCompleteTopUp(c *gin.Context)
- func AdminDisable2FA(c *gin.Context)
- func AdminResetPasskey(c *gin.Context)
- func AutomaticallyTestChannels()
- func AutomaticallyUpdateChannels(frequency int)
- func BatchSetChannelTag(c *gin.Context)
- func ChannelListModels(c *gin.Context)
- func CheckClusterNameAvailability(c *gin.Context)
- func CheckSecureVerification(c *gin.Context) bool
- func ClearChannelAffinityCache(c *gin.Context)
- func ClearDiskCache(c *gin.Context)
- func CompleteCodexOAuth(c *gin.Context)
- func CompleteCodexOAuthForChannel(c *gin.Context)
- func CopyChannel(c *gin.Context)
- func CreateDeployment(c *gin.Context)
- func CreateModelMeta(c *gin.Context)
- func CreatePrefillGroup(c *gin.Context)
- func CreateUser(c *gin.Context)
- func CreateVendorMeta(c *gin.Context)
- func CreemWebhook(c *gin.Context)
- func DashboardListModels(c *gin.Context)
- func DeleteChannel(c *gin.Context)
- func DeleteChannelBatch(c *gin.Context)
- func DeleteDeployment(c *gin.Context)
- func DeleteDisabledChannel(c *gin.Context)
- func DeleteHistoryLogs(c *gin.Context)
- func DeleteInvalidRedemption(c *gin.Context)
- func DeleteModelMeta(c *gin.Context)
- func DeletePrefillGroup(c *gin.Context)
- func DeleteRedemption(c *gin.Context)
- func DeleteSelf(c *gin.Context)
- func DeleteToken(c *gin.Context)
- func DeleteTokenBatch(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func DeleteVendorMeta(c *gin.Context)
- func Disable2FA(c *gin.Context)
- func DisableTagChannels(c *gin.Context)
- func DiscordBind(c *gin.Context)
- func DiscordOAuth(c *gin.Context)
- func DoCheckin(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 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 GetAffCode(c *gin.Context)
- func GetAllChannels(c *gin.Context)
- func GetAllDeployments(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 GetChargedAmount(count float64, user model.User) float64
- func GetCheckinStatus(c *gin.Context)
- func GetClaudeAuthHeader(token string) http.Header
- func GetCodexChannelUsage(c *gin.Context)
- func GetContainerDetails(c *gin.Context)
- func GetDeployment(c *gin.Context)
- func GetDeploymentLogs(c *gin.Context)
- func GetEpayClient() *epay.Client
- 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 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 GetOptions(c *gin.Context)
- func GetPerformanceStats(c *gin.Context)
- func GetPrefillGroups(c *gin.Context)
- func GetPriceEstimation(c *gin.Context)
- func GetPricing(c *gin.Context)
- func GetPrivacyPolicy(c *gin.Context)
- func GetRatioConfig(c *gin.Context)
- func GetRedemption(c *gin.Context)
- func GetResponseBody(method, url string, channel *model.Channel, headers http.Header) ([]byte, error)
- func GetSelf(c *gin.Context)
- func GetSetup(c *gin.Context)
- func GetStatus(c *gin.Context)
- func GetSubscription(c *gin.Context)
- func GetSyncableChannels(c *gin.Context)
- func GetTagModels(c *gin.Context)
- func GetToken(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 GetUser(c *gin.Context)
- func GetUserAgreement(c *gin.Context)
- func GetUserGroups(c *gin.Context)
- func GetUserLogs(c *gin.Context)
- func GetUserMidjourney(c *gin.Context)
- func GetUserModels(c *gin.Context)
- func GetUserQuotaDates(c *gin.Context)
- func GetUserTask(c *gin.Context)
- func GetUserTopUps(c *gin.Context)
- func GetVendorMeta(c *gin.Context)
- func GetVerificationStatus(c *gin.Context)
- func GitHubBind(c *gin.Context)
- func GitHubOAuth(c *gin.Context)
- func KlingImage2VideoGenerations(c *gin.Context)
- func KlingImage2videoTaskId(c *gin.Context)
- func KlingText2VideoGenerations(c *gin.Context)
- func KlingText2videoTaskId(c *gin.Context)
- func LinuxDoBind(c *gin.Context)
- func LinuxdoOAuth(c *gin.Context)
- func ListDeploymentContainers(c *gin.Context)
- func ListModels(c *gin.Context, modelType int)
- func LockOrder(tradeNo string)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func ManageMultiKeys(c *gin.Context)
- func ManageUser(c *gin.Context)
- func MigrateConsoleSetting(c *gin.Context)
- func OidcAuth(c *gin.Context)
- func OidcBind(c *gin.Context)
- func OllamaDeleteModel(c *gin.Context)
- func OllamaPullModel(c *gin.Context)
- func OllamaPullModelStream(c *gin.Context)
- func OllamaVersion(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 PasskeyVerifyAndSetSession(c *gin.Context)
- func PasskeyVerifyBegin(c *gin.Context)
- func PasskeyVerifyFinish(c *gin.Context)
- func PasskeyVerifyForSecure(c *gin.Context)
- func Playground(c *gin.Context)
- func PostSetup(c *gin.Context)
- func RefreshCodexChannelCredential(c *gin.Context)
- func RegenerateBackupCodes(c *gin.Context)
- func Register(c *gin.Context)
- 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 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 ResetModelRatio(c *gin.Context)
- func ResetPassword(c *gin.Context)
- func ResetPerformanceStats(c *gin.Context)
- func RetrieveModel(c *gin.Context, modelType int)
- func SearchAllLogs(c *gin.Context)
- 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)
- 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 SyncUpstreamModels(c *gin.Context)
- func SyncUpstreamPreview(c *gin.Context)
- func TelegramBind(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 UniversalVerify(c *gin.Context)
- func UnlockOrder(tradeNo string)
- func UpdateAllChannelsBalance(c *gin.Context)
- func UpdateChannel(c *gin.Context)
- func UpdateChannelBalance(c *gin.Context)
- func UpdateDeployment(c *gin.Context)
- func UpdateDeploymentName(c *gin.Context)
- func UpdateMidjourneyTaskBulk()
- func UpdateModelMeta(c *gin.Context)
- func UpdateOption(c *gin.Context)
- func UpdatePrefillGroup(c *gin.Context)
- func UpdateRedemption(c *gin.Context)
- func UpdateSelf(c *gin.Context)
- func UpdateSunoTaskAll(ctx context.Context, taskChannelM map[int][]string, ...) error
- func UpdateTaskBulk()
- func UpdateTaskByPlatform(platform constant.TaskPlatform, taskChannelM map[int][]string, ...)
- func UpdateToken(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UpdateUserSetting(c *gin.Context)
- func UpdateVendorMeta(c *gin.Context)
- func UpdateVideoTaskAll(ctx context.Context, platform constant.TaskPlatform, ...) error
- func Verify2FALogin(c *gin.Context)
- func VideoGenerations(c *gin.Context)
- func VideoGenerationsTaskId(c *gin.Context)
- func VideoProxy(c *gin.Context)
- func WeChatAuth(c *gin.Context)
- func WeChatBind(c *gin.Context)
- type AIProxyUserOverviewResponse
- type APGC2DGPTUsageResponse
- type API2GPTUsageResponse
- type AddChannelRequest
- type AdminCompleteTopupRequest
- type AmountRequest
- type ChannelBatch
- type ChannelTag
- type CreemAdaptor
- type CreemCheckoutRequest
- type CreemCheckoutResponse
- type CreemPayRequest
- type CreemProduct
- type CreemWebhookData
- type CreemWebhookEvent
- type DeepSeekUsageResponse
- type DiscordResponse
- type DiscordUser
- type DiskCacheInfo
- type DiskSpaceInfo
- type EpayRequest
- type GitHubOAuthResponse
- type GitHubUser
- type KeyStatus
- type KlingCameraConfig
- type KlingCameraControl
- type KlingImage2VideoRequest
- type KlingText2VideoRequest
- type LinuxdoUser
- type LoginRequest
- type ManageRequest
- type MemoryStats
- type Monitor
- type MultiKeyManageRequest
- type MultiKeyStatusResponse
- type OidcResponse
- type OidcUser
- type OpenAICreditGrants
- type OpenAIModel
- type OpenAIModelsResponse
- type OpenAISBUsageResponse
- type OpenAISubscriptionResponse
- type OpenAIUsageDailyCost
- type OpenAIUsageResponse
- type OpenRouterCreditResponse
- type OptionUpdateRequest
- type PasswordResetRequest
- type PatchChannel
- type PerformanceConfig
- type PerformanceStats
- type Setup
- type Setup2FARequest
- type Setup2FAResponse
- type SetupRequest
- type SiliconFlowUsageResponse
- type StripeAdaptor
- type StripePayRequest
- type TokenBatch
- type TransferAffQuotaRequest
- type UniversalVerifyRequest
- type UpdateUserSettingRequest
- type UptimeGroupResult
- type VerificationStatusResponse
- type Verify2FARequest
Constants ¶
const ( // SecureVerificationSessionKey 安全验证的 session key SecureVerificationSessionKey = "secure_verified_at" // SecureVerificationTimeout 验证有效期(秒) SecureVerificationTimeout = 300 // 5分钟 )
const ( PaymentMethodCreem = "creem" CreemSignatureHeader = "creem-signature" )
const (
PaymentMethodStripe = "stripe"
)
Variables ¶
This section is empty.
Functions ¶
func AddChannel ¶
func AddRedemption ¶
func AdminResetPasskey ¶
func AutomaticallyTestChannels ¶
func AutomaticallyTestChannels()
func AutomaticallyUpdateChannels ¶
func AutomaticallyUpdateChannels(frequency int)
func BatchSetChannelTag ¶
func ChannelListModels ¶
func CheckSecureVerification ¶
CheckSecureVerification 检查是否已通过安全验证 返回 true 表示验证有效,false 表示需要重新验证
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 CreateDeployment ¶
func CreateUser ¶
func CreemWebhook ¶
func DashboardListModels ¶
func DeleteChannel ¶
func DeleteChannelBatch ¶
func DeleteDeployment ¶
func DeleteDisabledChannel ¶
func DeleteHistoryLogs ¶
func DeleteInvalidRedemption ¶
func DeleteRedemption ¶
func DeleteSelf ¶
func DeleteToken ¶
func DeleteTokenBatch ¶
func DeleteUser ¶
func DisableTagChannels ¶
func DiscordBind ¶
func DiscordOAuth ¶
func EditTagChannels ¶
func EnableTagChannels ¶
func EnabledListModels ¶
func EpayNotify ¶
func ExtendDeployment ¶
func FetchModels ¶
func FetchUpstreamModels ¶
func FetchUpstreamRatios ¶
func FixChannelsAbilities ¶
func GenerateAccessToken ¶
func GenerateOAuthCode ¶
func GetAffCode ¶
func GetAllChannels ¶
func GetAllDeployments ¶
func GetAllLogs ¶
func GetAllMidjourney ¶
func GetAllQuotaDates ¶
func GetAllRedemptions ¶
func GetAllTask ¶
func GetAllTokens ¶
func GetAllUsers ¶
func GetAvailableReplicas ¶
func GetChannel ¶
func GetChannelKey ¶
GetChannelKey 获取渠道密钥(需要通过安全验证中间件) 此函数依赖 SecureVerificationRequired 中间件,确保用户已通过安全验证
func GetClaudeAuthHeader ¶
GetClaudeAuthHeader get claude auth header
func GetCodexChannelUsage ¶
func GetContainerDetails ¶
func GetDeployment ¶
func GetDeploymentLogs ¶
func GetEpayClient ¶
func GetHardwareTypes ¶
func GetHomePageContent ¶
func GetLocations ¶
func GetLogByKey ¶
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 GetOptions ¶
func GetPrefillGroups ¶
GetPrefillGroups 获取预填组列表,可通过 ?type=xxx 过滤
func GetPriceEstimation ¶
func GetPricing ¶
func GetPrivacyPolicy ¶
func GetRatioConfig ¶
func GetRedemption ¶
func GetResponseBody ¶
func GetSubscription ¶
func GetSyncableChannels ¶
func GetTagModels ¶
func GetTokenStatus ¶
func GetTokenUsage ¶
func GetTopUpInfo ¶
func GetUptimeKumaStatus ¶
func GetUserAgreement ¶
func GetUserGroups ¶
func GetUserLogs ¶
func GetUserMidjourney ¶
func GetUserModels ¶
func GetUserQuotaDates ¶
func GetUserTask ¶
func GetUserTopUps ¶
func GetVerificationStatus ¶
GetVerificationStatus 获取验证状态
func GitHubBind ¶
func GitHubOAuth ¶
func KlingImage2VideoGenerations ¶
KlingImage2VideoGenerations @Summary 可灵官方-图生视频 @Description 调用可灵AI图生视频接口,生成视频内容 @Tags Video @Accept json @Produce json @Param Authorization header string true "用户认证令牌 (Aeess-Token: sk-xxxx)" @Param request body KlingImage2VideoRequest true "图生视频请求参数" @Success 200 {object} dto.VideoTaskResponse "任务状态和结果" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /kling/v1/videos/image2video [post]
func KlingImage2videoTaskId ¶
KlingImage2videoTaskId godoc @Summary 可灵任务查询--图生视频 @Description Query the status and result of a Kling video generation task by task ID @Tags Origin @Accept json @Produce json @Param task_id path string true "Task ID" @Router /kling/v1/videos/image2video/{task_id} [get]
func KlingText2VideoGenerations ¶
KlingText2VideoGenerations @Summary 可灵文生视频 @Description 调用可灵AI文生视频接口,生成视频内容 @Tags Video @Accept json @Produce json @Param Authorization header string true "用户认证令牌 (Aeess-Token: sk-xxxx)" @Param request body KlingText2VideoRequest true "视频生成请求参数" @Success 200 {object} dto.VideoTaskResponse "任务状态和结果" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /kling/v1/videos/text2video [post]
func KlingText2videoTaskId ¶
KlingText2videoTaskId godoc @Summary 可灵任务查询--文生视频 @Description Query the status and result of a Kling text-to-video generation task by task ID @Tags Origin @Accept json @Produce json @Param task_id path string true "Task ID" @Router /kling/v1/videos/text2video/{task_id} [get]
func LinuxDoBind ¶
func LinuxdoOAuth ¶
func ListModels ¶
func ManageMultiKeys ¶
ManageMultiKeys handles multi-key management operations
func MigrateConsoleSetting ¶
MigrateConsoleSetting 迁移旧的控制台相关配置到 console_setting.*
func OllamaPullModelStream ¶
OllamaPullModelStream 流式拉取 Ollama 模型
func PasskeyDelete ¶
func PasskeyLoginBegin ¶
func PasskeyLoginFinish ¶
func PasskeyRegisterBegin ¶
func PasskeyRegisterFinish ¶
func PasskeyStatus ¶
func PasskeyVerifyAndSetSession ¶
PasskeyVerifyAndSetSession Passkey 验证完成后设置 session 这是一个辅助函数,供 PasskeyVerifyFinish 调用
func PasskeyVerifyBegin ¶
func PasskeyVerifyFinish ¶
func PasskeyVerifyForSecure ¶
PasskeyVerifyForSecure 用于安全验证的 Passkey 验证流程 整合了 begin 和 finish 流程
func Playground ¶
func RegenerateBackupCodes ¶
RegenerateBackupCodes 重新生成备用码
func RelayMidjourney ¶
func RelayNotFound ¶
func RelayNotImplemented ¶
func RequestAmount ¶
func RequestCreemPay ¶
func RequestEpay ¶
func RequestStripeAmount ¶
func RequestStripePay ¶
func ResetModelRatio ¶
func ResetPassword ¶
func ResetPerformanceStats ¶
ResetPerformanceStats 重置性能统计
func RetrieveModel ¶
func SearchAllLogs ¶
func SearchChannels ¶
func SearchDeployments ¶
func SearchRedemptions ¶
func SearchTokens ¶
func SearchUserLogs ¶
func SearchUsers ¶
func SendEmailVerification ¶
func SendPasswordResetEmail ¶
func StartCodexOAuth ¶
func StripeWebhook ¶
func SyncUpstreamModels ¶
SyncUpstreamModels 同步上游模型与供应商: - 默认仅创建「未配置模型」 - 可通过 overwrite 选择性覆盖更新本地已有模型的字段(前提:sync_official <> 0)
func SyncUpstreamPreview ¶
SyncUpstreamPreview 预览上游与本地的差异(仅用于弹窗选择)
func TelegramBind ¶
func TelegramLogin ¶
func TestAllChannels ¶
func TestChannel ¶
func TestIoNetConnection ¶
func TestStatus ¶
func TransferAffQuota ¶
func UniversalVerify ¶
UniversalVerify 通用验证接口 支持 2FA 和 Passkey 验证,验证成功后在 session 中记录时间戳
func UpdateChannel ¶
func UpdateChannelBalance ¶
func UpdateDeployment ¶
func UpdateDeploymentName ¶
func UpdateMidjourneyTaskBulk ¶
func UpdateMidjourneyTaskBulk()
func UpdateOption ¶
func UpdateRedemption ¶
func UpdateSelf ¶
func UpdateSunoTaskAll ¶
func UpdateTaskBulk ¶
func UpdateTaskBulk()
func UpdateTaskByPlatform ¶
func UpdateToken ¶
func UpdateUser ¶
func UpdateUserSetting ¶
func UpdateVideoTaskAll ¶
func VideoGenerations ¶
VideoGenerations @Summary 生成视频 @Description 调用视频生成接口生成视频 @Description 支持多种视频生成服务: @Description - 可灵AI (Kling): https://app.klingai.com/cn/dev/document-api/apiReference/commonInfo @Description - 即梦 (Jimeng): https://www.volcengine.com/docs/85621/1538636 @Tags Video @Accept json @Produce json @Param Authorization header string true "用户认证令牌 (Aeess-Token: sk-xxxx)" @Param request body dto.VideoRequest true "视频生成请求参数" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /v1/video/generations [post]
func VideoGenerationsTaskId ¶
VideoGenerationsTaskId @Summary 查询视频 @Description 根据任务ID查询视频生成任务的状态和结果 @Tags Video @Accept json @Produce json @Security BearerAuth @Param task_id path string true "Task ID" @Success 200 {object} dto.VideoTaskResponse "任务状态和结果" @Failure 400 {object} dto.OpenAIError "请求参数错误" @Failure 401 {object} dto.OpenAIError "未授权" @Failure 403 {object} dto.OpenAIError "无权限" @Failure 500 {object} dto.OpenAIError "服务器内部错误" @Router /v1/video/generations/{task_id} [get]
func VideoProxy ¶
func WeChatAuth ¶
func WeChatBind ¶
Types ¶
type APGC2DGPTUsageResponse ¶
type API2GPTUsageResponse ¶
type AddChannelRequest ¶
type AdminCompleteTopupRequest ¶
type AdminCompleteTopupRequest struct {
TradeNo string `json:"trade_no"`
}
type AmountRequest ¶
type ChannelBatch ¶
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 CreemAdaptor ¶
type CreemAdaptor struct {
}
func (*CreemAdaptor) RequestPay ¶
func (*CreemAdaptor) RequestPay(c *gin.Context, req *CreemPayRequest)
type CreemCheckoutRequest ¶
type CreemCheckoutResponse ¶
type CreemPayRequest ¶
type CreemProduct ¶
type CreemWebhookData ¶
type CreemWebhookData struct {
Type string `json:"type"`
Data struct {
RequestId string `json:"request_id"`
Status string `json:"status"`
Metadata map[string]string `json:"metadata"`
} `json:"data"`
}
保留旧的结构体作为兼容
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 DeepSeekUsageResponse ¶
type DiscordResponse ¶
type DiscordUser ¶
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 DiskSpaceInfo ¶
type DiskSpaceInfo struct {
// 总空间(字节)
Total uint64 `json:"total"`
// 可用空间(字节)
Free uint64 `json:"free"`
// 已用空间(字节)
Used uint64 `json:"used"`
// 使用百分比
UsedPercent float64 `json:"used_percent"`
}
DiskSpaceInfo 磁盘空间信息
type EpayRequest ¶
type GitHubOAuthResponse ¶
type GitHubUser ¶
type KlingCameraConfig ¶
type KlingCameraConfig struct {
Horizontal float64 `json:"horizontal,omitempty" example:"2.5"`
Vertical float64 `json:"vertical,omitempty" example:"0"`
Pan float64 `json:"pan,omitempty" example:"0"`
Tilt float64 `json:"tilt,omitempty" example:"0"`
Roll float64 `json:"roll,omitempty" example:"0"`
Zoom float64 `json:"zoom,omitempty" example:"0"`
}
type KlingCameraControl ¶
type KlingCameraControl struct {
Type string `json:"type,omitempty" example:"simple"`
Config *KlingCameraConfig `json:"config,omitempty"`
}
type KlingImage2VideoRequest ¶
type KlingImage2VideoRequest struct {
ModelName string `json:"model_name,omitempty" example:"kling-v2-master"`
Image string `` /* 181-byte string literal not displayed */
Prompt string `json:"prompt,omitempty" example:"A cat playing piano in the garden"`
NegativePrompt string `json:"negative_prompt,omitempty" example:"blurry, low quality"`
CfgScale float64 `json:"cfg_scale,omitempty" example:"0.7"`
Mode string `json:"mode,omitempty" example:"std"`
CameraControl *KlingCameraControl `json:"camera_control,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty" example:"16:9"`
Duration string `json:"duration,omitempty" example:"5"`
CallbackURL string `json:"callback_url,omitempty" example:"https://your.domain/callback"`
ExternalTaskId string `json:"external_task_id,omitempty" example:"custom-task-002"`
}
type KlingText2VideoRequest ¶
type KlingText2VideoRequest struct {
ModelName string `json:"model_name,omitempty" example:"kling-v1"`
Prompt string `json:"prompt" binding:"required" example:"A cat playing piano in the garden"`
NegativePrompt string `json:"negative_prompt,omitempty" example:"blurry, low quality"`
CfgScale float64 `json:"cfg_scale,omitempty" example:"0.7"`
Mode string `json:"mode,omitempty" example:"std"`
CameraControl *KlingCameraControl `json:"camera_control,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty" example:"16:9"`
Duration string `json:"duration,omitempty" example:"5"`
CallbackURL string `json:"callback_url,omitempty" example:"https://your.domain/callback"`
ExternalTaskId string `json:"external_task_id,omitempty" example:"custom-task-001"`
}
type LinuxdoUser ¶
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 OidcResponse ¶
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 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"`
// 是否在容器中运行
IsRunningInContainer bool `json:"is_running_in_container"`
}
PerformanceConfig 性能配置
type PerformanceStats ¶
type PerformanceStats struct {
// 缓存统计
CacheStats common.DiskCacheStats `json:"cache_stats"`
// 系统内存统计
MemoryStats MemoryStats `json:"memory_stats"`
// 磁盘缓存目录信息
DiskCacheInfo DiskCacheInfo `json:"disk_cache_info"`
// 磁盘空间信息
DiskSpaceInfo 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 TokenBatch ¶
type TokenBatch struct {
Ids []int `json:"ids"`
}
type TransferAffQuotaRequest ¶
type TransferAffQuotaRequest struct {
Quota int `json:"quota" binding:"required"`
}
type UniversalVerifyRequest ¶
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"`
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"`
}
Verify2FARequest 验证2FA请求结构
Source Files
¶
- billing.go
- channel-billing.go
- channel-test.go
- channel.go
- channel_affinity_cache.go
- checkin.go
- codex_oauth.go
- codex_usage.go
- console_migrate.go
- deployment.go
- discord.go
- github.go
- group.go
- image.go
- linuxdo.go
- log.go
- midjourney.go
- misc.go
- missing_models.go
- model.go
- model_meta.go
- model_sync.go
- oidc.go
- option.go
- passkey.go
- performance.go
- performance_unix.go
- playground.go
- prefill_group.go
- pricing.go
- ratio_config.go
- ratio_sync.go
- redemption.go
- relay.go
- secure_verification.go
- setup.go
- swag_video.go
- task.go
- task_video.go
- telegram.go
- token.go
- topup.go
- topup_creem.go
- topup_stripe.go
- twofa.go
- uptime_kuma.go
- usedata.go
- user.go
- vendor_meta.go
- video_proxy.go
- video_proxy_gemini.go
- wechat.go