I need to setup API key, how can I get it
or
Just to clarify quickly... there is no "API key". REST and native-API mentioned above use "basic authentication" and relay on transport security to keep hidden (TLS/https). So the "API key" is just a username/password you create using /users/add (or re-use any existing credentials instead). The REST/API basic auth will re-use whatever policy/group assigned to the user/password provided in REST/API.
e.g. There is no OAuth, bearer tokens, passkey, client-certificates, etc type things in RouterOS. So none exist in API or REST API either. Just username+password.
Now if the question is "Should their be a better scheme than store raw passwords in REST/API clients?. My answer is yes.