title: Using the Google Cloud Vision API with a simple API key
body: <p>I am using the Google Cloud Vision Java API client documented here: <a href="https://cloud.google.com/vision/docs/reference/libraries" rel="noreferrer">https://cloud.google.com/vision/docs/reference/libraries</a>.</p>
  
  <p>The following quickstart code works fine if I use the implicit default credentials by setting the GOOGLE_APPLICATION_CREDENTIALS environment variable to reference a json file for the right "service account".</p>
  
  <pre><code>// Imports the Google Cloud client library
  import com.google.cloud.vision.spi.v1.ImageAnnotatorClient;
  import com.google.cloud.vision.v1.AnnotateImageRequest;
  import com.google.cloud.vision.v1.AnnotateImageResponse;
  import com.google.cloud.vision.v1.BatchAnnotateImagesResponse;
  
  ...
  
  
  public class QuickstartSample {
    public static void main(String... args) throws Exception {
      // Instantiates a client
      ImageAnnotatorClient vision = ImageAnnotatorClient.create();
  
      ...
  
      BatchAnnotateImagesResponse response = vision.batchAnnotateImages(requests);
      List&lt;AnnotateImageResponse&gt; responses = response.getResponsesList();
  
      ...
    }
  }
  </code></pre>
  
  <p>However, I want to authenticate to the API using a simple (single-string) API key rather than a service account, and I cannot find documentation explaining how to do that through this java library.  Is it possible?</p>