Skip to content

Text transcribing ​

Text-to-speech API is used to convert text to audio, suitable for voice broadcast, voice-collation, content reading and voice-to-peer output.

API Path ​

MethodologyPathReturns by
POST/v1/audio/speechsynchronous returns audio content or audio response.

Example request ​

bash
curl https://moonnexai.com/v1/audio/speech \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Welcome to MoonNexAI.",
    "voice": "alloy",
    "response_format": "mp3"
  }'

Common field ​

fieldAnnotations
modelVoice model names, for example, tts-1.
inputText that needs to be read.
voiceVoice name.
response_formatOutput format, e.g. mp3.
speedSpeed Settings, as API Reference.

response Processing ​

sceneTreatment
Play directlyWrites response audio to a player or temporary file.
Reuse AudioSaves audio files, original text, voice and model names.
Long TextMultiple audio clips by natural segment, then combined on the side of the operation.

Access Recommendations ​

  • It is recommended that, when playing for users, the audio file address and corresponding text be saved to facilitate reuse.
  • Long text please untrace the natural section and avoid a single request load of excess content.
  • If subtitles synchronous are required, save the correspondence between the text and audio clips on the side of the operation.

Relevant Pages ​