Aan de slagGa gratis aan de slag

Secure the API endpoint

You have a sentiment analysis model API that needs to be protected with API key authentication.

You've already set up the verify_api_key function, and now you need to create a protected endpoint that accepts the request with text input and returns predictions from the model. This endpoint should only be accessible to users with valid API keys.

You will be working within main.py to complete this exercise.

All the supporting code including verify_api_key and model loading is in model.py

Deze oefening maakt deel uit van de cursus

Deploying AI into Production with FastAPI

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen