import type { Model, CreateModelInput, UpdateModelInput } from '@/types' import { request } from './client' export async function listModels(providerId?: string): Promise { const path = providerId ? `/api/models?provider_id=${encodeURIComponent(providerId)}` : '/api/models' return request('GET', path) } export async function createModel(input: CreateModelInput): Promise { return request('POST', '/api/models', input) } export async function updateModel(id: string, input: UpdateModelInput): Promise { return request('PUT', `/api/models/${id}`, input) } export async function deleteModel(id: string): Promise { return request('DELETE', `/api/models/${id}`) }