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.
In the Choose where to store your data section, do the following:
Choose a location where your bucket's data is permanently stored from the Location type drop-down menu.
If you select the dual-region location type, you can
also choose to enable turbo replication by using the
relevant checkbox.
To set up cross-bucket replication, select
Add cross-bucket replication via Storage Transfer Service and
follow these steps:
Set up cross-bucket replication
In the Bucket menu, select a bucket.
In the Replication settings section,
click Configure to configure settings for the
replication job.
The Configure cross-bucket replication pane
appears.
To filter objects to replicate by object name prefix,
enter a prefix that you want to include or exclude objects from, then click addAdd a prefix.
To set a storage class for the replicated objects,
select a storage class from the Storage class menu.
If you skip this step, the replicated objects will use the
destination bucket's storage class by default.
Click Done.
In the Choose how to store your data section, do the following:
Select a default storage class for the bucket or
Autoclass for automatic storage class management of your
bucket's data.
To enable hierarchical namespace, in the
Optimize storage for data-intensive workloads section, select
Enable hierarchical namespace on this bucket.
In the Choose how to control access to objects section, select
whether or not your bucket enforces public access prevention,
and select an access control method for your bucket's objects.
In the Choose how to protect object data section, do the
following:
Select any of the options under Data protection that you
want to set for your bucket.
To enable soft delete, click the
Soft delete policy (For data recovery) checkbox,
and specify the number of days you want to retain objects
after deletion.
To set Object Versioning, click the
Object versioning (For version control) checkbox,
and specify the maximum number of versions per object and the number of days after which
the noncurrent versions expire.
To enable the retention policy on objects and buckets, click the Retention (For compliance) checkbox, and then do the following:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-24。"],[],[],null,["# Set up Speech-to-Text\n\nSpeech-to-Text is an API that is powered by Google's artificial intelligence\n(AI) technology. You send your audio data to Speech-to-Text, then receive a\ntext transcription of your audio data in response.\n\nFor more information about\nhow to construct a Speech-to-Text request, see the\n[requests](/speech-to-text/docs/speech-to-text-requests) page.\n\nOverview\n--------\n\nBefore you can begin sending requests to Speech-to-Text, you must enable the\nAPI in the Google Cloud console. The steps on this page walk you through the\nfollowing actions:\n\n- Enable Speech-to-Text on a project.\n- Make sure billing is enabled for Speech-to-Text.\n- (Optional) Create a new Google Cloud Storage bucket to store your audio data.\n\nBefore You Begin\n----------------\n\nThere are two ways to access the service: by using the REST API, or by using the\nSpeech-to-Text Console. We provide\n[code samples](/speech-to-text/docs/samples) that show you how to\nmake a request to the REST API and receive a response. You can learn how to use\nthese samples by following the Speech-to-Text\n[quickstarts](/speech-to-text/docs/quickstart) and\n[how-to guides](/speech-to-text/docs/how-to). If you prefer to use\nSpeech-to-Text with minimal coding, you can use the\n[Cloud Speech-to-Text Console](/speech-to-text/docs/transcribe-console).\n\nThis guide walks you through the steps necessary to start sending requests to\nthe REST API. If you are new to coding, we recommend that you start with the\n[step-by-step in-console tutorials in Google Cloud Platform](/speech-to-text/docs/console-tutorials)\nbefore beginning this quickstart.\n\nSet up your Google Cloud project for Speech-to-Text\n---------------------------------------------------\n\n1. [Sign in to Google Cloud console](https://console.cloud.google.com/)\n\n2. [Go to the project selector page](https://console.cloud.google.com/projectselector2/home/dashboard)\n\n You can either choose an existing project or create a new one. For more\n information about creating a project, see\n [Creating and managing projects](/resource-manager/docs/creating-managing-projects).\n3. If you create a new project, you will be prompted to link a billing account\n to this project. If you are using a pre-existing project, make sure that you\n have billing enabled.\n\n [Learn how to confirm that billing is enabled for your project](/billing/docs/how-to/modify-project)\n | **Note:** You must enable billing to use Speech-to-Text API, however you will not be charged unless you exceed the free quota. See the [pricing](/speech-to-text/pricing) page for more details.\n4. Once you have selected a project and linked it to a billing account, you\n can enable the Speech-to-Text API. Go to the **Search products and\n resources** bar at the top of the page and type in **\"speech\"** . Select the\n **Cloud Speech-to-Text API** from the list of results.\n\n5. To try Speech-to-Text without linking it to your project, choose\n the **TRY THIS API** option. To enable the Speech-to-Text API for use\n with your project, click **ENABLE**.\n\n6. (Optional) Enable data logging. By opting in to data logging, you\n allow Google to record any audio data that you send to Speech-to-Text.\n This data is used to improve the Speech-to-Text models. Users who\n opt in to data logging benefit from lower pricing. See the\n [pricing](/speech-to-text/pricing) and data logging\n [terms and conditions](/speech-to-text/docs/data-logging-terms)\n pages for more information.\n\nOptional: Create a Cloud Storage bucket\n---------------------------------------\n\nIf you intend to transcribe audio longer than 60 seconds or with a file size\nlarger than 10 MB, you must store the audio data in a Cloud Storage bucket\nbefore you can transcribe it using Speech-to-Text. The following steps walk\nyou through the process of creating a new bucket.\n- In the Google Cloud console, go to the Cloud Storage **Buckets** page.\n\n [Go to Buckets](https://console.cloud.google.com/storage/browser)\n- Click add_box **Create**.\n- On the **Create a bucket** page, enter your bucket information. To go to the next step, click **Continue** .\n 1. 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.\n 2. In the **Choose where to store your data** section, do the following:\n 1. Select a [Location type](/storage/docs/locations).\n 2. Choose a location where your bucket's data is permanently stored from the **[Location type](/storage/docs/locations#available-locations)** drop-down menu.\n - If you select the [dual-region](/storage/docs/locations#location-dr) location type, you can also choose to enable [turbo replication](/storage/docs/availability-durability#turbo-replication) by using the relevant checkbox.\n 3. To set up [cross-bucket replication](/storage/docs/availability-durability#cross-bucket-replication), select **Add cross-bucket replication via Storage Transfer Service** and follow these steps: \n\n #### Set up cross-bucket replication\n\n 1. In the **Bucket** menu, select a bucket.\n 2. In the **Replication settings** section,\n click **Configure** to configure settings for the\n replication job.\n\n The **Configure cross-bucket replication** pane\n appears.\n - To filter objects to replicate by object name prefix, enter a prefix that you want to include or exclude objects from, then click add **Add a prefix**.\n - To set a storage class for the replicated objects, select a storage class from the **Storage class** menu. If you skip this step, the replicated objects will use the destination bucket's storage class by default.\n - Click **Done**.\n 3. In the **Choose how to store your data** section, do the following:\n 1. Select a [default storage class](/storage/docs/storage-classes) for the bucket or [Autoclass](/storage/docs/autoclass) for automatic storage class management of your bucket's data.\n 2. To enable [hierarchical namespace](/storage/docs/hns-overview), in the **Optimize storage for data-intensive workloads** section, select **Enable hierarchical namespace on this bucket** . **Note:** You cannot enable hierarchical namespace in existing buckets.\n 4. In the **Choose how to control access to objects** section, select whether or not your bucket enforces [public access prevention](/storage/docs/public-access-prevention), and select an [access control method](/storage/docs/access-control) for your bucket's objects. **Note:** You cannot change the **Prevent public access** setting if this setting is enforced at an [organization policy](/storage/docs/org-policy-constraints#public-access-prevention).\n 5. In the **Choose how to protect object data** section, do the following:\n - Select any of the options under **Data protection** that you want to set for your bucket.\n - To enable [soft delete](/storage/docs/soft-delete), click the **Soft delete policy (For data recovery)** checkbox, and specify the number of days you want to retain objects after deletion.\n - To set [Object Versioning](/storage/docs/object-versioning), click the **Object versioning (For version control)** checkbox, and specify the maximum number of versions per object and the number of days after which the noncurrent versions expire.\n - To enable the retention policy on objects and buckets, click the **Retention (For compliance)** checkbox, and then do the following:\n - To enable [Object Retention Lock](/storage/docs/object-lock), click the **Enable object retention** checkbox.\n - To enable [Bucket Lock](/storage/docs/bucket-lock), click the **Set bucket retention policy** checkbox, and choose a unit of time and a length of time for your retention period.\n - To choose how your object data will be encrypted, expand the **Data encryption** section (expand_more), and select a [**Data encryption** method](/storage/docs/encryption).\n- Click **Create**.\n\nDisable the Speech-to-Text API\n------------------------------\n\n- Complete the following steps if you no longer need to use the Speech-to-Text API in the future.\n 1. Navigate to your Google Cloud dashboard and click on the **Go to APIs\n overview** link in the **APIs** box.\n 2. Select **Cloud Speech-to-Text API**.\n 3. Click the **DISABLE API** button at the top of the Cloud Speech-to-Text API page.\n\nWhat's next\n-----------\n\n- Learn how to send a transcription request to the Speech-to-Text API using [client libraries](/speech-to-text/docs/transcribe-client-libraries), [gcloud](/speech-to-text/docs/transcribe-client-libraries), the [command line](/speech-to-text/docs/transcribe-client-libraries), or the [Speech-to-Text UI](/speech-to-text/docs/transcribe-console)."]]