Audio

Turn text into speech

Speaks the text with the chosen voice and stores the audio as a new file in your library. SYNCHRONOUS: the response carries the file. Billed per 1,000 characters of the trimmed text (price per quality from GET /v1/audio/speech/quote); nothing is charged when the voice cannot be generated. The language follows the text. Qualities: standard (OpenAI gpt-4o-mini-tts, takes instructions), studio (ElevenLabs Multilingual v2).

post/v1/audio/speech

Request

  • Base URL: https://contentmaschine.ai/api
  • URL: https://contentmaschine.ai/api/v1/audio/speech
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://contentmaschine.ai/api/oauth/authorize, token URL https://contentmaschine.ai/api/oauth/token)

Request body

textstring required

What to say, up to 4000 characters.

quality'standard' | 'studio'
voicestring

A voice id of the quality (see the quote). Default: its first voice.

instructionsstring

standard only: how to deliver the text, e.g. "calm and friendly".

titlestring

Used for the file name. Default: the first words of the text.

client_refstring

Idempotency key: a repeat within 24 h returns the first response and is not charged again.

Response

The stored audio file.

successboolean
timestampstring date-time

Example response

{
  "success": true,
  "data": {
    "mime_type": "audio/mpeg"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.