Skip to main content
POST
https://api.mor.org
/
api
/
v1
/
audio
/
speech
Create Audio Speech
curl --request POST \
  --url https://api.mor.org/api/v1/audio/speech \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "<string>",
  "model": "<string>",
  "voice": "<string>",
  "response_format": "<string>",
  "speed": 123,
  "session_id": "<string>"
}
'
{
  "Content-Type": "<string>",
  "Body": {}
}
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

Authorization
string
required
API key in format: Bearer sk-xxxxxx

Body

input
string
required
Text to convert to speech.Example:
"input": "Hello, this is a test of the text-to-speech system."
model
string
Model ID to use for speech generation (blockchain hex address or name).
Use the List Models endpoint to see available TTS models.
voice
string
default:"af_alloy"
Voice to use for speech generation. Available voices depend on the selected model.
response_format
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.
speed
number
default:"1"
Speech speed multiplier. Range typically 0.25 to 4.0, where 1.0 is normal speed.
session_id
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).
Content-Type
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
Body
binary
Binary audio file data

Example Request

import openai

client = 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 file
with open("output.mp3", "wb") as f:
    f.write(response.content)

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.