> For the complete documentation index, see [llms.txt](https://docs.cortecs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortecs.ai/api-overview/text-to-speech-beta.md).

# Text to Speech \[BETA]

{% hint style="warning" %}
This endpoint is currently in beta. For any issues or feedback, please contact us via [Discord](https://discord.com/invite/bPFEFcWBhp) or <support@cortecs.ai>.
{% endhint %}

## Create speech

> This endpoint generates audio from the input text using the specified TTS model.

```json
{"openapi":"3.1.0","info":{"title":"Cortecs Text-to-Speech API","version":"1.0.0"},"servers":[{"url":"https://api.cortecs.ai/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SpeechRequest":{"type":"object","description":"A request object for generating speech audio from text. This object contains suggested parameters to generate audio from the specified model. Many of the parameters are optional, and it is recommended to set them only if needed; however, you may include other parameters as required. Note that not all providers support the same set of parameters. Adding unsupported or unnecessary parameters can cause requests to fail or limit the providers able to process them.\n","properties":{"model":{"type":"string","description":"The TTS model to use for speech generation."},"input":{"type":"string","description":"The text to generate audio for."},"voice":{"type":"string","description":"The voice to use for speech generation. Voice options are provider-specific (e.g. Tensorix: \"Emily.wav\", Mistral: \"en_paul_neutral\")."},"response_format":{"type":"string","description":"The audio format of the output. Supported formats are provider-dependent.","nullable":true},"speed":{"type":"number","description":"The speed of the generated audio. The accepted value range differs per provider. Not all providers support this parameter.","nullable":true},"preference":{"type":"string","description":"The provider preference for handling the request.","enum":["speed","cost","balanced"]},"allowed_providers":{"type":"array","items":{"type":"string"},"description":"The providers that are allowed to be used for the request.","nullable":true},"eu_native":{"type":"boolean","description":"Whether to consider only providers based and regulated within the EU. Even when false, all our endpoints are GDPR compliant.","nullable":true},"allow_quantization":{"type":"boolean","description":"Whether to allow quantized endpoints.","nullable":true},"allow_zero_data_retention":{"type":"boolean","description":"Whether to use only ZDR providers.","nullable":true},"enable_model_fallback":{"type":"boolean","description":"Whether to allow model fallback when a model is currently unavailable.","nullable":true},"fallbacks":{"type":"array","items":{"type":"string"},"description":"Alternative models to fall back to if the primary model is unavailable.","nullable":true}},"required":["model","input","voice"]}}},"paths":{"/audio/speech":{"post":{"summary":"Create speech","description":"This endpoint generates audio from the input text using the specified TTS model.","operationId":"createSpeech","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}}},"responses":{"200":{"description":"The audio file content. The format depends on the requested response_format.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"Internal server error."}}}}}}
```
