# Text To Speech

## Get available TTS models

> Retrieve a list of available TTS models with their associated voices for a specific provider.<br>

```json
{"openapi":"3.0.0","info":{"title":"KidJig Text-to-Speech API","version":"2.0.0"},"servers":[{"url":"https://api.kidjig.com/provider/api/v1","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication. Required for all endpoints."}},"schemas":{"ModelsResponse":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}},"Model":{"type":"object","properties":{"id":{"type":"string","description":"The model ID used in API requests"},"name":{"type":"string","description":"Human-readable name of the model"},"description":{"type":"string","description":"Description of the model"},"provider":{"type":"string","description":"Provider of the model (e.g., elevenlabs, openai, sarvam)"},"type":{"type":"string","description":"Type of service (e.g., tts)"},"voices":{"type":"array","description":"Available voices for this model","items":{"$ref":"#/components/schemas/Voice"}}}},"Voice":{"type":"object","properties":{"id":{"type":"string","description":"The voice ID used in API requests"},"name":{"type":"string","description":"Human-readable name of the voice"},"gender":{"type":"string","enum":["male","female","neutral"],"description":"Gender of the voice"},"description":{"type":"string","description":"Description of the voice"}}},"Error":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/tts/{provider}/models":{"get":{"tags":["Text-to-Speech"],"summary":"Get available TTS models","description":"Retrieve a list of available TTS models with their associated voices for a specific provider.\n","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["elevenlabs","whisper","sarvam"]},"description":"The TTS provider to use"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get details for a specific TTS model

> Retrieve detailed information about a specific TTS model and its voices.<br>

```json
{"openapi":"3.0.0","info":{"title":"KidJig Text-to-Speech API","version":"2.0.0"},"servers":[{"url":"https://api.kidjig.com/provider/api/v1","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication. Required for all endpoints."}},"schemas":{"ModelResponse":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"model":{"$ref":"#/components/schemas/Model"}}}}},"Model":{"type":"object","properties":{"id":{"type":"string","description":"The model ID used in API requests"},"name":{"type":"string","description":"Human-readable name of the model"},"description":{"type":"string","description":"Description of the model"},"provider":{"type":"string","description":"Provider of the model (e.g., elevenlabs, openai, sarvam)"},"type":{"type":"string","description":"Type of service (e.g., tts)"},"voices":{"type":"array","description":"Available voices for this model","items":{"$ref":"#/components/schemas/Voice"}}}},"Voice":{"type":"object","properties":{"id":{"type":"string","description":"The voice ID used in API requests"},"name":{"type":"string","description":"Human-readable name of the voice"},"gender":{"type":"string","enum":["male","female","neutral"],"description":"Gender of the voice"},"description":{"type":"string","description":"Description of the voice"}}},"Error":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/tts/{provider}/models/{modelId}":{"get":{"tags":["Text-to-Speech"],"summary":"Get details for a specific TTS model","description":"Retrieve detailed information about a specific TTS model and its voices.\n","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["elevenlabs","whisper","sarvam"]},"description":"The TTS provider to use"},{"name":"modelId","in":"path","required":true,"schema":{"type":"string"},"description":"The specific model ID to retrieve"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Convert text to speech

> Generate speech from text using the specified provider, model, and voice.<br>

```json
{"openapi":"3.0.0","info":{"title":"KidJig Text-to-Speech API","version":"2.0.0"},"servers":[{"url":"https://api.kidjig.com/provider/api/v1","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication. Required for all endpoints."}},"schemas":{"TTSGenerateRequestElevenLabs":{"type":"object","required":["model","voice","text"],"properties":{"model":{"type":"string","description":"The model ID to use (e.g., eleven_multilingual_v2)"},"voice":{"type":"string","description":"The voice ID to use (e.g., aria, roger)"},"text":{"type":"string","description":"The text to convert to speech"},"config":{"type":"object","properties":{"stability":{"type":"number","default":0.5,"description":"Voice stability (0.0 to 1.0)"},"similarityBoost":{"type":"number","default":0.75,"description":"Similarity boost (0.0 to 1.0)"},"style":{"type":"number","default":0,"description":"Style control (0.0 to 1.0)"},"useSpeakerBoost":{"type":"boolean","default":true,"description":"Whether to use speaker boost"},"format":{"type":"string","default":"mp3","enum":["mp3","wav","ogg"],"description":"Audio format"}}}}},"TTSGenerateRequestWhisper":{"type":"object","required":["model","voice","text"],"properties":{"model":{"type":"string","description":"The model ID to use (e.g., tts-1, tts-1-hd)"},"voice":{"type":"string","description":"The voice ID to use (e.g., alloy, echo, fable, onyx, nova, shimmer)"},"text":{"type":"string","description":"The text to convert to speech"},"config":{"type":"object","properties":{"speed":{"type":"number","default":1,"description":"Speech speed (0.5 to 2.0)"},"format":{"type":"string","default":"mp3","enum":["mp3","wav"],"description":"Audio format"}}}}},"TTSGenerateRequestSarvam":{"type":"object","required":["model","voice","text"],"properties":{"model":{"type":"string","description":"The model ID to use (e.g., bulbul:v1, bulbul:v2)"},"voice":{"type":"string","description":"The voice ID to use (e.g., anushka, abhilash)"},"text":{"type":"string","description":"The text to convert to speech"},"config":{"type":"object","properties":{"target_language_code":{"type":"string","default":"en-IN","description":"Language code for the speech"},"speed":{"type":"number","default":1,"description":"Speech speed (0.5 to 2.0)"},"format":{"type":"string","default":"mp3","enum":["mp3"],"description":"Audio format"}}}}},"TTSResponse":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"integer"},"request":{"type":"object","properties":{"ip":{"type":"string"},"method":{"type":"string"},"url":{"type":"string"}}},"message":{"type":"string"},"data":{"type":"object","properties":{"audioUrl":{"type":"string","description":"URL to the generated audio file"}}}}},"Error":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/tts/{provider}/generate":{"post":{"tags":["Text-to-Speech"],"summary":"Convert text to speech","description":"Generate speech from text using the specified provider, model, and voice.\n","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["elevenlabs","whisper","sarvam"]},"description":"The TTS provider to use"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TTSGenerateRequestElevenLabs"},{"$ref":"#/components/schemas/TTSGenerateRequestWhisper"},{"$ref":"#/components/schemas/TTSGenerateRequestSarvam"}]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TTSResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Model or voice not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# 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://kidjig.gitbook.io/kidjig-docs/api-provider/voice-speech-models/api-reference/text-to-speech.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.
