17 lines
541 B
Python
17 lines
541 B
Python
from typing import List
|
|
|
|
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.core.database import get_db
|
|
from app.services.model_service import ModelService
|
|
from app.datamodels.schemas import ModelPricingResponse
|
|
|
|
router = APIRouter(prefix="/models", tags=["models"])
|
|
|
|
|
|
@router.get("", response_model=List[ModelPricingResponse])
|
|
async def list_models(db: AsyncSession = Depends(get_db)):
|
|
"""Public endpoint: list available models and pricing."""
|
|
return await ModelService.list_models(db)
|