Base URL: http://localhost:8000
If API_KEY is configured, include header:
x-api-key: <your-key>
Endpoint: GET /health
Response example:
{
"status": "ok",
"model_loaded": true,
"cache_enabled": true,
"cache_backend": "memory"
}Endpoint: POST /recommend
Request:
{
"user_id": 1,
"top_n": 10
}Response:
{
"user_id": 1,
"recommendations": [
{
"movieId": 858,
"title": "Godfather, The (1972)",
"genres": "Crime|Drama",
"score": 0.83
}
]
}Endpoint: POST /similar
Request:
{
"movie_id": 1,
"top_n": 10
}Response:
{
"movie_id": 1,
"recommendations": [
{
"movieId": 3114,
"title": "Toy Story 2 (1999)",
"genres": "Adventure|Animation|Children|Comedy|Fantasy",
"score": 0.91
}
]
}Endpoint: POST /reload-model
Use this endpoint after retraining when you want the API to load the latest model artifact without service restart.