title: ResourceExhausted in Google Speech API
body: <p>this is my first post on StackOverflow. I get ResourceExhausted with Google Speech API - LongRunningRecognizeResponse. It says "e.g. check quota", but I'm not sure what it means exactly. How do I check quota and make necessary setups?</p>
  
  <pre><code>func sendRequestWithUri(uri string)
   (*speechpb.LongRunningRecognizeResponse, error) {
      log.Printf("Uri: %s", uri)
  
      ctx := context.Background()
      client, err := speech.NewClient(ctx)
      if err != nil {
          log.Fatalf("Failed to create client: %v", err)
      }
  
      // Create Request with config
      req := &amp;speechpb.LongRunningRecognizeRequest{
          Config: &amp;speechpb.RecognitionConfig{
              Encoding:        speechpb.RecognitionConfig_FLAC,
              SampleRateHertz: 44100,
              LanguageCode:    "en-US",
          },
          Audio: &amp;speechpb.RecognitionAudio{
              AudioSource: &amp;speechpb.RecognitionAudio_Uri{
                  Uri: uri,
              },
          },
      }
  
      log.Printf("Created request: %s", req)
  
      op, err := client.LongRunningRecognize(ctx, req)
      if err != nil {
          return nil, err
      }
      return op.Wait(ctx)
  }
  </code></pre>
  
  <p>The code takes the URL for a FLAC file uploaded on Google Cloud Storage. After attempts to try with files in different lengths, I always receive:</p>
  
  <blockquote>
    <p>rpc error: code = ResourceExhausted desc = Resource has been exhausted (e.g. check quota).
    exit status 1</p>
  </blockquote>
  
  <p>Then I opened GCP console, and simply enabled Speech API on one of the projects, where I want to work with Speech API. On a local machine (macOS, bash), I have selected the target project via gcloud <code>gcloud config configurations create myproject</code> and <code>gcloud auth login</code>. It looks like project config is successfully created:</p>
  
  <pre><code>$ gcloud config list
  [core]
  account = mygmail
  disable_usage_reporting = False
  project = myproject
  Your active configuration is: [myproject]
  </code></pre>
  
  <p>After enable and setup, I still get the same ResourceExhausted.
  Do I miss anything? Thanks.</p>