from fastapi import APIRouter from pydantic import BaseModel router = APIRouter() class ApiConfig(BaseModel): key: str service: str @router.post("/api/config/save") async def save_api_config(config: ApiConfig): if not config.key: return {"error": "API key cannot be empty"} return {"status": "ok"} @router.get("/api/config/load", response_model=ApiConfig) async def load_api_config(service: str): return ApiConfig( key="dummy_key", service=service )