# Method: text.synthesize

- [HTTP request](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#body.HTTP_TEMPLATE)
- [Request body](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#body.SynthesizeSpeechResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#body.aspect)
- [AdvancedVoiceOptions](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#AdvancedVoiceOptions)
  - [JSON representation](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#AdvancedVoiceOptions.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#try-it)

Synthesizes speech synchronously: receive results after all text input has been processed.

### HTTP request

`POST https://texttospeech.googleapis.com/v1/text:synthesize`

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

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "input": { object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/SynthesisInput`) }, "voice": { object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/Shared.Types/StreamingSynthesizeConfig#VoiceSelectionParams`) }, "audioConfig": { object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/AudioConfig`) }, "advancedVoiceOptions": { object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#AdvancedVoiceOptions`) } } ``` |

| Fields ||
|---|---|
| `input` | ``object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/SynthesisInput`)`` Required. The Synthesizer requires either plain text or SSML as input. |
| `voice` | ``object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/Shared.Types/StreamingSynthesizeConfig#VoiceSelectionParams`)`` Required. The desired voice of the synthesized audio. |
| `audioConfig` | ``object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/AudioConfig`)`` Required. The configuration of the synthesized audio. |
| `advancedVoiceOptions` | ``object (`https://docs.cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize#AdvancedVoiceOptions`)`` Advanced voice options. |

### Response body

The message returned to the client by the `text.synthesize` method.

If successful, the response body contains data with the following structure:

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

| Fields ||
|---|---|
| `audioContent` | `string (https://developers.google.com/discovery/v1/type-format format)` The audio data bytes encoded as specified in the request, including the header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). For LINEAR16 audio, we include the WAV header. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64. A base64-encoded string. |

### 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).

## AdvancedVoiceOptions

Used for advanced voice options.

| JSON representation |
|---|
| ``` { "lowLatencyJourneySynthesis": boolean } ``` |

| Fields ||
|---|---|
| `lowLatencyJourneySynthesis` | `boolean` Only for Journey voices. If false, the synthesis is context aware and has a higher latency. |