Change the method of retrieving the API key from environment variables to using Rails credentials for improved security and maintainability.