> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Speech Service API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/contact-center/api-list)</Badge>

Use this API to create a custom speech service configuration for a bot. The configured speech service is used as a Speech-to-Text (STT) provider, a Text-to-Speech (TTS) provider, or both.

| **Method**        | POST                                                                                                                           |
| :---------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| **Endpoint**      | `https://{{host}}/api/1.1/public/bot/{{BotID}}/speech-services`                                                                |
| **Content-Type**  | `application/json`                                                                                                             |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token) |
| **API Scope**     | Configuration                                                                                                                  |

## Path Parameters

| Parameter | Description                                                   | Type             |
| :-------- | :------------------------------------------------------------ | :--------------- |
| `host`    | Environment URL, for example, `https://platform.kore.ai`      | String, required |
| `botId`   | BotId or StreamId. You can get it from the App Settings page. | String, required |

## Sample Request

```bash theme={null}
curl --location 'https://{{host}}/api/1.1/public/bot/{{BotID}}/speech-services' \
--header 'Content-Type: application/json' \
--header 'auth: {{JWT}}' \
--data '{
  "vendor": "custom",
  "name": "",
  "label": "Custom Speech",
  "account": "all",
  "authenticationToken": "{{vendorToken}}",
  "useForSpeechToText": true,
  "useForTextToSpeech": true,
  "sttEndpoint": "https://provider.example.com/stt",
  "ttsEndpoint": "https://provider.example.com/tts",
  "ttsStreamingEndpoint": "https://provider.example.com/tts/stream"
}'
```

## Body Parameters

| Parameter              | Description                                                                                                                                                                                    | Type              |
| :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------- |
| `vendor`               | Vendor type. Specify custom for `custom` speech providers.                                                                                                                                     | String, required  |
| `name`                 | Internal identifier of the speech provider. Example: `sarvam`.                                                                                                                                 | String, required  |
| `label`                | The user-friendly name used to configure this provider through call control parameters.                                                                                                        | String, required  |
| `account`              | Account for which the speech service should be available. Specify `all` to make it available across all accounts. Only users with provider and label names can access this custom integration. | String, required  |
| `authenticationToken`  | Authentication token used to access the external speech provider APIs.                                                                                                                         | String, required  |
| `useForSpeechToText`   | Indicates whether this provider should be available for Speech-to-Text (STT). If `useForSpeechToText` is `true`, the `sttEndpoint` must be provided.                                           | Boolean, required |
| `useForTextToSpeech`   | Indicates whether this provider should be available for Text-to-Speech (TTS). If `useForTextToSpeech` is `true`, the `ttsEndpoint` must be provided.                                           | Boolean, required |
| `sttEndpoint`          | Endpoint URL of the middleware for the respective Speech-to-Text requests. Required if `useForSpeechToText` is `true`.                                                                         | String, optional  |
| `ttsEndpoint`          | Endpoint URL of the middleware for the respective Text-to-Speech requests. Required if `useForTextToSpeech` is `true`.                                                                         | String, optional  |
| `ttsStreamingEndpoint` | Streaming Text-to-Speech endpoint URL. Required only if the provider supports TTS streaming.                                                                                                   | String, optional  |

## Sample Response

```json theme={null}
{
    "sid": "b01a18d9-8ec0-4a4b-956e-86xxx"
}
```
