# Method: projects.locations.recognizers.batchRecognize

- [HTTP request](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#body.aspect_1)
- [BatchRecognizeFileMetadata](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata)
  - [JSON representation](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata.SCHEMA_REPRESENTATION)
- [RecognitionOutputConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#RecognitionOutputConfig)
  - [JSON representation](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#RecognitionOutputConfig.SCHEMA_REPRESENTATION)
- [GcsOutputConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#GcsOutputConfig)
  - [JSON representation](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#GcsOutputConfig.SCHEMA_REPRESENTATION)
- [InlineOutputConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#InlineOutputConfig)
- [OutputFormatConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#OutputFormatConfig)
  - [JSON representation](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#OutputFormatConfig.SCHEMA_REPRESENTATION)
- [NativeOutputFileFormatConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#NativeOutputFileFormatConfig)
- [VttOutputFileFormatConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#VttOutputFileFormatConfig)
- [SrtOutputFileFormatConfig](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#SrtOutputFileFormatConfig)
- [ProcessingStrategy](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#ProcessingStrategy)

Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.

### HTTP request

`POST https://speech.googleapis.com/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `recognizer` | `string` Required. The name of the Recognizer to use during recognition. The expected format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The {recognizer} segment may be set to `_` to use an empty implicit Recognizer. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "config": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#RecognitionConfig`) }, "configMask": string, "files": [ { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata`) } ], "recognitionOutputConfig": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#RecognitionOutputConfig`) }, "processingStrategy": enum (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#ProcessingStrategy`) } ``` |

| Fields ||
|---|---|
| `config` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#RecognitionConfig`)`` Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/OperationMetadata#BatchRecognizeRequest.FIELDS.config_mask` field can be used to override parts of the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#Recognizer.FIELDS.default_recognition_config` of the Recognizer resource. |
| `configMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` The list of fields in `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/OperationMetadata#BatchRecognizeRequest.FIELDS.config` that override the values in the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#Recognizer.FIELDS.default_recognition_config` of the recognizer during this recognition request. If no mask is provided, all given fields in `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/OperationMetadata#BatchRecognizeRequest.FIELDS.config` override the values in the recognizer for this recognition request. If a mask is provided, only the fields listed in the mask override the config in the recognizer for this recognition request. If a wildcard (`*`) is provided, `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/OperationMetadata#BatchRecognizeRequest.FIELDS.config` completely overrides and replaces the config in the recognizer for this recognition request. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |
| `files[]` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata`)`` Audio files with file metadata for ASR. The maximum number of files allowed to be specified is 15. |
| `recognitionOutputConfig` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#RecognitionOutputConfig`)`` Configuration options for where to output the transcripts of each file. |
| `processingStrategy` | ``enum (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#ProcessingStrategy`)`` Processing strategy to use for this request. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `recognizer` resource:

- `speech.recognizers.recognize`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## BatchRecognizeFileMetadata

Metadata about a single file in a batch for recognizers.batchRecognize.

| JSON representation |
|---|
| ``` { "config": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#RecognitionConfig`) }, "configMask": string, // Union field `audio_source` can be only one of the following: "uri": string // End of list of possible types for union field `audio_source`. } ``` |

| Fields ||
|---|---|
| `config` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#RecognitionConfig`)`` Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata.FIELDS.config_mask` field can be used to override parts of the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#Recognizer.FIELDS.default_recognition_config` of the Recognizer resource as well as the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/OperationMetadata#BatchRecognizeRequest.FIELDS.config` at the request level. |
| `configMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` The list of fields in `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata.FIELDS.config` that override the values in the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers#Recognizer.FIELDS.default_recognition_config` of the recognizer during this recognition request. If no mask is provided, all non-default valued fields in `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata.FIELDS.config` override the values in the recognizer for this recognition request. If a mask is provided, only the fields listed in the mask override the config in the recognizer for this recognition request. If a wildcard (`*`) is provided, `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#BatchRecognizeFileMetadata.FIELDS.config` completely overrides and replaces the config in the recognizer for this recognition request. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |
| Union field `audio_source`. The audio source, which is a Google Cloud Storage URI. `audio_source` can be only one of the following: ||
| `uri` | `string` Cloud Storage URI for the audio file. |

## RecognitionOutputConfig

Configuration options for the output(s) of recognition.

| JSON representation |
|---|
| ``` { "outputFormatConfig": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#OutputFormatConfig`) }, // Union field `output` can be only one of the following: "gcsOutputConfig": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#GcsOutputConfig`) }, "inlineResponseConfig": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#InlineOutputConfig`) } // End of list of possible types for union field `output`. } ``` |

| Fields ||
|---|---|
| `outputFormatConfig` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#OutputFormatConfig`)`` Optional. Configuration for the format of the results stored to `output`. If unspecified transcripts will be written in the `NATIVE` format only. |
| Union field `output`. `output` can be only one of the following: ||
| `gcsOutputConfig` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#GcsOutputConfig`)`` If this message is populated, recognition results are written to the provided Google Cloud Storage URI. |
| `inlineResponseConfig` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#InlineOutputConfig`)`` If this message is populated, recognition results are provided in the `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/BatchRecognizeResponse` message of the Operation when completed. This is only supported when calling `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#google.cloud.speech.v2.Speech.BatchRecognize` with just one audio file. |

## GcsOutputConfig

Output configurations for Cloud Storage.

| JSON representation |
|---|
| ``` { "uri": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` The Cloud Storage URI prefix with which recognition results will be written. |

## InlineOutputConfig

This type has no fields.
Output configurations for inline response.

## OutputFormatConfig

Configuration for the format of the results stored to `output`.

| JSON representation |
|---|
| ``` { "native": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#NativeOutputFileFormatConfig`) }, "vtt": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#VttOutputFileFormatConfig`) }, "srt": { object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#SrtOutputFileFormatConfig`) } } ``` |

| Fields ||
|---|---|
| `native` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#NativeOutputFileFormatConfig`)`` Configuration for the native output format. If this field is set or if no other output format field is set, then transcripts will be written to the sink in the native format. |
| `vtt` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#VttOutputFileFormatConfig`)`` Configuration for the VTT output format. If this field is set, then transcripts will be written to the sink in the VTT format. |
| `srt` | ``object (`https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.recognizers/batchRecognize#SrtOutputFileFormatConfig`)`` Configuration for the SRT output format. If this field is set, then transcripts will be written to the sink in the SRT format. |

## NativeOutputFileFormatConfig

This type has no fields.
Output configurations for serialized `BatchRecognizeResults` protos.

## VttOutputFileFormatConfig

This type has no fields.
Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted subtitle file.

## SrtOutputFileFormatConfig

This type has no fields.
Output configurations [SubRip Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) formatted subtitle file.

## ProcessingStrategy

Possible processing strategies for batch requests.

| Enums ||
|---|---|
| `PROCESSING_STRATEGY_UNSPECIFIED` | Default value for the processing strategy. The request is processed as soon as its received. |
| `DYNAMIC_BATCHING` | If selected, processes the request during lower utilization periods for a price discount. The request is fulfilled within 24 hours. |