How to generate an API key

Posted by Shmifful@reddit | learnprogramming | View on Reddit | 4 comments

I am trying to build an API for a recommendation engine with Python and FastAPI, but I realised that FastAPI doesn't have any built-in function to generate an API key. So far, I've only built frontend apps and relied on cloud services to handle the backend, and obviously getting access to their services using an API. Isn't an API just a random string of characters? How would you securely store it on the server-side?