mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-10 21:20:20 +08:00
增加 Codex 重置次数功能
This commit is contained in:
@@ -286,6 +286,42 @@ export async function refreshProviderQuota(
|
||||
return response.data
|
||||
}
|
||||
|
||||
export interface ConsumeCodexResetCreditPayload {
|
||||
idempotency_key: string
|
||||
}
|
||||
|
||||
export interface ConsumeCodexResetCreditResult {
|
||||
key_id: string
|
||||
status: 'success' | 'noop' | 'unknown' | 'error' | string
|
||||
outcome:
|
||||
| 'reset'
|
||||
| 'already_redeemed'
|
||||
| 'nothing_to_reset'
|
||||
| 'no_credit'
|
||||
| 'unknown'
|
||||
| 'error'
|
||||
| string
|
||||
idempotency_key: string
|
||||
refresh_status?: 'success' | 'failed' | string
|
||||
refresh_error?: string | null
|
||||
metadata?: Record<string, unknown>
|
||||
quota_snapshot?: QuotaStatusSnapshot
|
||||
message?: string
|
||||
status_code?: number
|
||||
}
|
||||
|
||||
export async function consumeCodexResetCredit(
|
||||
keyId: string,
|
||||
payload: ConsumeCodexResetCreditPayload,
|
||||
): Promise<ConsumeCodexResetCreditResult> {
|
||||
const response = await client.post(
|
||||
`/api/admin/endpoints/keys/${keyId}/codex-reset-credit/consume`,
|
||||
payload,
|
||||
{ timeout: 5 * 60 * 1000 },
|
||||
)
|
||||
return response.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入 OAuth 凭据(通用)
|
||||
* 支持的 Provider 类型:Codex、Antigravity、GeminiCli、ClaudeCode、Kiro
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ProviderKeyStatusSnapshot } from './statusSnapshot'
|
||||
import type { ProviderKeyStatusSnapshot, QuotaResetCreditsSnapshot } from './statusSnapshot'
|
||||
|
||||
/**
|
||||
* 代理配置类型
|
||||
@@ -340,6 +340,7 @@ export interface CodexUpstreamMetadata {
|
||||
spark_secondary_window_minutes?: number // Spark 周限额窗口大小(分钟)
|
||||
has_credits?: boolean // 是否有积分
|
||||
credits_balance?: number // 积分余额
|
||||
reset_credits?: QuotaResetCreditsSnapshot | null // Codex earned rate-limit reset credits
|
||||
}
|
||||
|
||||
export interface AntigravityModelQuota {
|
||||
|
||||
@@ -54,6 +54,24 @@ export interface QuotaCreditsSnapshot {
|
||||
updated_at?: number | null
|
||||
}
|
||||
|
||||
export interface QuotaResetCreditSnapshot {
|
||||
id?: string | null
|
||||
display_key?: string | null
|
||||
status?: string | null
|
||||
granted_at?: number | null
|
||||
expires_at?: number | null
|
||||
remaining_seconds?: number | null
|
||||
}
|
||||
|
||||
export interface QuotaResetCreditsSnapshot {
|
||||
available_count?: number | null
|
||||
updated_at?: number | null
|
||||
detail_source?: string | null
|
||||
detail_status?: string | null
|
||||
detail_error?: string | null
|
||||
credits?: QuotaResetCreditSnapshot[] | null
|
||||
}
|
||||
|
||||
export interface QuotaStatusSnapshot {
|
||||
version?: number | null
|
||||
provider_type?: string | null
|
||||
@@ -71,6 +89,7 @@ export interface QuotaStatusSnapshot {
|
||||
plan_type?: string | null
|
||||
pool_tier?: string | null
|
||||
credits?: QuotaCreditsSnapshot | null
|
||||
reset_credits?: QuotaResetCreditsSnapshot | null
|
||||
allowed_models_count?: number | null
|
||||
rate_limit?: Record<string, unknown> | null
|
||||
windows?: QuotaWindowSnapshot[] | null
|
||||
|
||||
Reference in New Issue
Block a user