code: def gen_api_key(username):
      
      salt = str(os.urandom(64)).encode('utf-8')
      return hash_password(username, salt)
docs: Create a random API key for a user
      :param username:
      :return: Hex encoded SHA512 random string