Allow setting API key

Reviewer: @frankiefu 

cc @brendankenny