Modellss Docs
  1. Audio
  • Send Request
  • Model List and Price
  • Model APIs
    • Chat API
      • Chat
      • GPTs
      • gemini-pro
      • gpt-4-all(Image)
      • gpt-4-vision-preview
    • Chat Completions API
      • Chat Completions API
    • Image API
      • Midjourney
        • InsightFace task submission
          • Submit swap_face task
        • Task Submission
          • Perform Action
          • Submit Blend Task
          • Submit a Describe task
          • Submit a Imagine task
          • Submit Modal
          • Submit Shorten Task
        • Task Inquiry
          • Inquire about all tasks
          • Inquire about tasks based on a list of IDs
          • Paged query for tasks
          • Inquire about the task queue
          • Cancel task
          • Retrieve task with specified ID
          • Get the seed for the task image
      • DALL·E 3
      • Stable Diffusion
      • MJ Chat
      • gpt-4-all(generate images)
    • Embedding Vector Generation Interface (Embeddings)
      • Create Embeddings
    • Audio
      • Create transcription
        POST
      • Create translation
        POST
      • Text to speech
        POST
  • Help Center
    • FAQ
  1. Audio

Text to speech

POST
/v1/audio/speech
The Audio API provides a speech endpoint based on our TTS (text-to-speech) model. It comes with 6 built-in voices and can be used to:
Narrate a written blog post
Produce spoken audio in multiple languages
Give real time audio output using streaming
Generates audio from the input text.
将输入文本转录为音频。

Request

Header Params
Content-Type
string 
required
Example:
application/json
Authorization
string 
required
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
model
string 
required
One of the available TTS models: tts-1 or tts-1-hd
input
string 
required
The text to generate audio from. The maximum length is 4096 characters.
voice
string 
required
The voice to use when generating audio. Supported voices are: alloy, echo, fable, onyx, nova and shimmer.
response_format
string 
optional
The default is mp3 audio format. Supported formats are: mp3, opus, aac and flac.
speed
number 
optional
Defaults to 1. Generated audio speed. Choose a value between 0.25 and 4.0. 1.0 is the default value.
Example
{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.modelless.co/v1/audio/speech' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }'

Responses

🟢200OK
application/json
Body
object {0}
Example
{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
}
Previous
Create translation
Next
FAQ
Built with