Use the API_KEY environment variable if available.

This is needed if we want to connect to services like hostedgraphite.