Google Cloud Text-To-Speech Cloud Text To Speech Text API

The Cloud Text To Speech Text API from Google Cloud Text-To-Speech — 1 operation(s) for cloud text to speech text.

GitHub OpenAPI

Operations 1

POST /v1/text:synthesize Synthesize text #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-cloud-text-to-speech:google-cloud-text-to-speech-text-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-cloud-text-to-speech-text-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloud -to-Speech Text API
  version: v1
  description: Generated from Google's published Discovery document for Cloud Text-to-Speech API (texttospeech v1, revision 20261110). 1 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://texttospeech.googleapis.com
tags:
- name: Text
paths:
  /v1/text:synthesize:
    post:
      operationId: texttospeech.text.synthesize
      summary: Synthesize text
      description: 'Synthesizes speech synchronously: receive results after all text input has been processed.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SynthesizeSpeechRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SynthesizeSpeechResponse'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
      - apiKey: []
      tags:
      - Text
components:
  schemas:
    SafetySettings:
      description: Safety settings for the request.
      type: object
      properties:
        settings:
          items:
            $ref: '#/components/schemas/SafetySetting'
          description: The safety settings for the request.
          type: array
    AdvancedVoiceOptions:
      type: object
      description: Used for advanced voice options.
      properties:
        safetySettings:
          $ref: '#/components/schemas/SafetySettings'
          description: Optional. Input only. This applies to Gemini TTS only. If set, the category specified in the safety setting will be blocked if the harm probability is above the threshold. Otherwise, the safety filter will be disabled by default.
        enableTextnorm:
          description: Optional. If true, textnorm will be applied to text input. This feature is enabled by default. Only applies for Gemini TTS.
          type: boolean
        relaxSafetyFilters:
          description: Optional. Input only. Deprecated, use safety_settings instead. If true, relaxes safety filters for Gemini TTS.
          type: boolean
          deprecated: true
        lowLatencyJourneySynthesis:
          type: boolean
          description: Only for Journey voices. If false, the synthesis is context aware and has a higher latency.
    SafetySetting:
      type: object
      description: Safety setting for a single harm category.
      properties:
        threshold:
          enum:
          - HARM_BLOCK_THRESHOLD_UNSPECIFIED
          - BLOCK_LOW_AND_ABOVE
          - BLOCK_MEDIUM_AND_ABOVE
          - BLOCK_ONLY_HIGH
          - BLOCK_NONE
          - 'OFF'
          description: The harm block threshold for the safety setting.
          type: string
        category:
          enum:
          - HARM_CATEGORY_UNSPECIFIED
          - HARM_CATEGORY_HATE_SPEECH
          - HARM_CATEGORY_DANGEROUS_CONTENT
          - HARM_CATEGORY_HARASSMENT
          - HARM_CATEGORY_SEXUALLY_EXPLICIT
          description: The harm category to apply the safety setting to.
          type: string
    CustomPronunciationParams:
      properties:
        phoneticEncoding:
          description: The phonetic encoding of the phrase.
          enum:
          - PHONETIC_ENCODING_UNSPECIFIED
          - PHONETIC_ENCODING_IPA
          - PHONETIC_ENCODING_X_SAMPA
          - PHONETIC_ENCODING_JAPANESE_YOMIGANA
          - PHONETIC_ENCODING_PINYIN
          type: string
        pronunciation:
          type: string
          description: The pronunciation of the phrase. This must be in the phonetic encoding specified above.
        phrase:
          description: The phrase to which the customization is applied. The phrase can be multiple words, such as proper nouns, but shouldn't span the length of the sentence.
          type: string
      description: Pronunciation customization for a phrase.
      type: object
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    Turn:
      type: object
      description: A multi-speaker turn.
      properties:
        text:
          type: string
          description: Required. The text to speak.
        speaker:
          type: string
          description: Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer to documentation for available speakers.
    AudioConfig:
      description: Description of audio data to be synthesized.
      properties:
        audioEncoding:
          type: string
          description: Required. The format of the audio byte stream.
          enum:
          - AUDIO_ENCODING_UNSPECIFIED
          - LINEAR16
          - MP3
          - OGG_OPUS
          - MULAW
          - ALAW
          - PCM
          - M4A
        volumeGainDb:
          type: number
          description: Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.
          format: double
        effectsProfileId:
          items:
            type: string
          type: array
          description: Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See [audio profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for current supported profile ids.
        pitch:
          format: double
          description: Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.
          type: number
        speakingRate:
          description: Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 2.0 will return an error.
          type: number
          format: double
        sampleRateHertz:
          description: Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.
          format: int32
          type: integer
      type: object
    VoiceCloneParams:
      type: object
      properties:
        voiceCloningKey:
          description: Required. Created by GenerateVoiceCloningKey.
          type: string
      description: The configuration of Voice Clone feature.
    MultispeakerPrebuiltVoice:
      description: Configuration for a single speaker in a Gemini TTS multi-speaker setup. Enables dialogue between two speakers.
      properties:
        speakerId:
          description: Required. The speaker ID of the voice. See https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options for available values.
          type: string
        speakerAlias:
          description: Required. The speaker alias of the voice. This is the user-chosen speaker name that is used in the multispeaker text input, such as "Speaker1".
          type: string
      type: object
    MultiSpeakerVoiceConfig:
      properties:
        speakerVoiceConfigs:
          items:
            $ref: '#/components/schemas/MultispeakerPrebuiltVoice'
          description: Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          type: array
      type: object
      description: Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request.
    SynthesizeSpeechResponse:
      properties:
        audioContent:
          format: byte
          description: '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.'
          type: string
      type: object
      description: The message returned to the client by the `SynthesizeSpeech` method.
    CustomVoiceParams:
      properties:
        reportedUsage:
          enum:
          - REPORTED_USAGE_UNSPECIFIED
          - REALTIME
          - OFFLINE
          description: Optional. Deprecated. The usage of the synthesized audio to be reported.
          type: string
          deprecated: true
        model:
          type: string
          description: Required. The name of the AutoML model that synthesizes the custom voice.
      description: Description of the custom voice to be synthesized.
      type: object
    SynthesizeSpeechRequest:
      properties:
        voice:
          $ref: '#/components/schemas/VoiceSelectionParams'
          description: Required. The desired voice of the synthesized audio.
        audioConfig:
          $ref: '#/components/schemas/AudioConfig'
          description: Required. The configuration of the synthesized audio.
        input:
          $ref: '#/components/schemas/SynthesisInput'
          description: Required. The Synthesizer requires either plain text or SSML as input.
        advancedVoiceOptions:
          $ref: '#/components/schemas/AdvancedVoiceOptions'
          description: Optional. Advanced voice options.
      description: The top-level message sent by the client for the `SynthesizeSpeech` method.
      type: object
    CustomPronunciations:
      type: object
      properties:
        pronunciations:
          description: The pronunciation customizations are applied.
          items:
            $ref: '#/components/schemas/CustomPronunciationParams'
          type: array
      description: A collection of pronunciation customizations.
    MultiSpeakerMarkup:
      description: A collection of turns for multi-speaker synthesis.
      type: object
      properties:
        turns:
          description: Required. Speaker turns.
          type: array
          items:
            $ref: '#/components/schemas/Turn'
    VoiceSelectionParams:
      type: object
      description: Description of which voice to use for a synthesis request.
      properties:
        voiceClone:
          $ref: '#/components/schemas/VoiceCloneParams'
          description: Optional. The configuration for a voice clone. If [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice clone matching the specified configuration.
        modelName:
          type: string
          description: Optional. The name of the model. If set, the service will choose the model matching the specified configuration.
        languageCode:
          description: Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".
          type: string
        ssmlGender:
          description: The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.
          enum:
          - SSML_VOICE_GENDER_UNSPECIFIED
          - MALE
          - FEMALE
          - NEUTRAL
          type: string
        name:
          description: The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.
          type: string
        multiSpeakerVoiceConfig:
          $ref: '#/components/schemas/MultiSpeakerVoiceConfig'
          description: Optional. The configuration for a Gemini multi-speaker text-to-speech setup. Enables the use of two distinct voices in a single synthesis request.
        customVoice:
          $ref: '#/components/schemas/CustomVoiceParams'
          description: The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.
    SynthesisInput:
      description: Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes.
      properties:
        customPronunciations:
          $ref: '#/components/schemas/CustomPronunciations'
          description: Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
        ssml:
          description: The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
          type: string
        markup:
          description: 'Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.'
          type: string
        text:
          description: The raw text to be synthesized.
          type: string
        prompt:
          description: This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
          type: string
        multiSpeakerMarkup:
          $ref: '#/components/schemas/MultiSpeakerMarkup'
          description: The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/cloud-platform: See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
externalDocs:
  url: https://cloud.google.com/text-to-speech/
x-provenance:
  method: harvested
  publisher: Google
  source: https://texttospeech.googleapis.com/$discovery/rest?version=v1
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261110)