Synchronous endpoint. Send text, get back audio bytes in one call. Pick a model based on quality needs vs latency budget.
No speech model is in the free tier. An account that has never added credits gets 402 with error.code: "model_requires_paid" from every model on this page; any first top-up unlocks them.
curl -X POST https://kymaapi.com/v1/audio/speech \ -H "Authorization: Bearer $KYMA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "eleven-multilingual-v2", "input": "The first move is what sets everything in motion.", "voice_id": "JBFqnCBsd6RMkjVDRZzb", "response_format": "mp3_44100_128" }' \ --output speech.mp3
Text to synthesize. Max 5000 characters per request — chunk longer text client-side. Also accepts the alias text for OpenAI compatibility.
string
Voice id — opaque string from GET /v1/audio/voices. Also accepts the alias voice. Use an ElevenLabs voice with eleven-* models and a MiniMax voice with minimax-speech-* models. When omitted, eleven-* models use 21m00Tcm4TlvDq8ikWAM and minimax-speech-* models use female-shaonv.
Opt-in low-latency mode. When true, audio is delivered progressively as it is synthesized — time-to-first-audio drops to ~0.4s (vs ~1.8s for the default full-buffer path). Transparent to your code: the response is still a single complete audio/mpeg stream you can pipe straight to disk or a player. Currently applies to the MiniMax speech models; ignored by models that don’t support progressive synthesis.
Response
200 OK with raw audio bytes. Billing rides on X-Kyma-* response headers — the body stays a clean audio file you can pipe straight to disk or play.
Header
What
Content-Type
matches the requested format (audio/mpeg for mp3, etc.)
X-Kyma-Model
resolved model id
X-Kyma-Chars-Billed
input char count used for pricing
X-Kyma-Cost-USD
actual cost charged
X-Kyma-Balance-USD
remaining balance
Errors
Status
error.code
When
400
not_a_tts_model
model is not a TTS SKU
400
input_too_long
input text > 5000 chars
400
—
invalid JSON or missing input (error.type: invalid_request)
401
—
missing or invalid API key (error.type: auth_error)
402
model_requires_paid
your account has never added credits; speech models are not in the free tier
402
insufficient_credits
your balance does not cover the request
403
voice_not_owned
the voice_id is a cloned voice that belongs to another account
404
model_not_found
the model is paused or retired (for example eleven-v3); the message names a replacement when there is one
413
—
request body > 25 MB (error.type: invalid_request)
429
audio_concurrent_limit
your tier’s speech concurrency cap is reached. Retry-After: 5
502
tts_failed
the speech model failed (error.type: provider_error)
503
—
speech is not available right now; retry shortly (error.type: provider_error)
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Kyma API","colors":{"primary":"#D4A843","light":"#F2D675","dark":"#C8952E"},"favicon":"https://mintcdn.com/kyma/Ir71WrmY8XrY4SLl/favicon.png?fit=max\u0026auto=format\u0026n=Ir71WrmY8XrY4SLl\u0026q=85\u0026s=9027f99aa13fcc832643ead1f6fb1d86","logo":{"light":"https://mintcdn.com/kyma/Ir71WrmY8XrY4SLl/logo/light.svg?fit=max\u0026auto=format\u0026n=Ir71WrmY8XrY4SLl\u0026q=85\u0026s=dcfc23077ffc3b8109d9c3d5d8c4cfc3","dark":"https://mintcdn.com/kyma/Ir71WrmY8XrY4SLl/logo/dark.svg?fit=max\u0026auto=format\u0026n=Ir71WrmY8XrY4SLl\u0026q=85\u0026s=c21c20f5709c51359720a141096fbfc9"},"api":{"mdx":{"server":"https://kymaapi.com","auth":{"method":"bearer","name":null}}},"background":{"decoration":null,"color":{"light":null,"dark":"#08081a"}},"navbar":{"links":[{"label":"Dashboard","href":"https://kymaapi.com/dashboard"}],"primary":{"type":"button","label":"Get API Key","href":"https://kymaapi.com"}},"footer":{"socials":{"x":"https://x.com/Kyma_API"}},"integrations":{"posthog":{"apiKey":"phc_yCxqxwS8Quvpuxtgrwddye9ucgRPoQBGyAUBYz4UjStV","apiHost":"https://us.i.posthog.com","sessionRecording":false}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kyma","hasAudioNarration":false,"actualSubdomain":"kyma","customDomains":["docs.kymaapi.com"],"gitSource":{"type":"github","owner":"kyma-api","repo":"kyma-api","deployBranch":"main","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b09f521d31c90b31eec06bb","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"Models","count":74},{"language":"default","tag":"Guides","count":64},{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"Endpoints","count":25},{"language":"default","tag":"Integrations","count":19},{"language":"default","tag":"Text \u0026 code","count":16},{"language":"default","tag":"Use Cases","count":9},{"language":"default","tag":"Image","count":7},{"language":"default","tag":"Documentation","count":5},{"language":"default","tag":"Audio","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/audio-speech","slug":"/api-reference/audio-speech","pageMetadata":{"title":"Audio Speech (TTS)","api":"POST /v1/audio/speech","description":"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.","href":"/api-reference/audio-speech"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Synchronous endpoint. Send text, get back audio bytes in one call. Pick a model based on quality needs vs latency budget.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`No speech model is in the `,_jsx(_components.a,{href:`/pricing#free-tier`,children:`free tier`}),`. An account that has never added credits gets `,_jsx(_components.code,{children:`402`}),` with `,_jsx(_components.code,{children:`error.code: \"model_requires_paid\"`}),` from every model on this page; any first top-up unlocks them.`]})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://kymaapi.com/v1/audio/speech`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$KYMA_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"eleven-multilingual-v2\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": \"The first move is what sets everything in motion.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"voice_id\": \"JBFqnCBsd6RMkjVDRZzb\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"response_format\": \"mp3_44100_128\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --output`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` speech.mp3`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`application/json`}),` body.`]}),`\n`,_jsxs(ParamField,{body:`model`,type:`string`,default:`eleven-multilingual-v2`,id:`param-model`,children:[_jsx(_components.p,{children:`One of:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`eleven-multilingual-v2`}),` — hero quality, 29 languages, expressive (`,_jsx(_components.code,{children:`$0.405/1K char`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`eleven-flash-v2-5`}),` — ~75ms time-to-first-byte, real-time agents (`,_jsx(_components.code,{children:`$0.2025/1K char`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`eleven-turbo-v2-5`}),` — balanced quality + speed (`,_jsx(_components.code,{children:`$0.2025/1K char`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`minimax-speech-hd`}),` — MiniMax HD voices (`,_jsx(_components.code,{children:`$0.07/1K char`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`minimax-speech-turbo`}),` — MiniMax low-latency voices (`,_jsx(_components.code,{children:`$0.04/1K char`}),`)`]}),`\n`]})]}),`\n`,_jsx(ParamField,{body:`input`,type:`string`,required:true,id:`param-input`,children:_jsxs(_components.p,{children:[`Text to synthesize. Max 5000 characters per request — chunk longer text client-side. Also accepts the alias `,_jsx(_components.code,{children:`text`}),` for OpenAI compatibility.`]})}),`\n`,_jsx(ParamField,{body:`voice_id`,type:`string`,id:`param-voice-id`,children:_jsxs(_components.p,{children:[`Voice id — opaque string from `,_jsx(_components.a,{href:`/api-reference/audio-voices`,children:_jsx(_components.code,{children:`GET /v1/audio/voices`})}),`. Also accepts the alias `,_jsx(_components.code,{children:`voice`}),`. Use an ElevenLabs voice with `,_jsx(_components.code,{children:`eleven-*`}),` models and a MiniMax voice with `,_jsx(_components.code,{children:`minimax-speech-*`}),` models. When omitted, `,_jsx(_components.code,{children:`eleven-*`}),` models use `,_jsx(_components.code,{children:`21m00Tcm4TlvDq8ikWAM`}),` and `,_jsx(_components.code,{children:`minimax-speech-*`}),` models use `,_jsx(_components.code,{children:`female-shaonv`}),`.`]})}),`\n`,_jsx(ParamField,{body:`response_format`,type:`string`,default:`mp3_44100_128`,id:`param-response-format`,children:_jsxs(_components.p,{children:[`Audio format. `,_jsx(_components.code,{children:`mp3_44100_128`}),` (default), `,_jsx(_components.code,{children:`mp3_44100_192`}),`, `,_jsx(_components.code,{children:`mp3_22050_32`}),`, `,_jsx(_components.code,{children:`pcm_16000`}),`/`,_jsx(_components.code,{children:`22050`}),`/`,_jsx(_components.code,{children:`24000`}),`/`,_jsx(_components.code,{children:`44100`}),`, `,_jsx(_components.code,{children:`ulaw_8000`}),`.`]})}),`\n`,_jsx(ParamField,{body:`voice_settings`,type:`object`,id:`param-voice-settings`,children:_jsxs(_components.p,{children:[`Optional fine-tuning: `,_jsx(_components.code,{children:`stability`}),` (0–1), `,_jsx(_components.code,{children:`similarity_boost`}),` (0–1), `,_jsx(_components.code,{children:`style`}),` (0–1), `,_jsx(_components.code,{children:`use_speaker_boost`}),` (boolean).`]})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,default:`false`,id:`param-stream`,children:_jsxs(_components.p,{children:[`Opt-in low-latency mode. When `,_jsx(_components.code,{children:`true`}),`, audio is delivered progressively as it is synthesized — time-to-first-audio drops to ~0.4s (vs ~1.8s for the default full-buffer path). Transparent to your code: the response is still a single complete `,_jsx(_components.code,{children:`audio/mpeg`}),` stream you can pipe straight to disk or a player. Currently applies to the MiniMax speech models; ignored by models that don’t support progressive synthesis.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`200 OK`}),` with raw audio bytes. Billing rides on `,_jsx(_components.code,{children:`X-Kyma-*`}),` response headers — the body stays a clean audio file you can pipe straight to disk or play.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`What`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Content-Type`})}),_jsxs(_components.td,{children:[`matches the requested format (`,_jsx(_components.code,{children:`audio/mpeg`}),` for mp3, etc.)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-Kyma-Model`})}),_jsx(_components.td,{children:`resolved model id`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-Kyma-Chars-Billed`})}),_jsx(_components.td,{children:`input char count used for pricing`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-Kyma-Cost-USD`})}),_jsx(_components.td,{children:`actual cost charged`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-Kyma-Balance-USD`})}),_jsx(_components.td,{children:`remaining balance`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`When`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`not_a_tts_model`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`model`}),` is not a TTS SKU`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`input_too_long`})}),_jsx(_components.td,{children:`input text > 5000 chars`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`invalid JSON or missing input (`,_jsx(_components.code,{children:`error.type: invalid_request`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`missing or invalid API key (`,_jsx(_components.code,{children:`error.type: auth_error`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`402`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`model_requires_paid`})}),_jsx(_components.td,{children:`your account has never added credits; speech models are not in the free tier`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`402`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`insufficient_credits`})}),_jsx(_components.td,{children:`your balance does not cover the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`voice_not_owned`})}),_jsxs(_components.td,{children:[`the `,_jsx(_components.code,{children:`voice_id`}),` is a cloned voice that belongs to another account`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`model_not_found`})}),_jsxs(_components.td,{children:[`the model is paused or retired (for example `,_jsx(_components.code,{children:`eleven-v3`}),`); the message names a replacement when there is one`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`413`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`request body > 25 MB (`,_jsx(_components.code,{children:`error.type: invalid_request`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`429`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`audio_concurrent_limit`})}),_jsxs(_components.td,{children:[`your tier’s speech concurrency cap is reached. `,_jsx(_components.code,{children:`Retry-After: 5`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`502`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`tts_failed`})}),_jsxs(_components.td,{children:[`the speech model failed (`,_jsx(_components.code,{children:`error.type: provider_error`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`503`})}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`speech is not available right now; retry shortly (`,_jsx(_components.code,{children:`error.type: provider_error`}),`)`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api-reference/audio-voices`,children:_jsx(_components.code,{children:`GET /v1/audio/voices`})}),` — browse the voice library`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Audio Speech (TTS)","api":"POST /v1/audio/speech","description":"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.","href":"/api-reference/audio-speech"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request","slug":"request","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Audio Speech (TTS)","path":"/v1/audio/speech","servers":[{"url":"https://kymaapi.com"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"model":[{"type":"string","description":"One of: `eleven-multilingual-v2` — hero quality, 29 languages, expressive ( `$0.405/1K char` ) `eleven-flash-v2-5` — ~75ms time-to-first-byte, real-time agents ( `$0.2025/1K char` ) `eleven-turbo-v2-5` — balanced quality + speed ( `$0.2025/1K char` ) `minimax-speech-hd` — MiniMax HD voices ( `$0.07/1K char` ) `minimax-speech-turbo` — MiniMax low-latency voices ( `$0.04/1K char` )"}],"input":[{"type":"string","description":"Text to synthesize. Max 5000 characters per request — chunk longer text client-side. Also accepts the alias `text` for OpenAI compatibility.","required":true}],"voice_id":[{"type":"string","description":"Voice id — opaque string from `GET /v1/audio/voices` . Also accepts the alias `voice` . Use an ElevenLabs voice with `eleven-*` models and a MiniMax voice with `minimax-speech-*` models. When omitted, `eleven-*` models use `21m00Tcm4TlvDq8ikWAM` and `minimax-speech-*` models use `female-shaonv` ."}],"response_format":[{"type":"string","description":"Audio format. `mp3_44100_128` (default), `mp3_44100_192` , `mp3_22050_32` , `pcm_16000` / `22050` / `24000` / `44100` , `ulaw_8000` ."}],"voice_settings":[{"type":"object","properties":{},"description":"Optional fine-tuning: `stability` (0–1), `similarity_boost` (0–1), `style` (0–1), `use_speaker_boost` (boolean)."}],"stream":[{"type":"boolean","description":"Opt-in low-latency mode. When `true` , audio is delivered progressively as it is synthesized — time-to-first-audio drops to ~0.4s (vs ~1.8s for the default full-buffer path). Transparent to your code: the response is still a single complete `audio/mpeg` stream you can pipe straight to disk or a player. Currently applies to the MiniMax speech models; ignored by models that don’t support progressive synthesis."}]}}],"examples":{"example":{"value":{"model":"\u003cstring>","input":"\u003cstring>","voice_id":"\u003cstring>","response_format":"\u003cstring>","voice_settings":{},"stream":true}}}}}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"kyma","siteName":"Kyma API","title":"Audio Speech (TTS) - Kyma API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-22T17:55:19.457Z","originalFileLocation":"api-reference/audio-speech.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Kyma API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Audio Speech (TTS) - Kyma API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Kyma API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.kymaapi.com/api-reference/audio-speech\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kyma.mintlify.site/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Audio+Speech+%28TTS%29\u0026amp;description=Text-to-speech.+Synchronous%2C+returns+audio+bytes%2C+billed+per+character.+Several+voice+models%2C+3%2C000%2B+pre-made+voices.\u0026amp;theme=9d9285143cba3d744d7c7101\u0026amp;signature=8cb312c639f9dd0904553fbd194fab8acb6c22672d5483967fff0b957a64567a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Audio Speech (TTS) - Kyma API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kyma.mintlify.site/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Audio+Speech+%28TTS%29\u0026amp;description=Text-to-speech.+Synchronous%2C+returns+audio+bytes%2C+billed+per+character.+Several+voice+models%2C+3%2C000%2B+pre-made+voices.\u0026amp;theme=9d9285143cba3d744d7c7101\u0026amp;signature=8cb312c639f9dd0904553fbd194fab8acb6c22672d5483967fff0b957a64567a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/kyma/VCp6_M63dEPrRkxq/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Kyma API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#D4A843\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.kymaapi.com/api-reference/audio-speech\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/audio-speech.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.kymaapi.com/#organization\",\"name\":\"Kyma API\",\"url\":\"https://docs.kymaapi.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/kyma/Ir71WrmY8XrY4SLl/logo/light.svg?fit=max\u0026auto=format\u0026n=Ir71WrmY8XrY4SLl\u0026q=85\u0026s=dcfc23077ffc3b8109d9c3d5d8c4cfc3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.kymaapi.com#website\",\"name\":\"Kyma API\",\"url\":\"https://docs.kymaapi.com\",\"publisher\":{\"@id\":\"https://docs.kymaapi.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.kymaapi.com/api-reference/audio-speech#webpage\",\"url\":\"https://docs.kymaapi.com/api-reference/audio-speech\",\"name\":\"Audio Speech (TTS)\",\"description\":\"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.\",\"dateModified\":\"2026-09-22T17:55:19.457Z\",\"isPartOf\":{\"@id\":\"https://docs.kymaapi.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.kymaapi.com/api-reference/audio-speech#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.kymaapi.com/api-reference/audio-speech#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.kymaapi.com/api-reference/errors\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Audio Speech (TTS)\",\"item\":\"https://docs.kymaapi.com/api-reference/audio-speech\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.kymaapi.com/api-reference/audio-speech#apireference\",\"headline\":\"Audio Speech (TTS)\",\"name\":\"Audio Speech (TTS)\",\"description\":\"Text-to-speech. Synchronous, returns audio bytes, billed per character. Several voice models, 3,000+ pre-made voices.\",\"url\":\"https://docs.kymaapi.com/api-reference/audio-speech\",\"mainEntityOfPage\":{\"@id\":\"https://docs.kymaapi.com/api-reference/audio-speech#webpage\"},\"dateModified\":\"2026-09-22T17:55:19.457Z\",\"publisher\":{\"@id\":\"https://docs.kymaapi.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.kymaapi.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Kyma API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Kyma API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/audio-speech.md","siteName":"Kyma API","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/any-openai-client"}]},{"tab":"API Reference","groups":[{"group":"Endpoints","pages":[{"title":"Errors","href":"/api-reference/errors"},{"title":"Chat Completions","api":"POST /v1/chat/completions","href":"/api-reference/chat-completions"},{"title":"Messages (Anthropic format)","api":"POST /v1/messages","href":"/api-reference/messages"},{"title":"Create embeddings","api":"POST /v1/embeddings","href":"/api-reference/embeddings"},{"title":"Rerank documents","api":"POST /v1/rerank","href":"/api-reference/rerank"},{"title":"Make a decision","api":"POST /v1/decisions","href":"/api-reference/decisions"},{"title":"Create a completion (legacy)","api":"POST /v1/completions","href":"/api-reference/completions"},{"title":"Image Generations","api":"POST /v1/images/generations","href":"/api-reference/images-generations"},{"title":"Video Generations","api":"POST /v1/videos/generations","href":"/api-reference/videos-generations"},{"title":"Audio Transcriptions","api":"POST /v1/audio/transcriptions","description":"Speech-to-text. Two input modes — multipart file (25 MB, OpenAI Whisper compatible) or JSON audio_url (Kyma extension; 100 MB on whisper-v3-turbo, 25 MB on other models). Synchronous, billed per second with a 10-second minimum per request.","href":"/api-reference/audio-transcriptions"},{"title":"Audio Speech (TTS)","api":"POST /v1/audio/speech","href":"/api-reference/audio-speech"},{"title":"Audio Music","api":"POST /v1/audio/music","description":"Generate a full song with vocals from a prompt and your own lyrics. Synchronous, returns MP3 bytes, flat price per song.","href":"/api-reference/audio-music"},{"title":"Audio Voices","api":"GET /v1/audio/voices","href":"/api-reference/audio-voices"},{"title":"List Models","api":"GET /v1/models","href":"/api-reference/models-list"},{"title":"Recommend a model","api":"GET /v1/models/recommend","href":"/api-reference/models-recommend"},{"title":"Pricing Catalog","api":"GET /v1/pricing","href":"/api-reference/pricing-catalog"},{"title":"Tier Matrix","api":"GET /v1/limits/tiers","href":"/api-reference/limits-tiers"},{"title":"Credit balance","api":"GET /v1/credits/balance","href":"/api-reference/credits-balance"},{"title":"Register","api":"POST /v1/auth/register","href":"/api-reference/auth-register"},{"title":"Login","api":"POST /v1/auth/login","href":"/api-reference/auth-login"},{"title":"Get User Info","api":"GET /v1/auth/me","href":"/api-reference/auth-me"},{"title":"Manage API Keys","href":"/api-reference/auth-keys"},{"title":"Usage by model","api":"GET /v1/auth/usage/models","href":"/api-reference/auth-usage-models"},{"title":"Usage by day","api":"GET /v1/auth/usage/daily","href":"/api-reference/auth-usage-daily"},{"title":"GET /v1/auth/limits","href":"/api-reference/auth-limits"}]}]},{"tab":"Models","pages":[{"title":"Models","href":"/models/overview"}]}]},"basePath":"","title":"Audio Speech (TTS) - Kyma API","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-BMn8tSe3.js","snippetPresets-Dl5ZrD9W.js","utils-CddEzDcs.js","style-to-object-BY3JEAdk.js","utils-Dym31Pnf.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-ZiqR8hPK.js","conditional-requirements-CFM0id0Q.js","cloneDeep-D3fPbylz.js","_Uint8Array-BcNtDki0.js","isObject-FP1Yky1u.js","ApiExamples-4Sf3CFhl.js","usePlaygroundInputsStore-Ck91l6q0.js","shallow-DapBSR9G.js","isEqual-Clu_sGzx.js","CodeSnippets-DAVHdSX2.js","CodeSnippet-Be6AcO_D.js","use-playground-group-access-CteWws2O.js","Page-_aL_PM_2.js","api-description-markdown-BPoPkVJQ.js","DynamicMarkdown-QJ7LkRm3.js","SectionHeading-DyxPTJti.js","MethodPill-CGjK-dNY.js","getPastedJson-C4YIGTOJ.js","Check2Icon-B7COpIZE.js","axios-CsQoIw0U.js"]}