Generate audio speech from text.This endpoint converts text to speech using the Morpheus Network providers. It automatically manages sessions and routes requests to the appropriate TTS model.Returns binary audio data in the specified format.
Swagger UI may not be able to play the audio directly. To test, click “Download” and play the file in your media player, or use curl to save the audio file.
Headers
string
required
API key in format: Bearer sk-xxxxxx
Body
string
required
Text to convert to speech.Example:
"input": "Hello, this is a test of the text-to-speech system."
string
Model ID to use for speech generation (blockchain hex address or name).
Use the List Models endpoint to see available TTS models.
string
default:"af_alloy"
Voice to use for speech generation. Available voices depend on the selected model.
string
default:"mp3"
Audio format for the response. Options: mp3, opus, aac, flac, wav, pcm
mp3 is the most widely supported format. Use wav or pcm for uncompressed audio.
number
default:"1"
Speech speed multiplier. Range typically 0.25 to 4.0, where 1.0 is normal speed.
string
Optional session ID to use for this request. If not provided, the system will automatically create or use the session associated with the API key.
Response
The endpoint returns binary audio data in the requested format. The content type will match the response_format parameter (e.g., audio/mpeg for mp3, audio/wav for wav).
string
Audio MIME type matching the requested format:
audio/mpeg for mp3
audio/opus for opus
audio/aac for aac
audio/flac for flac
audio/wav for wav
audio/pcm for pcm
binary
Binary audio file data
Example Request
import openaiclient = openai.OpenAI( api_key="sk-xxxxxx", base_url="https://api.mor.org/api/v1")response = client.audio.speech.create( model="tts-model", input="Hello, this is a test of the text-to-speech system.", voice="af_alloy", response_format="mp3")# Save the audio filewith open("output.mp3", "wb") as f: f.write(response.content)
import OpenAI from 'openai';import fs from 'fs';const client = new OpenAI({ apiKey: 'sk-xxxxxx', baseURL: 'https://api.mor.org/api/v1'});const response = await client.audio.speech.create({ model: 'tts-model', input: 'Hello, this is a test of the text-to-speech system.', voice: 'af_alloy', response_format: 'mp3'});// Save the audio fileconst buffer = Buffer.from(await response.arrayBuffer());fs.writeFileSync('output.mp3', buffer);
curl -X POST https://api.mor.org/api/v1/audio/speech \ -H "Authorization: Bearer sk-xxxxxx" \ -H "Content-Type: application/json" \ -d '{ "model": "tts-model", "input": "Hello, this is a test of the text-to-speech system.", "voice": "af_alloy", "response_format": "mp3" }' \ --output output.mp3
Use Cases
Accessibility
Convert text content to audio for visually impaired users
Content Creation
Generate voiceovers for videos, podcasts, and multimedia content
Interactive Applications
Add voice responses to chatbots and virtual assistants
Language Learning
Create pronunciation guides and language learning materials
The API is fully compatible with the OpenAI SDK. Simply change the base_url to point to the Morpheus Gateway.
Large text inputs may result in longer processing times. Consider breaking very long texts into smaller segments for better performance.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Morpheus Inference API","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/morpheus/B8wp8jG_KM5hucbL/logo/Morpheus-white-bg.png?fit=max\u0026auto=format\u0026n=B8wp8jG_KM5hucbL\u0026q=85\u0026s=31fb71bb6dbaeb1bc8c0b205bff83611","dark":"https://mintcdn.com/morpheus/B8wp8jG_KM5hucbL/logo/Morpheus-black-bg.png?fit=max\u0026auto=format\u0026n=B8wp8jG_KM5hucbL\u0026q=85\u0026s=5dabace81afbd3892078ad8d6a8f78e8"},"favicon":"https://mintcdn.com/morpheus/zkkoHtdILftrA39F/favicon.svg?fit=max\u0026auto=format\u0026n=zkkoHtdILftrA39F\u0026q=85\u0026s=527bbf46dec337b03d1521a2600ac73b","api":{"playground":{"proxy":false},"mdx":{"server":"https://api.mor.org"}},"navbar":{"links":[{"href":"mailto:devs@mor.org","label":"Support"}]},"footer":{"socials":{"x":"https://x.com/morpheusais","github":"https://github.com/morpheusais","linkedin":"https://linkedin.com/company/mintlify","discord":"https://discord.gg/kyVaxTHnvB"}},"integrations":{"ga4":{"measurementId":"G-D0TCTKQ051"}},"contextual":{"options":["copy","view","mcp","cursor","chatgpt","claude","perplexity","vscode"],"display":"header"},"metadata":{"timestamp":false},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://mor.org/blog"},{"anchor":"Community","icon":"discord","href":"https://discord.gg/kyVaxTHnvB"},{"anchor":"Announcements","icon":"x","href":"https://x.com/morpheusais"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"morpheus","hasAudioNarration":false,"actualSubdomain":"morpheus","customDomains":["apidocs.mor.org"],"gitSource":{"type":"github","owner":"morpheusais","repo":"api-gateway-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":false},"entitlements":{},"buildId":"6ae93ff280bb0649edf3a3b6:success","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"default","tag":"Documentation","count":19},{"language":"default","tag":"API Reference","count":15},{"language":"default","tag":"Models","count":6},{"language":"default","tag":"Billing","count":5},{"language":"default","tag":"Getting Started","count":4},{"language":"default","tag":"Guides","count":4},{"language":"default","tag":"Utility","count":3},{"language":"default","tag":"Chat UIs","count":2},{"language":"default","tag":"AI Coding Tools","count":2},{"language":"default","tag":"Agent Frameworks","count":2}]},"assistantConfig":{},"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":"workos-onboarding","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":"assistant-v5","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":"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":"editor-metadata","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},{"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":"control","enabled":true,"payload":{"type":"string","value":"control"},"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}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/audio/speech","slug":"/api-reference/audio/speech","pageMetadata":{"title":"Create Audio Speech","api":"POST /api/v1/audio/speech","description":"Generate audio speech from text using text-to-speech models","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: \"Generate audio speech from text using text-to-speech models\"\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`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Note,ParamField,ResponseField,Tip,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Generate audio speech from text.`}),`\n`,_jsx(_components.p,{children:`This endpoint converts text to speech using the Morpheus Network providers. It automatically manages sessions and routes requests to the appropriate TTS model.`}),`\n`,_jsx(_components.p,{children:`Returns binary audio data in the specified format.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Swagger UI may not be able to play the audio directly. To test, click “Download” and play the file in your media player, or use curl to save the audio file.`})}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:_jsxs(_components.p,{children:[`API key in format: `,_jsx(_components.code,{children:`Bearer sk-xxxxxx`})]})}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsxs(ParamField,{body:`input`,type:`string`,required:true,id:`param-input`,children:[_jsx(_components.p,{children:`Text to convert to speech.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example:`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"input\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, this is a test of the text-to-speech system.\"`})]}),`\n`]})})})]}),`\n`,_jsxs(ParamField,{body:`model`,type:`string`,id:`param-model`,children:[_jsx(_components.p,{children:`Model ID to use for speech generation (blockchain hex address or name).`}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Use the `,_jsx(_components.a,{href:`/api-reference/models/list`,children:`List Models`}),` endpoint to see available TTS models.`]})})]}),`\n`,_jsx(ParamField,{body:`voice`,type:`string`,default:`af_alloy`,id:`param-voice`,children:_jsx(_components.p,{children:`Voice to use for speech generation. Available voices depend on the selected model.`})}),`\n`,_jsxs(ParamField,{body:`response_format`,type:`string`,default:`mp3`,id:`param-response-format`,children:[_jsxs(_components.p,{children:[`Audio format for the response. Options: `,_jsx(_components.code,{children:`mp3`}),`, `,_jsx(_components.code,{children:`opus`}),`, `,_jsx(_components.code,{children:`aac`}),`, `,_jsx(_components.code,{children:`flac`}),`, `,_jsx(_components.code,{children:`wav`}),`, `,_jsx(_components.code,{children:`pcm`})]}),_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`mp3`}),` is the most widely supported format. Use `,_jsx(_components.code,{children:`wav`}),` or `,_jsx(_components.code,{children:`pcm`}),` for uncompressed audio.`]})})]}),`\n`,_jsx(ParamField,{body:`speed`,type:`number`,default:`1`,id:`param-speed`,children:_jsx(_components.p,{children:`Speech speed multiplier. Range typically 0.25 to 4.0, where 1.0 is normal speed.`})}),`\n`,_jsx(ParamField,{body:`session_id`,type:`string`,id:`param-session-id`,children:_jsx(_components.p,{children:`Optional session ID to use for this request. If not provided, the system will automatically create or use the session associated with the API key.`})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`The endpoint returns binary audio data in the requested format. The content type will match the `,_jsx(_components.code,{children:`response_format`}),` parameter (e.g., `,_jsx(_components.code,{children:`audio/mpeg`}),` for mp3, `,_jsx(_components.code,{children:`audio/wav`}),` for wav).`]}),`\n`,_jsxs(ResponseField,{name:`Content-Type`,type:`string`,id:`param-content-type`,children:[_jsx(_components.p,{children:`Audio MIME type matching the requested format:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`audio/mpeg`}),` for mp3`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`audio/opus`}),` for opus`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`audio/aac`}),` for aac`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`audio/flac`}),` for flac`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`audio/wav`}),` for wav`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`audio/pcm`}),` for pcm`]}),`\n`]})]}),`\n`,_jsx(ResponseField,{name:`Body`,type:`binary`,id:`param-body`,children:_jsx(_components.p,{children:`Binary audio file data`})}),`\n`,_jsx(Heading,{level:`2`,id:`example-request`,children:`Example Request`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`17`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai.OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-xxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.mor.org/api/v1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.audio.speech.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tts-model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` input`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, this is a test of the text-to-speech system.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` voice`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"af_alloy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` response_format`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mp3\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Save the audio file`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"output.mp3\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(response.content)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`18`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'fs'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'sk-xxxxxx'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.mor.org/api/v1'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`audio`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`speech`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'tts-model'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` input:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Hello, this is a test of the text-to-speech system.'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` voice:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'af_alloy'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response_format:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'mp3'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Save the audio file`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` buffer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`arrayBuffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`writeFileSync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'output.mp3'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`11`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`curl -X POST https://api.mor.org/api/v1/audio/speech \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` -H \"Authorization: Bearer sk-xxxxxx\" \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` -H \"Content-Type: application/json\" \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` -d '{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"model\": \"tts-model\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"input\": \"Hello, this is a test of the text-to-speech system.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"voice\": \"af_alloy\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"response_format\": \"mp3\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` }' \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` --output output.mp3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`use-cases`,children:`Use Cases`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Accessibility`,icon:`accessibility`,children:_jsx(_components.p,{children:`Convert text content to audio for visually impaired users`})}),_jsx(Card,{title:`Content Creation`,icon:`video`,children:_jsx(_components.p,{children:`Generate voiceovers for videos, podcasts, and multimedia content`})}),_jsx(Card,{title:`Interactive Applications`,icon:`chat-bubble-left-right`,children:_jsx(_components.p,{children:`Add voice responses to chatbots and virtual assistants`})}),_jsx(Card,{title:`Language Learning`,icon:`academic-cap`,children:_jsx(_components.p,{children:`Create pronunciation guides and language learning materials`})})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`The API is fully compatible with the OpenAI SDK. Simply change the `,_jsx(_components.code,{children:`base_url`}),` to point to the Morpheus Gateway.`]})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Large text inputs may result in longer processing times. Consider breaking very long texts into smaller segments for better performance.`})})]})}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":"Create Audio Speech","api":"POST /api/v1/audio/speech","description":"Generate audio speech from text using text-to-speech models","href":"/api-reference/audio/speech"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Headers","slug":"headers","depth":3,"children":[]},{"title":"Body","slug":"body","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]},{"title":"Example Request","slug":"example-request","depth":2,"children":[]},{"title":"Use Cases","slug":"use-cases","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Create Audio Speech","path":"/api/v1/audio/speech","servers":[{"url":"https://api.mor.org"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"Authorization":{"schema":[{"type":"string","description":"API key in format: `Bearer sk-xxxxxx`","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"input":[{"type":"string","description":"Text to convert to speech. Example:","required":true}],"model":[{"type":"string","description":"Model ID to use for speech generation (blockchain hex address or name)."}],"voice":[{"type":"string","description":"Voice to use for speech generation. Available voices depend on the selected model."}],"response_format":[{"type":"string","description":"Audio format for the response. Options: `mp3` , `opus` , `aac` , `flac` , `wav` , `pcm`"}],"speed":[{"type":"number","description":"Speech speed multiplier. Range typically 0.25 to 4.0, where 1.0 is normal speed."}],"session_id":[{"type":"string","description":"Optional session ID to use for this request. If not provided, the system will automatically create or use the session associated with the API key."}]}}],"examples":{"example":{"value":{"input":"\u003cstring>","model":"\u003cstring>","voice":"\u003cstring>","response_format":"\u003cstring>","speed":123,"session_id":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"Content-Type":[{"type":"string","description":"Audio MIME type matching the requested format: `audio/mpeg` for mp3 `audio/opus` for opus `audio/aac` for aac `audio/flac` for flac `audio/wav` for wav `audio/pcm` for pcm"}],"Body":[{"type":"object","properties":{},"description":"Binary audio file data"}]}}],"examples":{"example":{"value":{"Content-Type":"\u003cstring>","Body":{}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"morpheus","siteName":"Morpheus Inference API","title":"Create Audio Speech - Morpheus Inference API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"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=\"Generate audio speech from text using text-to-speech models\">\u003cmeta data-mint-head name=\"application-name\" content=\"Morpheus Inference 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/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_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/morpheus/kh1rgJ-Pt9Jw2R06/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Audio Speech - Morpheus Inference API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate audio speech from text using text-to-speech models\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Morpheus Inference API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://apidocs.mor.org/api-reference/audio/speech\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://morpheus.mintlify.site/_mintlify/api/og/v2?division=Audio\u0026amp;title=Create+Audio+Speech\u0026amp;description=Generate+audio+speech+from+text+using+text-to-speech+models\u0026amp;theme=86ed7a09bc1f3cc3ab3407c9\u0026amp;signature=6b75550fa6238780737c57458b39094f67a76f6bba9a3fa48de8dcb195267e08\">\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=\"Create Audio Speech - Morpheus Inference API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate audio speech from text using text-to-speech models\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://morpheus.mintlify.site/_mintlify/api/og/v2?division=Audio\u0026amp;title=Create+Audio+Speech\u0026amp;description=Generate+audio+speech+from+text+using+text-to-speech+models\u0026amp;theme=86ed7a09bc1f3cc3ab3407c9\u0026amp;signature=6b75550fa6238780737c57458b39094f67a76f6bba9a3fa48de8dcb195267e08\">\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/morpheus/kh1rgJ-Pt9Jw2R06/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Morpheus Inference API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://apidocs.mor.org/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://apidocs.mor.org/#organization\",\"name\":\"Morpheus Inference API\",\"url\":\"https://apidocs.mor.org\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/morpheus/B8wp8jG_KM5hucbL/logo/Morpheus-white-bg.png?fit=max\u0026auto=format\u0026n=B8wp8jG_KM5hucbL\u0026q=85\u0026s=31fb71bb6dbaeb1bc8c0b205bff83611\"}},{\"@type\":\"WebSite\",\"@id\":\"https://apidocs.mor.org#website\",\"name\":\"Morpheus Inference API\",\"url\":\"https://apidocs.mor.org\",\"publisher\":{\"@id\":\"https://apidocs.mor.org/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://apidocs.mor.org/api-reference/audio/speech#webpage\",\"url\":\"https://apidocs.mor.org/api-reference/audio/speech\",\"name\":\"Create Audio Speech\",\"description\":\"Generate audio speech from text using text-to-speech models\",\"isPartOf\":{\"@id\":\"https://apidocs.mor.org#website\"},\"breadcrumb\":{\"@id\":\"https://apidocs.mor.org/api-reference/audio/speech#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://apidocs.mor.org/api-reference/audio/speech#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Morpheus Inference API\",\"item\":\"https://apidocs.mor.org\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Audio Speech\",\"item\":\"https://apidocs.mor.org/api-reference/audio/speech\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://apidocs.mor.org/api-reference/audio/speech#apireference\",\"headline\":\"Create Audio Speech\",\"name\":\"Create Audio Speech\",\"description\":\"Generate audio speech from text using text-to-speech models\",\"url\":\"https://apidocs.mor.org/api-reference/audio/speech\",\"mainEntityOfPage\":{\"@id\":\"https://apidocs.mor.org/api-reference/audio/speech#webpage\"},\"publisher\":{\"@id\":\"https://apidocs.mor.org/#organization\"},\"isPartOf\":{\"@id\":\"https://apidocs.mor.org#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Morpheus Inference API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Morpheus Inference API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/audio/speech.md","siteName":"Morpheus Inference API","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://mor.org/blog"},{"anchor":"Community","icon":"discord","href":"https://discord.gg/kyVaxTHnvB"},{"anchor":"Announcements","icon":"x","href":"https://x.com/morpheusais"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/documentation/getting-started/what-is-api-gateway"}]},{"tab":"API Reference","groups":[{"group":"Getting Started","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"group":"Models","pages":[{"title":"List Models","api":"GET /api/v1/models","href":"/api-reference/models/list"},{"title":"List All Models","api":"GET /api/v1/models/allmodels","href":"/api-reference/models/all-models"},{"title":"Get Rated Bids","api":"GET /api/v1/models/ratedbids","href":"/api-reference/models/rated-bids"}]},{"group":"Chat","pages":[{"title":"Chat Completions","api":"POST /api/v1/chat/completions","href":"/api-reference/chat/completions"}]},{"group":"Embeddings","pages":[{"title":"Create Embeddings","api":"POST /api/v1/embeddings","description":"Generate vector embeddings for input text using AI models","href":"/api-reference/embeddings/create-embeddings"}]},{"group":"Audio","pages":[{"title":"Create Audio Speech","api":"POST /api/v1/audio/speech","href":"/api-reference/audio/speech"}]},{"group":"Billing","pages":[{"title":"Get Balance","api":"GET /api/v1/billing/balance","description":"Check remaining credits, daily staking allowance, and paid balance","href":"/api-reference/billing/balance"},{"title":"List Usage","api":"GET /api/v1/billing/usage","href":"/api-reference/billing/usage"},{"title":"List Usage for Month","api":"GET /api/v1/billing/usage/month","href":"/api-reference/billing/usage-month"},{"title":"Get Monthly Spending","api":"GET /api/v1/billing/spending","href":"/api-reference/billing/spending"},{"title":"List Transactions","api":"GET /api/v1/billing/transactions","href":"/api-reference/billing/transactions"}]},{"group":"Utility","pages":[{"title":"Root","api":"GET /","href":"/api-reference/utility/root"},{"title":"Health Check","api":"GET /health","href":"/api-reference/utility/health"},{"title":"Model Health Check","api":"GET /health/models","href":"/api-reference/utility/health-models"}]}]}]},"basePath":"","title":"Create Audio Speech - Morpheus Inference API","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-BtG4DSkw.js","snippetPresets-C1k1xDhp.js","utils-PMJoEt4Y.js","style-to-object-BY3JEAdk.js","utils-DW3Pr7Jq.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DIISLO2w.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BErNCZCm.js","_Uint8Array-f0PCu9f_.js","isObject-FP1Yky1u.js","ApiExamples-OjY-8mqu.js","usePlaygroundInputsStore-B2HS2hUb.js","shallow-DVFuuIDQ.js","isEqual-DG0UKiQC.js","CodeSnippets-Cy6FBgwN.js","CodeSnippet-D1PtG8ed.js","getApiPlaygroundDisplay-Dkx2eNtL.js","Page-C8Cg25if.js","DynamicMarkdown-BvJIe00T.js","SectionHeading-B0rKYV8d.js","icon-yclzBff4.js","MethodPill-DxA11cCF.js","getPastedJson-CpkIDpMk.js","DuplicateIcon-CFCQNJ-D.js","axios-CsQoIw0U.js"]}