Generate api_key for server model