# Say Text-To-Speech (TTS)

Use this request in order to `say` a text message during a call, this API uses our Text-To-Speech service to convert the provided text into an audio, you can configure the text, language, voice nature and if you want the message to repeat.

## Say TTS

> Say TTS into a channel call

```json
{"openapi":"3.0.3","info":{"title":"Channels","version":"v1"},"tags":[],"servers":[{"url":"https://api.bird.com","description":"Production API"}],"security":[{"accessKey":[]}],"components":{"securitySchemes":{"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"Say":{"type":"object","title":"Say text to Call","additionalProperties":false,"properties":{"text":{"type":"string"},"locale":{"$ref":"#/components/schemas/standard.locale.tts-polly"},"voice":{"type":"string"},"loop":{"type":"integer"},"timeout":{"type":"integer"}},"required":["text"]},"standard.locale.tts-polly":{"description":"Curated set of BCP47 locale identifiers supported by AWS Polly text-to-speech in Bird voice products","enum":["arb","ar-AE","bg-BG","bn-IN","ca-ES","cs-CZ","cy-GB","cmn-CN","da-DK","de-CH","de-DE","de-AT","el-GR","en-AU","en-GB","en-IN","en-NZ","en-ZA","en-US","en-GB-WLS","es-ES","es-MX","es-US","eu-ES","fi-FI","fil-PH","fr-FR","fr-BE","fr-CA","gl-ES","gu-IN","he-IL","hi-IN","hu-HU","id-ID","is-IS","it-IT","ja-JP","ko-KR","lt-LT","lv-LV","ms-MY","nl-BE","nl-NL","nb-NO","pa-IN","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sr-RS","sv-SE","ta-IN","te-IN","tr-TR","th-TH","uk-UA","vi-VN","yue-CN"],"type":"string"},"CallCommandResponse":{"type":"object","title":"CallCommandResponse","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"callId":{"type":"string","format":"uuid"},"callFlowId":{"nullable":true,"type":"string","format":"uuid"},"status":{"type":"string"},"command":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/CallFlowCommandCondition"}}}},"CallFlowCommandCondition":{"type":"object","title":"Conditions for command","additionalProperties":false,"properties":{"variable":{"type":"string","enum":["keys","speech"]},"operator":{"type":"string","enum":["eq","ne","==","!=","contains"]},"value":{"type":"string"}}},"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"},"error.validation":{"additionalProperties":false,"description":"A validation error returned from the API. The `details` map keys are JSON paths\npointing into the request body / parameters; values are arrays of human-readable\nmessages describing each problem with that path.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"description":"Per-field validation messages keyed by JSON path.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"ValidationError","type":"object"}},"responses":{"requestError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"An error"},"validationError":{"$ref":"#/components/responses/error.response.invalid_request"},"error.response.invalid_request":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.validation"}}},"description":"The request contains invalid parameters or body fields."}}},"paths":{"/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/say":{"post":{"summary":"Say TTS","operationId":"sayChannelCall","description":"Say TTS into a channel call","tags":["channel_call_command"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Say"}}}},"responses":{"202":{"description":"Call Command Say was accepted for processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallCommandResponse"}}}},"400":{"$ref":"#/components/responses/requestError"},"404":{"$ref":"#/components/responses/requestError"},"422":{"$ref":"#/components/responses/validationError"}}}}}}
```

### Example 1: Play an announcement when an outbound call is running

{% tabs %}
{% tab title="Request Headers" %}

```
curl -X POST "https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/say" \
     -H "Authorization: AccessKey YOUR_SECRET_TOKEN"
```

{% endtab %}

{% tab title="Request Body" %}

```
{
  "text": "Hi there my name is earl",
  "locale": "en-US",
  "voice": "female"
}
```

{% endtab %}

{% tab title="Response" %}

```
{
  "id": "9ec389c1-a37c-44b8-b09d-2fec18b5c7c6",
  "callId": "0374a740-390d-4395-a007-8ca87ce9f9c9",
  "command": "say",
  "status": "accepted"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/api/voice-api/voice-calls-api/say-text-to-speech-tts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
