Allow api_key to be a proc