Regarding username and password

For my custom API, I need login username and password. As of now, I am passing the static value in the API. how can I pass the dynamic username and password there?