-
There’s no “better” method, POST has its use cases like when you want to add/edit something like creating users, editing their profiles and so on, while GET is used when you want to get something like getting user data from a database.
You mentioned that you want to create an API endpoint to get and API key? what do you mean by that? API keys are used in order to make these endpoints secure.