Files
Aether/frontend/src/api/public-models.ts
T
elky a90d564931 fix: restore security hardening compatibility and validation
Restore authorized rule reveal, explicit full HTTP capture and retention, video task business fields, and valid payment URLs. Add opt-in credential preservation for trusted recovery, fix frontend type contracts and async races, and eliminate PostgreSQL test fixture resource leaks. Document audit coverage and successful fmt and CI-scoped Clippy checks.
2026-09-07 21:14:27 +08:00

42 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Public Models API - 普通用户可访问的模型列表
*/
import client from './client'
import type { TieredPricingConfig } from './endpoints/types'
export interface PublicGlobalModel {
id: string
name: string
display_name: string | null
is_active: boolean
// 阶梯计费配置
default_tiered_pricing: TieredPricingConfig | null
default_price_per_request: number | null // 按次计费价格
// Key 能力支持
supported_capabilities: string[] | null
supports_embedding?: boolean | null
// 模型配置(JSON)
config: Record<string, unknown> | null
// 调用次数
usage_count: number
}
export interface PublicGlobalModelListResponse {
models: PublicGlobalModel[]
total: number
}
/**
* 获取公开的 GlobalModel 列表(普通用户可访问)
*/
export async function getPublicGlobalModels(params?: {
skip?: number
limit?: number
is_active?: boolean
search?: string
}): Promise<PublicGlobalModelListResponse> {
const response = await client.get<PublicGlobalModelListResponse>('/api/public/global-models', { params })
return response.data
}