This endpoint only accepts application/json and application/msgpack.For best results, upload reference audio using the create model before using this one. This improves speech quality and reduces latency.To upload audio clips directly, without pre-uploading, serialize the request body with MessagePack as per the instructions.
Specify which TTS model to use. Use s2.1-pro-free for the free developer tier. If omitted or set to an unrecognized value, the request falls back to s2.1-pro.
Available options:
s1,
s2-pro,
s2.1-pro,
s2.1-pro-free,
drama-3
Body
application/jsonapplication/msgpack
Request body for text-to-speech synthesis. Supports single-speaker synthesis on all compatible TTS models. Multi-speaker dialogue synthesis is available with the S2 family (s2-pro, s2.1-pro, s2.1-pro-free) and drama-3, not s1.
Single Speaker
Provide either reference_id (string) pointing to a voice model, or references (array of ReferenceAudio) for zero-shot cloning.
Multiple Speakers (Dialogue — S2 family and drama-3)
For multi-speaker synthesis, provide:
reference_id: array of voice model IDs, e.g., ["speaker-0-id", "speaker-1-id"]
text: use speaker tags <|speaker:0|>, <|speaker:1|>, etc. to indicate speaker changes, e.g., "<|speaker:0|>Hello!<|speaker:1|>Hi there!"
Alternatively, for zero-shot multi-speaker:
references: 2D array where each inner array contains references for one speaker
reference_id: array of identifiers (can be arbitrary strings for zero-shot)
Example (Multi-Speaker with Model IDs)
{
"text": "<|speaker:0|>Good morning!<|speaker:1|>Good morning! How are you?<|speaker:0|>I'm great, thanks!",
"reference_id": ["model-id-alice", "model-id-bob"]
}
Rewrites numbers, dates, units and symbols as spoken words before synthesis, improving stability. Uses language when it is set and otherwise detects the language of each text chunk.
BCP-47 language tag of the text, for example en, es-MX or zh-CN. Case-insensitive, and _ is read as -. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send auto or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send es-MX for Mexican readings. When normalize is false it only affects word timestamps. For text that mixes languages, leave it unset.
Optional request-scoped TTS feature flags forwarded verbatim to the inference backend. Use ["quality-guard"] to enable the quality guard for this synthesis request. Feature availability is determined by the inference backend.
Reference to a server-managed pronunciation dictionary. The server resolves contents via the platform pronunciation-dictionaries API and forwards the full merged dictionary to the inference engine, which performs the substitution.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Fish Audio","description":"Documentation for Fish Audio APIs, SDKs, models, voice cloning, real-time streaming, and self-hosting.","colors":{"primary":"#0e0e0e","light":"#9b90e8","dark":"#09090b"},"logo":{"light":"https://mintcdn.com/hanabiaiinc/amYp9Dj31LtlHliX/logo/light.png?fit=max\u0026auto=format\u0026n=amYp9Dj31LtlHliX\u0026q=85\u0026s=305973cd6a8d11dbf36d1ec682ee845e","dark":"https://mintcdn.com/hanabiaiinc/amYp9Dj31LtlHliX/logo/dark.png?fit=max\u0026auto=format\u0026n=amYp9Dj31LtlHliX\u0026q=85\u0026s=b79bd889db9ac1aae939834596e8a22f"},"favicon":"https://mintcdn.com/hanabiaiinc/-WxHANLOAmlTUwdM/favicon.svg?fit=max\u0026auto=format\u0026n=-WxHANLOAmlTUwdM\u0026q=85\u0026s=dc65d9f44bda0f5b8277c48dd9c979c3","navbar":{"links":[{"href":"https://discord.gg/dF9Db2Tt3Y","label":"Community"},{"href":"mailto:support@fish.audio","label":"Support"}],"primary":{"type":"button","label":"Sign Up","href":"https://fish.audio/app/developers/get-started/?utm_source=docs\u0026utm_medium=navbar\u0026utm_content=sign-up"}},"footer":{"socials":{"website":"https://fish.audio","github":"https://github.com/fishaudio","x":"https://x.com/fishaudio","linkedin":"https://www.linkedin.com/company/fish-audio","discord":"https://discord.gg/dF9Db2Tt3Y"},"links":[{"header":"About","items":[{"label":"Research","href":"https://openaudio.com/"},{"label":"Careers","href":"mailto:hr@fish.audio"},{"label":"Blog","href":"https://fish.audio/blog"}]},{"header":"Resources","items":[{"label":"API Status","href":"https://status.fish.audio"},{"label":"Open Source","href":"https://github.com/fishaudio"},{"label":"Changelog","href":"https://docs.fish.audio/developer-guide/getting-started/changelog"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://fish.audio/privacy"},{"label":"Terms of Service","href":"https://fish.audio/terms"},{"label":"Report Abuse","href":"mailto:support@fish.audio?subject=%5BReport+Abuse%5D+MODEL+NAME\u0026amp;body=Please+provide+a+detailed+description+of+the+abuse+you+are+reporting."}]}]},"fonts":{"family":"Onest"},"integrations":{"amplitude":{"apiKey":"39daf30712f00da6ea5283bc21e7084e"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity"],"display":"header"},"interaction":{"drilldown":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hanabiaiinc","hasAudioNarration":false,"actualSubdomain":"hanabiaiinc","customDomains":["docs.fish.audio"],"gitSource":{"type":"github","owner":"fishaudio","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae56fd1ddbe137114558805","collectionId":"45a52169-46d9-458d-9e97-a210a1c5026e","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae56fd1ddbe137114558805"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae56fd1ddbe137114558805","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"API Reference","count":78},{"language":"default","tag":"Agents API","count":49},{"language":"default","tag":"Agents","count":46},{"language":"default","tag":"Resources","count":40},{"language":"default","tag":"Overview","count":31},{"language":"default","tag":"REST API","count":14},{"language":"default","tag":"Core Features","count":14},{"language":"default","tag":"Tests","count":13},{"language":"default","tag":"Cookbook","count":12},{"language":"default","tag":"Build","count":10}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@fish.audio","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","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":"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":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":"*{scrollbar-width:thin;scrollbar-color:rgba(120,120,120,.4) transparent}::-webkit-scrollbar{width:6px;height:6px;background:0 0!important}::-webkit-scrollbar-thumb{background:rgba(120,120,120,.5);border-radius:999px;opacity:0;transition:opacity .2s ease}:active::-webkit-scrollbar-thumb,:hover::-webkit-scrollbar-thumb{opacity:1}img[src*=\"/images/\"]{background:0 0!important}.prompt-card{display:grid;cursor:pointer;outline:0}.prompt-card .card{transition:border-color .15s ease}.prompt-card:focus-visible .card,.prompt-card:hover .card{border-color:rgb(var(--primary))!important}.dark .prompt-card:focus-visible .card,.dark .prompt-card:hover .card{border-color:rgb(var(--primary-light))!important}.prompt-card-hint{position:absolute;top:1rem;right:1rem;padding:.3rem .6rem;border-radius:9999px;font-size:.75rem;line-height:1;color:rgb(var(--gray-500));background:rgba(120,120,120,.12);opacity:0;transition:opacity .15s ease;pointer-events:none}.prompt-card:focus-visible .prompt-card-hint,.prompt-card:hover .prompt-card-hint,.prompt-card[data-state=copied] .prompt-card-hint,.prompt-card[data-state=failed] .prompt-card-hint{opacity:1}.prompt-card[data-state=copied] .prompt-card-hint{color:rgb(var(--primary));background:rgb(var(--primary)/.12)}.dark .prompt-card[data-state=copied] .prompt-card-hint{color:rgb(var(--primary-light));background:rgb(var(--primary-light)/.16)}"}],"page":{"pagePath":"api-reference/endpoint/openapi-v1/text-to-speech","slug":"/api-reference/endpoint/openapi-v1/text-to-speech","pageMetadata":{"openapi":"post /v1/tts","title":"Text to Speech","description":"Convert text to speech","icon":"comment-dots","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/text-to-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: \"Convert text to speech\"\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`,ul:`ul`,..._provideComponents(),...props.components},{Note,Warning}=_components;if(!Note)_missingMdxReference(`Note`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(Warning,{children:[_jsxs(_components.p,{children:[`This endpoint only accepts `,_jsx(_components.code,{children:`application/json`}),` and `,_jsx(_components.code,{children:`application/msgpack`}),`.`]}),_jsxs(_components.p,{children:[`For best results, upload reference audio using the `,_jsx(_components.a,{href:`/api-reference/endpoint/model/create-model`,children:`create model`}),` before using this one. This improves speech quality and reduces latency.`]}),_jsxs(_components.p,{children:[`To upload audio clips directly, without pre-uploading, serialize the request body with MessagePack as per the `,_jsx(_components.a,{href:`/features/text-to-speech#direct-api-messagepack`,children:`instructions`}),`.`]})]}),`\n`,_jsxs(Note,{children:[_jsx(_components.p,{children:`Audio formats supported:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`WAV / PCM`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Sample Rate: 8kHz, 16kHz, 24kHz, 32kHz, 44.1kHz`}),`\n`,_jsx(_components.li,{children:`Default Sample Rate: 44.1kHz`}),`\n`,_jsx(_components.li,{children:`16-bit, mono`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`MP3`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Sample Rate: 32kHz, 44.1kHz`}),`\n`,_jsx(_components.li,{children:`Default Sample Rate: 44.1kHz`}),`\n`,_jsx(_components.li,{children:`mono`}),`\n`,_jsx(_components.li,{children:`Bitrate: 64kbps, 128kbps (default), 192kbps`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Opus`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Sample Rate: 48kHz`}),`\n`,_jsx(_components.li,{children:`Default Sample Rate: 48kHz`}),`\n`,_jsx(_components.li,{children:`mono`}),`\n`,_jsx(_components.li,{children:`Bitrate: -1000 (auto), 24kbps, 32kbps (default), 48kbps, 64kbps`}),`\n`]}),`\n`]}),`\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":{"openapi":"post /v1/tts","title":"Text to Speech","description":"Convert text to speech","icon":"comment-dots","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/text-to-speech"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Text to Speech","security":["aadfdd2c-1673-4b9f-b981-717e92f868fe"],"parameters":["d5d81142-9dcc-4fd5-bf07-e3e9ac458f5d"],"requestBody":"622499b2-7ae5-4147-bd91-d381fd4d712d","responses":{"200":"6b9fb6d3-f008-4225-87b9-9dd5537bcf61","401":"d698ec5f-7a34-4827-8fe4-c6797d0bb1e8","402":"8b2adf11-a228-452b-b791-e82da4a83a36","503":"07eb8b9d-eadb-4acb-b684-81e5a36660bf"},"tags":["OpenAPI v1"],"x-codeSamples":[{"lang":"bash","label":"Single Speaker","source":"curl --request POST \\\n --url https://api.fish.audio/v1/tts \\\n --header 'Authorization: Bearer \u003ctoken>' \\\n --header 'Content-Type: application/json' \\\n --header 'model: s2.1-pro-free' \\\n --data '{\n \"text\": \"Hello! Welcome to Fish Audio.\",\n \"reference_id\": \"model-id\",\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"prosody\": {\n \"speed\": 1,\n \"volume\": 0,\n \"normalize_loudness\": true\n },\n \"chunk_length\": 300,\n \"normalize\": true,\n \"format\": \"mp3\",\n \"sample_rate\": 44100,\n \"mp3_bitrate\": 128,\n \"latency\": \"normal\",\n \"max_new_tokens\": 1024,\n \"repetition_penalty\": 1.2,\n \"min_chunk_length\": 50,\n \"condition_on_previous_chunks\": true,\n \"early_stop_threshold\": 1\n }'"},{"lang":"bash","label":"Multi Speaker (S2 family only)","source":"curl --request POST \\\n --url https://api.fish.audio/v1/tts \\\n --header 'Authorization: Bearer \u003ctoken>' \\\n --header 'Content-Type: application/json' \\\n --header 'model: s2.1-pro-free' \\\n --data '{\n \"text\": \"\u003c|speaker:0|>Hello!\u003c|speaker:1|>Hi there!\",\n \"reference_id\": [\"speaker-a-id\", \"speaker-b-id\"],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"prosody\": {\n \"speed\": 1,\n \"volume\": 0,\n \"normalize_loudness\": true\n },\n \"chunk_length\": 300,\n \"normalize\": true,\n \"format\": \"mp3\",\n \"sample_rate\": 44100,\n \"mp3_bitrate\": 128,\n \"latency\": \"normal\",\n \"max_new_tokens\": 1024,\n \"repetition_penalty\": 1.2,\n \"min_chunk_length\": 50,\n \"condition_on_previous_chunks\": true,\n \"early_stop_threshold\": 1\n }'"}],"method":"post","type":"path","servers":["67d0b003-947c-4252-a64e-22ee212a4e74"],"path":"/v1/tts","baseUrlOptions":["https://api.fish.audio"],"title":"Text to Speech","description":"Convert text to speech","codeSamples":[{"label":"Single Speaker","lang":"bash","source":"curl --request POST \\\n --url https://api.fish.audio/v1/tts \\\n --header 'Authorization: Bearer \u003ctoken>' \\\n --header 'Content-Type: application/json' \\\n --header 'model: s2.1-pro-free' \\\n --data '{\n \"text\": \"Hello! Welcome to Fish Audio.\",\n \"reference_id\": \"model-id\",\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"prosody\": {\n \"speed\": 1,\n \"volume\": 0,\n \"normalize_loudness\": true\n },\n \"chunk_length\": 300,\n \"normalize\": true,\n \"format\": \"mp3\",\n \"sample_rate\": 44100,\n \"mp3_bitrate\": 128,\n \"latency\": \"normal\",\n \"max_new_tokens\": 1024,\n \"repetition_penalty\": 1.2,\n \"min_chunk_length\": 50,\n \"condition_on_previous_chunks\": true,\n \"early_stop_threshold\": 1\n }'"},{"label":"Multi Speaker (S2 family only)","lang":"bash","source":"curl --request POST \\\n --url https://api.fish.audio/v1/tts \\\n --header 'Authorization: Bearer \u003ctoken>' \\\n --header 'Content-Type: application/json' \\\n --header 'model: s2.1-pro-free' \\\n --data '{\n \"text\": \"\u003c|speaker:0|>Hello!\u003c|speaker:1|>Hi there!\",\n \"reference_id\": [\"speaker-a-id\", \"speaker-b-id\"],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"prosody\": {\n \"speed\": 1,\n \"volume\": 0,\n \"normalize_loudness\": true\n },\n \"chunk_length\": 300,\n \"normalize\": true,\n \"format\": \"mp3\",\n \"sample_rate\": 44100,\n \"mp3_bitrate\": 128,\n \"latency\": \"normal\",\n \"max_new_tokens\": 1024,\n \"repetition_penalty\": 1.2,\n \"min_chunk_length\": 50,\n \"condition_on_previous_chunks\": true,\n \"early_stop_threshold\": 1\n }'"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"d5d81142-9dcc-4fd5-bf07-e3e9ac458f5d":{"in":"header","name":"model","description":"Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.","required":false,"schema":{"default":"s2.1-pro","enum":["s1","s2-pro","s2.1-pro","s2.1-pro-free","drama-3"],"title":"Model","type":"string","isRequired":false,"description":"Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.","uniqueKey":"","typeLabel":"enum\u003cstring>"},"deprecated":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Request body for text-to-speech synthesis. Supports single-speaker synthesis on all compatible TTS models. Multi-speaker dialogue synthesis is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.\n\n## Single Speaker\nProvide either `reference_id` (string) pointing to a voice model, or `references` (array of ReferenceAudio) for zero-shot cloning.\n\n## Multiple Speakers (Dialogue — S2 family and `drama-3`)\nFor multi-speaker synthesis, provide:\n- `reference_id`: array of voice model IDs, e.g., [\"speaker-0-id\", \"speaker-1-id\"]\n- `text`: use speaker tags `\u003c|speaker:0|>`, `\u003c|speaker:1|>`, etc. to indicate speaker changes, e.g., \"\u003c|speaker:0|>Hello!\u003c|speaker:1|>Hi there!\"\n\nAlternatively, for zero-shot multi-speaker:\n- `references`: 2D array where each inner array contains references for one speaker\n- `reference_id`: array of identifiers (can be arbitrary strings for zero-shot)\n\n## Example (Multi-Speaker with Model IDs)\n```json\n{\n \"text\": \"\u003c|speaker:0|>Good morning!\u003c|speaker:1|>Good morning! How are you?\u003c|speaker:0|>I'm great, thanks!\",\n \"reference_id\": [\"model-id-alice\", \"model-id-bob\"]\n}\n```","properties":{"text":{"description":"Text to convert to speech.","title":"Text","type":"string","isRequired":true,"uniqueKey":"text","typeLabel":"string"},"temperature":{"default":0.7,"description":"Controls expressiveness. Higher is more varied, lower is more consistent.","maximum":1,"minimum":0,"title":"Temperature","type":"number","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"default":0.7,"description":"Controls diversity via nucleus sampling.","maximum":1,"minimum":0,"title":"Top P","type":"number","uniqueKey":"top_p","typeLabel":"number"},"references":{"oneOf":[{"type":"array","items":{"description":"A voice sample with its transcript, used for zero-shot voice cloning. The model will attempt to match the voice characteristics from the audio sample.","properties":{"audio":{"description":"Raw audio bytes of the voice sample. Supported formats: WAV, MP3, FLAC. For best results, use 10-30 seconds of clear speech with minimal background noise.","format":"binary","title":"Audio","type":"string","isRequired":true,"uniqueKey":"references.oneOf.0.items.[INDEX].audio","typeLabel":"file"},"text":{"description":"The exact transcript of what is spoken in the audio sample. Accuracy is important for voice cloning quality.","title":"Text","type":"string","isRequired":true,"uniqueKey":"references.oneOf.0.items.[INDEX].text","typeLabel":"string"}},"required":["audio","text"],"title":"ReferenceAudio","type":"object","uniqueKey":"references.oneOf.0.items.[INDEX]","typeLabel":"ReferenceAudio · object"},"title":"References","description":"Single speaker: array of reference audio samples","uniqueKey":"references.oneOf.0","typeLabel":"ReferenceAudio · object[]"},{"type":"array","items":{"items":{"description":"A voice sample with its transcript, used for zero-shot voice cloning. The model will attempt to match the voice characteristics from the audio sample.","properties":{"audio":{"description":"Raw audio bytes of the voice sample. Supported formats: WAV, MP3, FLAC. For best results, use 10-30 seconds of clear speech with minimal background noise.","format":"binary","title":"Audio","type":"string","isRequired":true,"uniqueKey":"references.oneOf.1.items.[INDEX].items.[INDEX].audio","typeLabel":"file"},"text":{"description":"The exact transcript of what is spoken in the audio sample. Accuracy is important for voice cloning quality.","title":"Text","type":"string","isRequired":true,"uniqueKey":"references.oneOf.1.items.[INDEX].items.[INDEX].text","typeLabel":"string"}},"required":["audio","text"],"title":"ReferenceAudio","type":"object","uniqueKey":"references.oneOf.1.items.[INDEX].items.[INDEX]","typeLabel":"ReferenceAudio · object"},"type":"array","uniqueKey":"references.oneOf.1.items.[INDEX]","typeLabel":"ReferenceAudio · object[]"},"title":"References","description":"Multiple speakers: array of arrays, where each inner array contains reference samples for one speaker","uniqueKey":"references.oneOf.1","typeLabel":"ReferenceAudio · object[][]"},{"type":"null","title":"References","description":"Inline voice references for zero-shot cloning. Requires MessagePack (not JSON). For single speaker, provide an array of ReferenceAudio objects. For multiple speakers, provide an array of arrays where each inner array contains references for one speaker. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** The speaker index corresponds to the index in reference_id array. Example for multi-speaker: [[{audio, text}], [{audio, text}, {audio, text}]] for 2 speakers where speaker 1 has 2 reference samples.","uniqueKey":"references.oneOf.2","typeLabel":"null"}],"uniqueKey":"references","typeLabel":"ReferenceAudio · object[] | ReferenceAudio · object[][] | null"},"reference_id":{"oneOf":[{"type":"string","title":"Reference Id","description":"Single speaker: voice model ID string","uniqueKey":"reference_id.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"reference_id.oneOf.1.items.[INDEX]","typeLabel":"string"},"title":"Reference Id","description":"Multiple speakers: array of voice model IDs, one per speaker","uniqueKey":"reference_id.oneOf.1","typeLabel":"string[]"},{"type":"null","title":"Reference Id","description":"Voice model ID(s) from Fish Audio library or your custom models. For single-speaker synthesis, provide a string. For multi-speaker synthesis (dialogue), provide an array of model IDs. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** When using multiple speakers, use speaker tags in your text like `\u003c|speaker:0|>` and `\u003c|speaker:1|>` to indicate speaker changes. Example: `\u003c|speaker:0|>Hello!\u003c|speaker:1|>Hi there!\u003c|speaker:0|>How are you?` with `reference_id: [\"speaker-a-id\", \"speaker-b-id\"]`.","uniqueKey":"reference_id.oneOf.2","typeLabel":"null"}],"uniqueKey":"reference_id","typeLabel":"string | string[] | null"},"prosody":{"oneOf":[{"type":"object","title":"ProsodyControl","description":"Speed and volume adjustments for the output.","properties":{"speed":{"default":1,"description":"Speaking rate multiplier. Valid range: 0.5 to 2.0. 1.0 = normal speed, 0.5 = half speed, 2.0 = double speed. Useful for adjusting pacing without regenerating audio.","title":"Speed","type":"number","uniqueKey":"prosody.oneOf.0.speed","typeLabel":"number"},"volume":{"default":0,"description":"Volume adjustment in decibels (dB). 0 = no change, positive values = louder, negative values = quieter.","title":"Volume","type":"number","uniqueKey":"prosody.oneOf.0.volume","typeLabel":"number"},"normalize_loudness":{"default":true,"description":"Normalize output loudness for more consistent perceived volume. Applies to the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`); on `s1` it is accepted but has no effect.","title":"Normalize Loudness","type":"boolean","uniqueKey":"prosody.oneOf.0.normalize_loudness","typeLabel":"boolean"}},"uniqueKey":"prosody.oneOf.0","typeLabel":"ProsodyControl · object"},{"type":"null","description":"Speed and volume adjustments for the output.","uniqueKey":"prosody.oneOf.1","typeLabel":"null"}],"uniqueKey":"prosody","typeLabel":"ProsodyControl · object | null"},"chunk_length":{"default":300,"description":"Text segment size for processing.","maximum":300,"minimum":100,"title":"Chunk Length","type":"integer","uniqueKey":"chunk_length","typeLabel":"integer"},"normalize":{"default":true,"description":"Rewrites numbers, dates, units and symbols as spoken words before synthesis, improving stability. Uses `language` when it is set and otherwise detects the language of each text chunk.","title":"Normalize","type":"boolean","uniqueKey":"normalize","typeLabel":"boolean"},"language":{"oneOf":[{"type":"string","title":"Language","description":"BCP-47 language tag of the text, for example `en`, `es-MX` or `zh-CN`. Case-insensitive, and `_` is read as `-`. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send `auto` or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send `es-MX` for Mexican readings. When `normalize` is false it only affects word timestamps. For text that mixes languages, leave it unset.","maxLength":35,"pattern":"^[A-Za-z0-9_-]*$","example":"en","uniqueKey":"language.oneOf.0","typeLabel":"string"},{"type":"null","title":"Language","description":"BCP-47 language tag of the text, for example `en`, `es-MX` or `zh-CN`. Case-insensitive, and `_` is read as `-`. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send `auto` or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send `es-MX` for Mexican readings. When `normalize` is false it only affects word timestamps. For text that mixes languages, leave it unset.","example":"en","uniqueKey":"language.oneOf.1","typeLabel":"null"}],"uniqueKey":"language","typeLabel":"string | null"},"format":{"default":"mp3","description":"Output audio format.","enum":["wav","pcm","mp3","opus"],"title":"Format","type":"string","uniqueKey":"format","typeLabel":"enum\u003cstring>"},"sample_rate":{"oneOf":[{"type":"integer","title":"Sample Rate","description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","uniqueKey":"sample_rate.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Sample Rate","description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","uniqueKey":"sample_rate.oneOf.1","typeLabel":"null"}],"uniqueKey":"sample_rate","typeLabel":"integer | null"},"mp3_bitrate":{"default":128,"description":"MP3 bitrate in kbps. Only applies when format is mp3.","enum":[64,128,192],"title":"Mp3 Bitrate","type":"integer","uniqueKey":"mp3_bitrate","typeLabel":"enum\u003cinteger>"},"opus_bitrate":{"default":-1000,"description":"Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.","enum":[-1000,24000,32000,48000,64000],"title":"Opus Bitrate","type":"integer","uniqueKey":"opus_bitrate","typeLabel":"enum\u003cinteger>"},"latency":{"default":"normal","description":"Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency.","enum":["low","normal","balanced"],"title":"Latency","type":"string","uniqueKey":"latency","typeLabel":"enum\u003cstring>"},"max_new_tokens":{"default":1024,"description":"Maximum audio tokens to generate per text chunk.","title":"Max New Tokens","type":"integer","uniqueKey":"max_new_tokens","typeLabel":"integer"},"repetition_penalty":{"default":1.2,"description":"Penalty for repeating audio patterns. Values above 1.0 reduce repetition.","title":"Repetition Penalty","type":"number","uniqueKey":"repetition_penalty","typeLabel":"number"},"min_chunk_length":{"default":50,"description":"Minimum characters before splitting into a new chunk.","maximum":100,"minimum":0,"title":"Min Chunk Length","type":"integer","uniqueKey":"min_chunk_length","typeLabel":"integer"},"condition_on_previous_chunks":{"default":true,"description":"Use previous audio as context for voice consistency.","title":"Condition On Previous Chunks","type":"boolean","uniqueKey":"condition_on_previous_chunks","typeLabel":"boolean"},"early_stop_threshold":{"default":1,"description":"Early stopping threshold for batch processing.","maximum":1,"minimum":0,"title":"Early Stop Threshold","type":"number","uniqueKey":"early_stop_threshold","typeLabel":"number"},"features":{"default":[],"description":"Optional request-scoped TTS feature flags forwarded verbatim to the inference backend. Use [\"quality-guard\"] to enable the quality guard for this synthesis request. Feature availability is determined by the inference backend.","items":{"type":"string","uniqueKey":"features.items.[INDEX]","typeLabel":"string"},"title":"Features","type":"array","uniqueKey":"features","typeLabel":"string[]"},"pronunciation_dictionary":{"oneOf":[{"type":"array","items":{"additionalProperties":false,"description":"Reference to a server-managed pronunciation dictionary. The server resolves contents via the platform pronunciation-dictionaries API and forwards the full merged dictionary to the inference engine, which performs the substitution.","properties":{"id":{"description":"Dictionary identifier as registered on the platform.","pattern":"^[A-Za-z0-9_-]{1,128}$","title":"Id","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.0.items.[INDEX].id","typeLabel":"string"},"version":{"description":"Immutable version identifier for the dictionary. Version is required — there is no implicit `latest`.","pattern":"^[A-Za-z0-9_-]{1,128}$","title":"Version","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.0.items.[INDEX].version","typeLabel":"string"}},"required":["id","version"],"title":"PronunciationDictionaryRef","type":"object","uniqueKey":"pronunciation_dictionary.oneOf.0.items.[INDEX]","typeLabel":"PronunciationDictionaryRef · object"},"title":"Pronunciation Dictionary","description":"Reference form: list of pointers to platform pronunciation dictionaries. Each entry identifies a dictionary by `id` and `version`; the server resolves the contents from the platform service before forwarding them to the inference engine.","maxItems":3,"uniqueKey":"pronunciation_dictionary.oneOf.0","typeLabel":"PronunciationDictionaryRef · object[]"},{"type":"array","items":{"additionalProperties":false,"description":"Inline literal pronunciation dictionary. The server forwards the entries directly to the inference engine without contacting the platform.","properties":{"items":{"description":"Replacement entries for this dictionary. See the top-level `pronunciation_dictionary` field description for replacement semantics.","items":{"additionalProperties":false,"description":"A single key/value entry in a pronunciation dictionary. The inference engine replaces every occurrence of `key` in the request text with the phoneme form `value` during synthesis.","properties":{"key":{"description":"Source substring to match. Pure substring match — no tokenization, no regex. Overlapping matches resolve leftmost-longest. For CJK text include enough context to disambiguate.","maxLength":256,"minLength":1,"title":"Key","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX].key","typeLabel":"string"},"value":{"description":"Phonetic representation that replaces the key during synthesis. Dictionary authors should NOT include the `\u003c|phoneme_start|>` / `\u003c|phoneme_end|>` markers themselves; the inference engine wraps the value with those markers internally so the body is treated as phonemes rather than orthographic text. Requests whose key or value contain either marker are rejected.","maxLength":1024,"minLength":1,"title":"Value","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX].value","typeLabel":"string"},"case_sensitive":{"default":false,"description":"When true the match is case-sensitive; when false ASCII case folding is applied.","title":"Case Sensitive","type":"boolean","uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX].case_sensitive","typeLabel":"boolean"}},"required":["key","value"],"title":"PronunciationItem","type":"object","uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX]","typeLabel":"PronunciationItem · object"},"maxItems":5000,"title":"Items","type":"array","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items","typeLabel":"PronunciationItem · object[]"}},"required":["items"],"title":"PronunciationDictionaryInline","type":"object","uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX]","typeLabel":"PronunciationDictionaryInline · object"},"title":"Pronunciation Dictionary","description":"Inline form: list of literal pronunciation dictionaries. Each dictionary carries an `items` array of `{key, value, case_sensitive?}` entries.","maxItems":3,"uniqueKey":"pronunciation_dictionary.oneOf.1","typeLabel":"PronunciationDictionaryInline · object[]"},{"type":"null","title":"Pronunciation Dictionary","description":"Optional list of up to 3 pronunciation dictionaries to apply during synthesis. Provide either references to platform-managed dictionaries OR inline literal dictionaries (the two forms are mutually exclusive in a single request). The server resolves and merges the dictionaries, then forwards the full merged dictionary to the inference engine, which performs the substitution. Matching is plain substring matching, leftmost-longest, and case-insensitive unless an entry sets `case_sensitive`. Missing or unresolvable references are silently dropped — the request still succeeds. Use `application/json` or `application/msgpack` content-type; nested arrays are not representable in `multipart/form-data`.","uniqueKey":"pronunciation_dictionary.oneOf.2","typeLabel":"null"}],"uniqueKey":"pronunciation_dictionary","typeLabel":"PronunciationDictionaryRef · object[] | PronunciationDictionaryInline · object[] | null"}},"required":["text"],"title":"TTSRequest","type":"object","uniqueKey":"","typeLabel":"TTSRequest · object"},"examples":{"Example":{"title":"Example","value":{"text":"\u003cstring>","temperature":0.7,"top_p":0.7,"references":[{"audio":"\u003cstring>","text":"\u003cstring>"}],"reference_id":"\u003cstring>","prosody":{"speed":1,"volume":0,"normalize_loudness":true},"chunk_length":300,"normalize":true,"language":"en","format":"mp3","sample_rate":123,"mp3_bitrate":128,"opus_bitrate":-1000,"latency":"normal","max_new_tokens":1024,"repetition_penalty":1.2,"min_chunk_length":50,"condition_on_previous_chunks":true,"early_stop_threshold":1,"features":[],"pronunciation_dictionary":[{"id":"\u003cstring>","version":"\u003cstring>"}]}}},"exampleType":"generated"},"application/msgpack":{"schema":{"description":"Request body for text-to-speech synthesis. Supports single-speaker synthesis on all compatible TTS models. Multi-speaker dialogue synthesis is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.\n\n## Single Speaker\nProvide either `reference_id` (string) pointing to a voice model, or `references` (array of ReferenceAudio) for zero-shot cloning.\n\n## Multiple Speakers (Dialogue — S2 family and `drama-3`)\nFor multi-speaker synthesis, provide:\n- `reference_id`: array of voice model IDs, e.g., [\"speaker-0-id\", \"speaker-1-id\"]\n- `text`: use speaker tags `\u003c|speaker:0|>`, `\u003c|speaker:1|>`, etc. to indicate speaker changes, e.g., \"\u003c|speaker:0|>Hello!\u003c|speaker:1|>Hi there!\"\n\nAlternatively, for zero-shot multi-speaker:\n- `references`: 2D array where each inner array contains references for one speaker\n- `reference_id`: array of identifiers (can be arbitrary strings for zero-shot)\n\n## Example (Multi-Speaker with Model IDs)\n```json\n{\n \"text\": \"\u003c|speaker:0|>Good morning!\u003c|speaker:1|>Good morning! How are you?\u003c|speaker:0|>I'm great, thanks!\",\n \"reference_id\": [\"model-id-alice\", \"model-id-bob\"]\n}\n```","properties":{"text":{"description":"Text to convert to speech.","title":"Text","type":"string","isRequired":true,"uniqueKey":"text","typeLabel":"string"},"temperature":{"default":0.7,"description":"Controls expressiveness. Higher is more varied, lower is more consistent.","maximum":1,"minimum":0,"title":"Temperature","type":"number","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"default":0.7,"description":"Controls diversity via nucleus sampling.","maximum":1,"minimum":0,"title":"Top P","type":"number","uniqueKey":"top_p","typeLabel":"number"},"references":{"oneOf":[{"type":"array","items":{"description":"A voice sample with its transcript, used for zero-shot voice cloning. The model will attempt to match the voice characteristics from the audio sample.","properties":{"audio":{"description":"Raw audio bytes of the voice sample. Supported formats: WAV, MP3, FLAC. For best results, use 10-30 seconds of clear speech with minimal background noise.","format":"binary","title":"Audio","type":"string","isRequired":true,"uniqueKey":"references.oneOf.0.items.[INDEX].audio","typeLabel":"file"},"text":{"description":"The exact transcript of what is spoken in the audio sample. Accuracy is important for voice cloning quality.","title":"Text","type":"string","isRequired":true,"uniqueKey":"references.oneOf.0.items.[INDEX].text","typeLabel":"string"}},"required":["audio","text"],"title":"ReferenceAudio","type":"object","uniqueKey":"references.oneOf.0.items.[INDEX]","typeLabel":"ReferenceAudio · object"},"title":"References","description":"Single speaker: array of reference audio samples","uniqueKey":"references.oneOf.0","typeLabel":"ReferenceAudio · object[]"},{"type":"array","items":{"items":{"description":"A voice sample with its transcript, used for zero-shot voice cloning. The model will attempt to match the voice characteristics from the audio sample.","properties":{"audio":{"description":"Raw audio bytes of the voice sample. Supported formats: WAV, MP3, FLAC. For best results, use 10-30 seconds of clear speech with minimal background noise.","format":"binary","title":"Audio","type":"string","isRequired":true,"uniqueKey":"references.oneOf.1.items.[INDEX].items.[INDEX].audio","typeLabel":"file"},"text":{"description":"The exact transcript of what is spoken in the audio sample. Accuracy is important for voice cloning quality.","title":"Text","type":"string","isRequired":true,"uniqueKey":"references.oneOf.1.items.[INDEX].items.[INDEX].text","typeLabel":"string"}},"required":["audio","text"],"title":"ReferenceAudio","type":"object","uniqueKey":"references.oneOf.1.items.[INDEX].items.[INDEX]","typeLabel":"ReferenceAudio · object"},"type":"array","uniqueKey":"references.oneOf.1.items.[INDEX]","typeLabel":"ReferenceAudio · object[]"},"title":"References","description":"Multiple speakers: array of arrays, where each inner array contains reference samples for one speaker","uniqueKey":"references.oneOf.1","typeLabel":"ReferenceAudio · object[][]"},{"type":"null","title":"References","description":"Inline voice references for zero-shot cloning. Requires MessagePack (not JSON). For single speaker, provide an array of ReferenceAudio objects. For multiple speakers, provide an array of arrays where each inner array contains references for one speaker. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** The speaker index corresponds to the index in reference_id array. Example for multi-speaker: [[{audio, text}], [{audio, text}, {audio, text}]] for 2 speakers where speaker 1 has 2 reference samples.","uniqueKey":"references.oneOf.2","typeLabel":"null"}],"uniqueKey":"references","typeLabel":"ReferenceAudio · object[] | ReferenceAudio · object[][] | null"},"reference_id":{"oneOf":[{"type":"string","title":"Reference Id","description":"Single speaker: voice model ID string","uniqueKey":"reference_id.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"reference_id.oneOf.1.items.[INDEX]","typeLabel":"string"},"title":"Reference Id","description":"Multiple speakers: array of voice model IDs, one per speaker","uniqueKey":"reference_id.oneOf.1","typeLabel":"string[]"},{"type":"null","title":"Reference Id","description":"Voice model ID(s) from Fish Audio library or your custom models. For single-speaker synthesis, provide a string. For multi-speaker synthesis (dialogue), provide an array of model IDs. **Multi-speaker is available with the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`) and `drama-3`, not `s1`.** When using multiple speakers, use speaker tags in your text like `\u003c|speaker:0|>` and `\u003c|speaker:1|>` to indicate speaker changes. Example: `\u003c|speaker:0|>Hello!\u003c|speaker:1|>Hi there!\u003c|speaker:0|>How are you?` with `reference_id: [\"speaker-a-id\", \"speaker-b-id\"]`.","uniqueKey":"reference_id.oneOf.2","typeLabel":"null"}],"uniqueKey":"reference_id","typeLabel":"string | string[] | null"},"prosody":{"oneOf":[{"type":"object","title":"ProsodyControl","description":"Speed and volume adjustments for the output.","properties":{"speed":{"default":1,"description":"Speaking rate multiplier. Valid range: 0.5 to 2.0. 1.0 = normal speed, 0.5 = half speed, 2.0 = double speed. Useful for adjusting pacing without regenerating audio.","title":"Speed","type":"number","uniqueKey":"prosody.oneOf.0.speed","typeLabel":"number"},"volume":{"default":0,"description":"Volume adjustment in decibels (dB). 0 = no change, positive values = louder, negative values = quieter.","title":"Volume","type":"number","uniqueKey":"prosody.oneOf.0.volume","typeLabel":"number"},"normalize_loudness":{"default":true,"description":"Normalize output loudness for more consistent perceived volume. Applies to the S2 family (`s2-pro`, `s2.1-pro`, `s2.1-pro-free`); on `s1` it is accepted but has no effect.","title":"Normalize Loudness","type":"boolean","uniqueKey":"prosody.oneOf.0.normalize_loudness","typeLabel":"boolean"}},"uniqueKey":"prosody.oneOf.0","typeLabel":"ProsodyControl · object"},{"type":"null","description":"Speed and volume adjustments for the output.","uniqueKey":"prosody.oneOf.1","typeLabel":"null"}],"uniqueKey":"prosody","typeLabel":"ProsodyControl · object | null"},"chunk_length":{"default":300,"description":"Text segment size for processing.","maximum":300,"minimum":100,"title":"Chunk Length","type":"integer","uniqueKey":"chunk_length","typeLabel":"integer"},"normalize":{"default":true,"description":"Rewrites numbers, dates, units and symbols as spoken words before synthesis, improving stability. Uses `language` when it is set and otherwise detects the language of each text chunk.","title":"Normalize","type":"boolean","uniqueKey":"normalize","typeLabel":"boolean"},"language":{"oneOf":[{"type":"string","title":"Language","description":"BCP-47 language tag of the text, for example `en`, `es-MX` or `zh-CN`. Case-insensitive, and `_` is read as `-`. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send `auto` or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send `es-MX` for Mexican readings. When `normalize` is false it only affects word timestamps. For text that mixes languages, leave it unset.","maxLength":35,"pattern":"^[A-Za-z0-9_-]*$","example":"en","uniqueKey":"language.oneOf.0","typeLabel":"string"},{"type":"null","title":"Language","description":"BCP-47 language tag of the text, for example `en`, `es-MX` or `zh-CN`. Case-insensitive, and `_` is read as `-`. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send `auto` or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send `es-MX` for Mexican readings. When `normalize` is false it only affects word timestamps. For text that mixes languages, leave it unset.","example":"en","uniqueKey":"language.oneOf.1","typeLabel":"null"}],"uniqueKey":"language","typeLabel":"string | null"},"format":{"default":"mp3","description":"Output audio format.","enum":["wav","pcm","mp3","opus"],"title":"Format","type":"string","uniqueKey":"format","typeLabel":"enum\u003cstring>"},"sample_rate":{"oneOf":[{"type":"integer","title":"Sample Rate","description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","uniqueKey":"sample_rate.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Sample Rate","description":"Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).","uniqueKey":"sample_rate.oneOf.1","typeLabel":"null"}],"uniqueKey":"sample_rate","typeLabel":"integer | null"},"mp3_bitrate":{"default":128,"description":"MP3 bitrate in kbps. Only applies when format is mp3.","enum":[64,128,192],"title":"Mp3 Bitrate","type":"integer","uniqueKey":"mp3_bitrate","typeLabel":"enum\u003cinteger>"},"opus_bitrate":{"default":-1000,"description":"Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.","enum":[-1000,24000,32000,48000,64000],"title":"Opus Bitrate","type":"integer","uniqueKey":"opus_bitrate","typeLabel":"enum\u003cinteger>"},"latency":{"default":"normal","description":"Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency.","enum":["low","normal","balanced"],"title":"Latency","type":"string","uniqueKey":"latency","typeLabel":"enum\u003cstring>"},"max_new_tokens":{"default":1024,"description":"Maximum audio tokens to generate per text chunk.","title":"Max New Tokens","type":"integer","uniqueKey":"max_new_tokens","typeLabel":"integer"},"repetition_penalty":{"default":1.2,"description":"Penalty for repeating audio patterns. Values above 1.0 reduce repetition.","title":"Repetition Penalty","type":"number","uniqueKey":"repetition_penalty","typeLabel":"number"},"min_chunk_length":{"default":50,"description":"Minimum characters before splitting into a new chunk.","maximum":100,"minimum":0,"title":"Min Chunk Length","type":"integer","uniqueKey":"min_chunk_length","typeLabel":"integer"},"condition_on_previous_chunks":{"default":true,"description":"Use previous audio as context for voice consistency.","title":"Condition On Previous Chunks","type":"boolean","uniqueKey":"condition_on_previous_chunks","typeLabel":"boolean"},"early_stop_threshold":{"default":1,"description":"Early stopping threshold for batch processing.","maximum":1,"minimum":0,"title":"Early Stop Threshold","type":"number","uniqueKey":"early_stop_threshold","typeLabel":"number"},"features":{"default":[],"description":"Optional request-scoped TTS feature flags forwarded verbatim to the inference backend. Use [\"quality-guard\"] to enable the quality guard for this synthesis request. Feature availability is determined by the inference backend.","items":{"type":"string","uniqueKey":"features.items.[INDEX]","typeLabel":"string"},"title":"Features","type":"array","uniqueKey":"features","typeLabel":"string[]"},"pronunciation_dictionary":{"oneOf":[{"type":"array","items":{"additionalProperties":false,"description":"Reference to a server-managed pronunciation dictionary. The server resolves contents via the platform pronunciation-dictionaries API and forwards the full merged dictionary to the inference engine, which performs the substitution.","properties":{"id":{"description":"Dictionary identifier as registered on the platform.","pattern":"^[A-Za-z0-9_-]{1,128}$","title":"Id","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.0.items.[INDEX].id","typeLabel":"string"},"version":{"description":"Immutable version identifier for the dictionary. Version is required — there is no implicit `latest`.","pattern":"^[A-Za-z0-9_-]{1,128}$","title":"Version","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.0.items.[INDEX].version","typeLabel":"string"}},"required":["id","version"],"title":"PronunciationDictionaryRef","type":"object","uniqueKey":"pronunciation_dictionary.oneOf.0.items.[INDEX]","typeLabel":"PronunciationDictionaryRef · object"},"title":"Pronunciation Dictionary","description":"Reference form: list of pointers to platform pronunciation dictionaries. Each entry identifies a dictionary by `id` and `version`; the server resolves the contents from the platform service before forwarding them to the inference engine.","maxItems":3,"uniqueKey":"pronunciation_dictionary.oneOf.0","typeLabel":"PronunciationDictionaryRef · object[]"},{"type":"array","items":{"additionalProperties":false,"description":"Inline literal pronunciation dictionary. The server forwards the entries directly to the inference engine without contacting the platform.","properties":{"items":{"description":"Replacement entries for this dictionary. See the top-level `pronunciation_dictionary` field description for replacement semantics.","items":{"additionalProperties":false,"description":"A single key/value entry in a pronunciation dictionary. The inference engine replaces every occurrence of `key` in the request text with the phoneme form `value` during synthesis.","properties":{"key":{"description":"Source substring to match. Pure substring match — no tokenization, no regex. Overlapping matches resolve leftmost-longest. For CJK text include enough context to disambiguate.","maxLength":256,"minLength":1,"title":"Key","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX].key","typeLabel":"string"},"value":{"description":"Phonetic representation that replaces the key during synthesis. Dictionary authors should NOT include the `\u003c|phoneme_start|>` / `\u003c|phoneme_end|>` markers themselves; the inference engine wraps the value with those markers internally so the body is treated as phonemes rather than orthographic text. Requests whose key or value contain either marker are rejected.","maxLength":1024,"minLength":1,"title":"Value","type":"string","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX].value","typeLabel":"string"},"case_sensitive":{"default":false,"description":"When true the match is case-sensitive; when false ASCII case folding is applied.","title":"Case Sensitive","type":"boolean","uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX].case_sensitive","typeLabel":"boolean"}},"required":["key","value"],"title":"PronunciationItem","type":"object","uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items.items.[INDEX]","typeLabel":"PronunciationItem · object"},"maxItems":5000,"title":"Items","type":"array","isRequired":true,"uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX].\\items","typeLabel":"PronunciationItem · object[]"}},"required":["items"],"title":"PronunciationDictionaryInline","type":"object","uniqueKey":"pronunciation_dictionary.oneOf.1.items.[INDEX]","typeLabel":"PronunciationDictionaryInline · object"},"title":"Pronunciation Dictionary","description":"Inline form: list of literal pronunciation dictionaries. Each dictionary carries an `items` array of `{key, value, case_sensitive?}` entries.","maxItems":3,"uniqueKey":"pronunciation_dictionary.oneOf.1","typeLabel":"PronunciationDictionaryInline · object[]"},{"type":"null","title":"Pronunciation Dictionary","description":"Optional list of up to 3 pronunciation dictionaries to apply during synthesis. Provide either references to platform-managed dictionaries OR inline literal dictionaries (the two forms are mutually exclusive in a single request). The server resolves and merges the dictionaries, then forwards the full merged dictionary to the inference engine, which performs the substitution. Matching is plain substring matching, leftmost-longest, and case-insensitive unless an entry sets `case_sensitive`. Missing or unresolvable references are silently dropped — the request still succeeds. Use `application/json` or `application/msgpack` content-type; nested arrays are not representable in `multipart/form-data`.","uniqueKey":"pronunciation_dictionary.oneOf.2","typeLabel":"null"}],"uniqueKey":"pronunciation_dictionary","typeLabel":"PronunciationDictionaryRef · object[] | PronunciationDictionaryInline · object[] | null"}},"required":["text"],"title":"TTSRequest","type":"object","uniqueKey":"","typeLabel":"TTSRequest · object"},"examples":{"Example":{"title":"Example","value":{"text":"\u003cstring>","temperature":0.7,"top_p":0.7,"references":[{"audio":"\u003cstring>","text":"\u003cstring>"}],"reference_id":"\u003cstring>","prosody":{"speed":1,"volume":0,"normalize_loudness":true},"chunk_length":300,"normalize":true,"language":"en","format":"mp3","sample_rate":123,"mp3_bitrate":128,"opus_bitrate":-1000,"latency":"normal","max_new_tokens":1024,"repetition_penalty":1.2,"min_chunk_length":50,"condition_on_previous_chunks":true,"early_stop_threshold":1,"features":[],"pronunciation_dictionary":[{"id":"\u003cstring>","version":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"6b9fb6d3-f008-4225-87b9-9dd5537bcf61":{"description":"Request fulfilled, document follows","headers":{"Transfer-Encoding":{"schema":{"type":"string"},"description":"chunked"}},"content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"d698ec5f-7a34-4827-8fe4-c6797d0bb1e8":{"description":"No permission -- see authorization schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"message":{"title":"Message","type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"reason":{"oneOf":[{"type":"string","title":"Reason","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","title":"Reason","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"}},"required":["status","message"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":123,"message":"\u003cstring>","reason":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"8b2adf11-a228-452b-b791-e82da4a83a36":{"description":"No payment -- see charging schemes","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"message":{"title":"Message","type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"reason":{"oneOf":[{"type":"string","title":"Reason","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","title":"Reason","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"}},"required":["status","message"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":123,"message":"\u003cstring>","reason":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"07eb8b9d-eadb-4acb-b684-81e5a36660bf":{"description":"The server cannot process the request due to a high load","headers":{},"content":{"application/json":{"schema":{"properties":{"status":{"title":"Status","type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"message":{"title":"Message","type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"reason":{"oneOf":[{"type":"string","title":"Reason","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","title":"Reason","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"}},"required":["status","message"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":123,"message":"\u003cstring>","reason":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"aadfdd2c-1673-4b9f-b981-717e92f868fe":{"BearerAuth":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"67d0b003-947c-4252-a64e-22ee212a4e74":{"description":"Fish Audio API","url":"https://api.fish.audio"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"hanabiaiinc","siteName":"Fish Audio","title":"Text to Speech - Fish Audio","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-08T23:26:18.672Z","originalFileLocation":"api-reference/endpoint/openapi-v1/text-to-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=\"Convert text to speech\">\u003cmeta data-mint-head name=\"application-name\" content=\"Fish Audio\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_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/hanabiaiinc/rHJNuwD9FcQhvMwX/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Text to Speech - Fish Audio\">\u003cmeta data-mint-head property=\"og:description\" content=\"Convert text to speech\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Fish Audio\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hanabiaiinc.mintlify.app/_mintlify/api/og/v2?division=TTS+%28v1%29\u0026amp;title=Text+to+Speech\u0026amp;description=Convert+text+to+speech\u0026amp;theme=949dddfb68a78f6c8e39910d\u0026amp;signature=09296b616f57204aa9fa371cab8f7ab7cb7938b1bf5d8cf120f2dc84592f508b\">\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=\"Text to Speech - Fish Audio\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Convert text to speech\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hanabiaiinc.mintlify.app/_mintlify/api/og/v2?division=TTS+%28v1%29\u0026amp;title=Text+to+Speech\u0026amp;description=Convert+text+to+speech\u0026amp;theme=949dddfb68a78f6c8e39910d\u0026amp;signature=09296b616f57204aa9fa371cab8f7ab7cb7938b1bf5d8cf120f2dc84592f508b\">\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/hanabiaiinc/rHJNuwD9FcQhvMwX/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Fish Audio\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0e0e0e\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-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/endpoint/openapi-v1/text-to-speech.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.fish.audio/#organization\",\"name\":\"Fish Audio\",\"url\":\"https://docs.fish.audio\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hanabiaiinc/amYp9Dj31LtlHliX/logo/light.png?fit=max\u0026auto=format\u0026n=amYp9Dj31LtlHliX\u0026q=85\u0026s=305973cd6a8d11dbf36d1ec682ee845e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.fish.audio#website\",\"name\":\"Fish Audio\",\"url\":\"https://docs.fish.audio\",\"publisher\":{\"@id\":\"https://docs.fish.audio/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech#webpage\",\"url\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech\",\"name\":\"Text to Speech\",\"description\":\"Convert text to speech\",\"dateModified\":\"2026-06-08T23:26:18.672Z\",\"isPartOf\":{\"@id\":\"https://docs.fish.audio#website\"},\"breadcrumb\":{\"@id\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"REST API\",\"item\":\"https://docs.fish.audio/api-reference/endpoint/wallet/get-api-credit\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Text to Speech\",\"item\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech#apireference\",\"headline\":\"Text to Speech\",\"name\":\"Text to Speech\",\"description\":\"Convert text to speech\",\"url\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech\",\"mainEntityOfPage\":{\"@id\":\"https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech#webpage\"},\"dateModified\":\"2026-06-08T23:26:18.672Z\",\"publisher\":{\"@id\":\"https://docs.fish.audio/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.fish.audio#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Fish Audio\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Fish Audio","nav":{"global":null,"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/overview/capabilities"}]},{"tab":"Agents","pages":[{"title":"Agents","href":"/agents/overview"}]},{"tab":"Resources","pages":[{"title":"Resources","href":"/developer-guide/sdk-guide/quickstart"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"Introduction","icon":"book","iconType":"solid","href":"/api-reference/introduction"},{"title":"Tracing \u0026 Performance Analysis","icon":"chart-line","iconType":"solid","href":"/api-reference/observability"},{"title":"Errors","icon":"triangle-exclamation","href":"/api-reference/errors"}]},{"group":"REST API","pages":[{"group":"Wallet","icon":"wallet","pages":[{"openapi":"get /wallet/{user_id}/api-credit","title":"Get API Credit","icon":"wallet","iconType":"solid","href":"/api-reference/endpoint/wallet/get-api-credit"},{"openapi":"get /wallet/{user_id}/package","title":"Get User Package","icon":"star","iconType":"solid","href":"/api-reference/endpoint/wallet/get-user-package"}]},{"group":"Voice Models","icon":"cube","pages":[{"openapi":"get /model","title":"List Models","icon":"list","iconType":"solid","href":"/api-reference/endpoint/model/list-models"},{"openapi":"post /model","title":"Create Model","icon":"circle-plus","iconType":"solid","href":"/api-reference/endpoint/model/create-model"},{"openapi":"get /model/{id}","title":"Get Model","icon":"circle-info","iconType":"solid","href":"/api-reference/endpoint/model/get-model"},{"openapi":"delete /model/{id}","title":"Delete Model","icon":"trash","iconType":"solid","href":"/api-reference/endpoint/model/delete-model"},{"openapi":"patch /model/{id}","title":"Update Model","description":"Update an existing model","icon":"pen-to-square","iconType":"solid","href":"/api-reference/endpoint/model/update-model"}]},{"group":"TTS (v1)","icon":"code","pages":[{"openapi":"post /v1/tts","title":"Text to Speech","icon":"comment-dots","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/text-to-speech"},{"openapi":"post /v1/tts/stream/with-timestamp","title":"Text to Speech Stream with Timestamps","description":"Stream generated speech with timestamp alignment snapshots","icon":"waveform-lines","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/text-to-speech-stream-with-timestamps"},{"asyncapi":"api-reference/asyncapi.yml ttsLive","title":"WebSocket TTS Streaming","icon":"webhook","iconType":"solid","href":"/api-reference/endpoint/websocket/tts-live"},{"asyncapi":"api-reference/asyncapi.yml ttsLiveWithTimestamps","title":"WebSocket TTS with Timestamps","icon":"webhook","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/text-to-speech-live-with-timestamps"}]},{"group":"ASR (v1)","icon":"microphone","pages":[{"openapi":"post /v1/asr","title":"Speech to Text","icon":"microphone","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/speech-to-text"},{"asyncapi":"api-reference/asyncapi-asr-realtime.yml asrRealtime","title":"WebSocket Realtime Speech to Text","icon":"webhook","iconType":"solid","tag":"Preview","href":"/api-reference/endpoint/websocket/asr-realtime"}]},{"group":"Voice Design","icon":"wand-magic-sparkles","pages":[{"openapi":"post /v1/voice-design","title":"Voice Design","icon":"wand-magic-sparkles","iconType":"solid","href":"/api-reference/endpoint/openapi-v1/voice-design"}]}]},{"group":"Agents API","pages":[{"title":"Agents API Errors","icon":"triangle-exclamation","href":"/api-reference/agent-errors"},{"group":"Agents","icon":"robot","pages":[{"openapi":"get /v1/agent/agents","title":"List Agents","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/list-agents"},{"openapi":"post /v1/agent/agents","title":"Create Agent","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/create-agent"},{"openapi":"get /v1/agent/agents/{agent_id}","title":"Get Agent","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/get-agent"},{"openapi":"patch /v1/agent/agents/{agent_id}","title":"Update Agent","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/update-agent"},{"openapi":"delete /v1/agent/agents/{agent_id}","title":"Delete Agent","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/delete-agent"},{"openapi":"get /v1/agent/agents/{agent_id}/config","title":"Get Draft Config","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/get-draft-config"},{"openapi":"patch /v1/agent/agents/{agent_id}/config","title":"Update Draft Config","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/update-draft-config"},{"openapi":"post /v1/agent/agents/{agent_id}/publish","title":"Publish Agent","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/publish-agent"},{"openapi":"get /v1/agent/agents/{agent_id}/versions","title":"List Agent Versions","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/list-agent-versions"},{"openapi":"get /v1/agent/agents/{agent_id}/versions/{version_number}","title":"Get Agent Version","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/get-agent-version"},{"openapi":"get /v1/agent/agents/{agent_id}/widget","title":"Get Widget Config","icon":"robot","iconType":"solid","href":"/api-reference/endpoint/agent/get-widget-config"}]},{"group":"Sessions","icon":"headset","pages":[{"openapi":"post /v1/agent/sessions","title":"Create Agent Session","icon":"headset","iconType":"solid","href":"/api-reference/endpoint/agent/create-agent-session"},{"openapi":"get /v1/agent/sessions","title":"List Agent Sessions","icon":"headset","iconType":"solid","href":"/api-reference/endpoint/agent/list-agent-sessions"},{"openapi":"get /v1/agent/sessions/{session_id}","title":"Get Agent Session","icon":"headset","iconType":"solid","href":"/api-reference/endpoint/agent/get-agent-session"},{"openapi":"get /v1/agent/sessions/{session_id}/recording","title":"Get Agent Session Recording","icon":"headset","iconType":"solid","href":"/api-reference/endpoint/agent/get-agent-session-recording"},{"openapi":"post /v1/agent/sessions/{session_id}/end","title":"End Agent Session","icon":"headset","iconType":"solid","href":"/api-reference/endpoint/agent/end-agent-session"}]},{"group":"Tools","icon":"wrench","pages":[{"openapi":"get /v1/agent/tools","title":"List Tools","icon":"wrench","iconType":"solid","href":"/api-reference/endpoint/agent/list-tools"},{"openapi":"post /v1/agent/tools","title":"Create Tool","icon":"wrench","iconType":"solid","href":"/api-reference/endpoint/agent/create-tool"},{"openapi":"get /v1/agent/tools/{tool_id}","title":"Get Tool","icon":"wrench","iconType":"solid","href":"/api-reference/endpoint/agent/get-tool"},{"openapi":"patch /v1/agent/tools/{tool_id}","title":"Update Tool","icon":"wrench","iconType":"solid","href":"/api-reference/endpoint/agent/update-tool"},{"openapi":"delete /v1/agent/tools/{tool_id}","title":"Delete Tool","icon":"wrench","iconType":"solid","href":"/api-reference/endpoint/agent/delete-tool"},{"openapi":"get /v1/agent/tools/{tool_id}/agents","title":"List Agents Using Tool","icon":"wrench","iconType":"solid","href":"/api-reference/endpoint/agent/list-agents-using-tool"}]},{"group":"Tests","icon":"flask","pages":[{"openapi":"get /v1/agent/tests","title":"List Tests","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/list-tests"},{"openapi":"post /v1/agent/tests","title":"Create Test","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/create-test"},{"openapi":"get /v1/agent/tests/{test_id}","title":"Get Test","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/get-test"},{"openapi":"patch /v1/agent/tests/{test_id}","title":"Update Test","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/update-test"},{"openapi":"delete /v1/agent/tests/{test_id}","title":"Delete Test","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/delete-test"},{"openapi":"put /v1/agent/agents/{agent_id}/tests/{test_id}","title":"Attach Test","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/attach-test"},{"openapi":"delete /v1/agent/agents/{agent_id}/tests/{test_id}","title":"Detach Test","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/detach-test"},{"openapi":"get /v1/agent/agents/{agent_id}/test-tools","title":"List Test Tools","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/list-test-tools"},{"openapi":"post /v1/agent/agents/{agent_id}/tests/run","title":"Run Tests","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/run-tests"},{"openapi":"get /v1/agent/agents/{agent_id}/test-batches","title":"List Test Batches","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/list-test-batches"},{"openapi":"get /v1/agent/agents/{agent_id}/test-batches/{batch_id}","title":"Get Test Batch","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/get-test-batch"},{"openapi":"get /v1/agent/test-runs","title":"List Test Runs","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/list-test-runs"},{"openapi":"get /v1/agent/test-runs/{run_id}","title":"Get Test Run","icon":"flask","iconType":"solid","href":"/api-reference/endpoint/agent/get-test-run"}]},{"group":"Knowledge Sources","icon":"book","pages":[{"openapi":"get /v1/agent/knowledge-sources","title":"List Knowledge Sources","icon":"book","iconType":"solid","href":"/api-reference/endpoint/agent/list-knowledge-sources"},{"openapi":"post /v1/agent/knowledge-sources","title":"Create Knowledge Source","icon":"book","iconType":"solid","href":"/api-reference/endpoint/agent/create-knowledge-source"},{"openapi":"get /v1/agent/knowledge-sources/{source_id}","title":"Get Knowledge Source","icon":"book","iconType":"solid","href":"/api-reference/endpoint/agent/get-knowledge-source"},{"openapi":"patch /v1/agent/knowledge-sources/{source_id}","title":"Update Knowledge Source","icon":"book","iconType":"solid","href":"/api-reference/endpoint/agent/update-knowledge-source"},{"openapi":"delete /v1/agent/knowledge-sources/{source_id}","title":"Delete Knowledge Source","icon":"book","iconType":"solid","href":"/api-reference/endpoint/agent/delete-knowledge-source"},{"openapi":"get /v1/agent/knowledge-sources/{source_id}/agents","title":"List Agents Using Knowledge Source","icon":"book","iconType":"solid","href":"/api-reference/endpoint/agent/list-agents-using-knowledge-source"}]},{"group":"Phone Numbers","icon":"phone","pages":[{"openapi":"get /v1/agent/available-phone-numbers","title":"Search Available Phone Numbers","icon":"phone","iconType":"solid","href":"/api-reference/endpoint/agent/search-available-phone-numbers"},{"openapi":"get /v1/agent/phone-numbers","title":"List Phone Numbers","icon":"phone","iconType":"solid","href":"/api-reference/endpoint/agent/list-phone-numbers"},{"openapi":"post /v1/agent/phone-numbers","title":"Purchase Phone Number","icon":"phone","iconType":"solid","href":"/api-reference/endpoint/agent/purchase-phone-number"},{"openapi":"get /v1/agent/phone-numbers/{phone_number_id}","title":"Get Phone Number","icon":"phone","iconType":"solid","href":"/api-reference/endpoint/agent/get-phone-number"},{"openapi":"patch /v1/agent/phone-numbers/{phone_number_id}","title":"Update Phone Number","icon":"phone","iconType":"solid","href":"/api-reference/endpoint/agent/update-phone-number"},{"openapi":"delete /v1/agent/phone-numbers/{phone_number_id}","title":"Release Phone Number","icon":"phone","iconType":"solid","href":"/api-reference/endpoint/agent/release-phone-number"}]},{"group":"Phone Calls","icon":"phone-arrow-up-right","pages":[{"openapi":"post /v1/agent/phone-calls","title":"Create Phone Call","icon":"phone-arrow-up-right","iconType":"solid","href":"/api-reference/endpoint/agent/create-phone-call"}]}]},{"group":"SDK Reference","pages":[{"group":"Python SDK","icon":"python","pages":[{"title":"Overview","icon":"python","href":"/api-reference/sdk/python/overview"},{"group":"Reference","icon":"book-open","pages":[{"title":null,"href":"/api-reference/sdk/python/client"},{"title":null,"href":"/api-reference/sdk/python/resources"},{"title":null,"href":"/api-reference/sdk/python/types"},{"title":null,"href":"/api-reference/sdk/python/core"},{"title":null,"href":"/api-reference/sdk/python/utils"},{"title":null,"href":"/api-reference/sdk/python/exceptions"}]},{"title":"Legacy","icon":"clock-rotate-left","href":"/archive/python-sdk-legacy/index"}]},{"group":"JavaScript SDK","icon":"js","pages":[{"title":"JavaScript SDK Reference","sidebarTitle":"Reference","icon":"book","href":"/api-reference/sdk/javascript/api-reference"}]}]}]}]},"basePath":"","title":"Text to Speech - Fish Audio","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js","Markdown-BOgQCTwD.js","clsx-BIWXJmsZ.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DKZWslLH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-UDqbR6xh.js"]}