Set up Speech-to-Text

Speech-to-Text is an API that is powered by Google's artificial intelligence (AI) technology. You send your audio data to Speech-to-Text, then receive a text transcription of your audio data in response.

For more information about how to construct a Speech-to-Text request, see the requests page.


Before you can begin sending requests to Speech-to-Text, you must enable the API in the Google Cloud console. The steps on this page walk you through the following actions:

  • Enable Speech-to-Text on a project.
  • Make sure billing is enabled for Speech-to-Text.
  • (Optional) Create a new Google Cloud Storage bucket to store your audio data.

Before You Begin

There are two ways to access the service: by using the REST API, or by using the Speech-to-Text Console. We provide code samples that show you how to make a request to the REST API and receive a response. You can learn how to use these samples by following the Speech-to-Text quickstarts and how-to guides. If you prefer to use Speech-to-Text with minimal coding, you can use the Cloud Speech-to-Text Console.

This guide walks you through the steps necessary to start sending requests to the REST API. If you are new to coding, we recommend that you start with the step-by-step in-console tutorials in Google Cloud Platform before beginning this quickstart.

Set up your Google Cloud project for Speech-to-Text

  1. Sign in to Google Cloud console

  2. Go to the project selector page

    You can either choose an existing project or create a new one. For more information about creating a project, see Creating and managing projects.

  3. If you create a new project, you will be prompted to link a billing account to this project. If you are using a pre-existing project, make sure that you have billing enabled.

    Learn how to confirm that billing is enabled for your project

  4. Once you have selected a project and linked it to a billing account, you can enable the Speech-to-Text API. Go to the Search products and resources bar at the top of the page and type in "speech". Select the Cloud Speech-to-Text API from the list of results.

  5. To try Speech-to-Text without linking it to your project, choose the TRY THIS API option. To enable the Speech-to-Text API for use with your project, click ENABLE.

  6. (Optional) Enable data logging. By opting in to data logging, you allow Google to record any audio data that you send to Speech-to-Text. This data is used to improve the Speech-to-Text models. Users who opt in to data logging benefit from lower pricing. See the pricing and data logging terms and conditions pages for more information.

Optional: Create a Cloud Storage bucket

If you intend to transcribe audio longer than 60 seconds or with a file size larger than 10 MB, you must store the audio data in a Cloud Storage bucket before you can transcribe it using Speech-to-Text. The following steps walk you through the process of creating a new bucket.

  • In the Google Cloud console, go to the Cloud Storage Buckets page.

    Go to Buckets page

  • Click Create bucket.
  • On the Create a bucket page, enter your bucket information. To go to the next step, click Continue.
    • For Name your bucket, enter a unique bucket name. Don't include sensitive information in the bucket name, because the bucket namespace is global and publicly visible.
    • For Choose where to store your data, do the following:
      • Select a Location type option.
      • Select a Location option.
    • For Choose a default storage class for your data, select a storage class.
    • For Choose how to control access to objects, select an Access control option.
    • For Advanced settings (optional), specify an encryption method, a retention policy, or bucket labels.
  • Click Create.
  • Disable the Speech-to-Text API

    Complete the following steps if you no longer need to use the Speech-to-Text API in the future.

    1. Navigate to your Google Cloud dashboard and click on the Go to APIs overview link in the APIs box.
    2. Select Cloud Speech-to-Text API.
    3. Click the DISABLE API button at the top of the Cloud Speech-to-Text API page.

    What's next

    Learn how to send a transcription request to the Speech-to-Text API using client libraries, gcloud, the command line, or the Speech-to-Text UI.